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 { |
| 6 | constructor(props) { |
| 7 | super(props); |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 8 | this.keys = [] |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 9 | } |
| 10 | |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 11 | render() { |
| 12 | return ( |
| 13 | <div className={Styles.header} style={{ |
| 14 | backgroundImage:`linear-gradient(69.44deg, #${this.props.gradient[0]} 0%, #${this.props.gradient[1]} 100%)`, |
| 15 | margin: "0" |
| 16 | }} id={this.props.id ? this.props.id : null}> |
pineafan | 876af7d | 2021-10-14 20:31:21 +0100 | [diff] [blame] | 17 | <Head> |
pineafan | 4f9cf4d | 2021-10-24 09:02:30 +0100 | [diff] [blame] | 18 | <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] | 19 | <meta name="title" content={this.props.name} /> |
| 20 | <meta name="og:title" content={this.props.name} /> |
pineafan | 876af7d | 2021-10-14 20:31:21 +0100 | [diff] [blame] | 21 | <meta name="description" content={this.props.subtext} /> |
| 22 | <meta name="og:description" content={this.props.subtext} /> |
pineafan | 40a7e4b | 2021-10-16 21:26:03 +0100 | [diff] [blame] | 23 | <meta name="theme-color" content={"#" + this.props.gradient[1]} /> |
| 24 | <meta name="og:theme-color" content={"#" + this.props.gradient[1]} /> |
| 25 | <meta name="author" content="Clicks Minute Per" /> |
| 26 | <meta name="og:author" content="Clicks Minute Per" /> |
pineafan | 876af7d | 2021-10-14 20:31:21 +0100 | [diff] [blame] | 27 | </Head> |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 28 | <img alt="" className={Styles.backgroundImage} src={`/Headers/${this.props.wave}.svg`} /> |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 29 | <div className={Styles.panel}> |
| 30 | <div className={Styles.titleContainer}> |
| 31 | <h1 className={Styles.title}>{this.props.name}</h1> |
| 32 | </div> |
| 33 | <p className={Styles.subtext + " " + (this.props.buttons.length ? Styles.subtextExtra : null)}>{this.props.subtext}</p> |
| 34 | <div className={Styles.buttonLayout}> |
| 35 | { |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 36 | this.props.buttons ? this.props.buttons.map((button, index) => { |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 37 | return <a |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 38 | key={index} |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 39 | className={Styles.button} |
| 40 | style={{backgroundColor:`#${button.color}`, color:`#${button.buttonText}`}} |
Samuel Shuert | 835c71f | 2021-09-03 15:49:26 -0500 | [diff] [blame] | 41 | href={button.link} |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 42 | target={button.target ? "_blank" : null} |
| 43 | rel="noreferror"> |
Samuel Shuert | 835c71f | 2021-09-03 15:49:26 -0500 | [diff] [blame] | 44 | {button.text} |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 45 | </a> |
| 46 | }) : null |
| 47 | } |
| 48 | </div> |
| 49 | </div> |
| 50 | <span className={Styles.arrowSpan + " " + (this.props.hideArrow ? Styles.arrowHidden : null)}> |
pineafan | 30307e6 | 2021-11-02 21:09:43 +0000 | [diff] [blame] | 51 | <a href="#start"><img alt="Down arrow" src="/Arrow.svg" className={Styles.arrow} draggable={false} /></a> |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 52 | </span> |
| 53 | </div> |
| 54 | ) |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | export default Header; |