pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 1 | import { Component } from "react"; |
| 2 | import Styles from '../styles/header.module.css'; |
pineafan | 876af7d | 2021-10-14 20:31:21 +0100 | [diff] [blame] | 3 | import Head from 'next/head'; |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 4 | |
| 5 | class Header extends Component { |
pineafan | 9b1b68c | 2021-11-05 17:47:27 +0000 | [diff] [blame] | 6 | constructor(props) { |
| 7 | super(props); |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 8 | this.keys = [] |
pineafan | 9b1b68c | 2021-11-05 17:47:27 +0000 | [diff] [blame] | 9 | } |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 10 | |
pineafan | 9b1b68c | 2021-11-05 17:47:27 +0000 | [diff] [blame] | 11 | render() { |
| 12 | return ( |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 13 | <div className={Styles.header} style={{ |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 14 | margin: "0" |
| 15 | }} id={this.props.id ? this.props.id : null}> |
pineafan | a841c76 | 2021-11-14 21:21:04 +0000 | [diff] [blame] | 16 | <div className={Styles.backgroundGradient} style={{ |
| 17 | backgroundImage: `linear-gradient(69.44deg, #${this.props.gradient[0]} 0%, #${this.props.gradient[1]} 100%)`, |
| 18 | }} /> |
pineafan | 876af7d | 2021-10-14 20:31:21 +0100 | [diff] [blame] | 19 | <Head> |
pineafan | 4f9cf4d | 2021-10-24 09:02:30 +0100 | [diff] [blame] | 20 | <title>{this.props.nameOverwrite ? this.props.nameOverwrite : this.props.name} - Clicks Minute Per</title> |
pineafan | 40a7e4b | 2021-10-16 21:26:03 +0100 | [diff] [blame] | 21 | <meta name="title" content={this.props.name} /> |
| 22 | <meta name="og:title" content={this.props.name} /> |
pineafan | 876af7d | 2021-10-14 20:31:21 +0100 | [diff] [blame] | 23 | <meta name="description" content={this.props.subtext} /> |
| 24 | <meta name="og:description" content={this.props.subtext} /> |
pineafan | 40a7e4b | 2021-10-16 21:26:03 +0100 | [diff] [blame] | 25 | <meta name="theme-color" content={"#" + this.props.gradient[1]} /> |
| 26 | <meta name="og:theme-color" content={"#" + this.props.gradient[1]} /> |
| 27 | <meta name="author" content="Clicks Minute Per" /> |
| 28 | <meta name="og:author" content="Clicks Minute Per" /> |
pineafan | 876af7d | 2021-10-14 20:31:21 +0100 | [diff] [blame] | 29 | </Head> |
pineafan | a841c76 | 2021-11-14 21:21:04 +0000 | [diff] [blame] | 30 | <img draggable={false} alt="" className={Styles.backgroundImage} src={`https://assets.clicksminuteper.net/${this.props.wave}.svg`} /> |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 31 | <div className={Styles.panel}> |
| 32 | <div className={Styles.titleContainer}> |
| 33 | <h1 className={Styles.title}>{this.props.name}</h1> |
| 34 | </div> |
| 35 | <p className={Styles.subtext + " " + (this.props.buttons.length ? Styles.subtextExtra : null)}>{this.props.subtext}</p> |
| 36 | <div className={Styles.buttonLayout}> |
| 37 | { |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 38 | this.props.buttons ? this.props.buttons.map((button, index) => { |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 39 | return <a |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 40 | key={index} |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 41 | className={Styles.button} |
pineafan | 9b1b68c | 2021-11-05 17:47:27 +0000 | [diff] [blame] | 42 | style={{ backgroundColor: `#${button.color}`, color: `#${button.buttonText}` }} |
Samuel Shuert | 835c71f | 2021-09-03 15:49:26 -0500 | [diff] [blame] | 43 | href={button.link} |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 44 | target={button.target ? "_blank" : null} |
pineafan | 31d5d60 | 2021-11-13 21:10:30 +0000 | [diff] [blame] | 45 | rel="noopener"> |
pineafan | 9b1b68c | 2021-11-05 17:47:27 +0000 | [diff] [blame] | 46 | {button.text} |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 47 | </a> |
| 48 | }) : null |
| 49 | } |
| 50 | </div> |
| 51 | </div> |
pineafan | 7872745 | 2021-11-04 21:25:07 +0000 | [diff] [blame] | 52 | <span className={Styles.arrowSpan + " " + (this.props.hideArrow ? Styles.arrowHidden : null)} draggable={false}> |
pineafan | a841c76 | 2021-11-14 21:21:04 +0000 | [diff] [blame] | 53 | <a href="#start" draggable={false}><img alt="Down arrow" src="https://assets.clicksminuteper.net/web/icons/arrow.svg" className={Styles.arrow} draggable={false} style={{ |
pineafan | 31d5d60 | 2021-11-13 21:10:30 +0000 | [diff] [blame] | 54 | height: "49px", width: "87px" |
| 55 | }}/></a> |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 56 | </span> |
| 57 | </div> |
pineafan | 9b1b68c | 2021-11-05 17:47:27 +0000 | [diff] [blame] | 58 | ) |
| 59 | } |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | export default Header; |