blob: 1ec054b101a75921d8d8ad6c79ec0c55ac7d7f54 [file] [log] [blame]
pineafane0283a82022-02-13 10:05:56 +00001import { Component, useRef } from "react";
2import Styles from '../styles/Components/header.module.css';
pineafan876af7d2021-10-14 20:31:21 +01003import Head from 'next/head';
pineafana5ce9102021-09-02 17:21:31 +01004
5class Header extends Component {
pineafan9b1b68c2021-11-05 17:47:27 +00006 constructor(props) {
7 super(props);
Samuel Shuert604e31d2021-09-02 16:06:20 -05008 this.keys = []
pineafan9b1b68c2021-11-05 17:47:27 +00009 }
pineafana5ce9102021-09-02 17:21:31 +010010
pineafan9b1b68c2021-11-05 17:47:27 +000011 render() {
12 return (
pineafana5ce9102021-09-02 17:21:31 +010013 <div className={Styles.header} style={{
pineafaneebe3c62022-02-11 19:46:21 +000014 margin: "0",
pineafane0283a82022-02-13 10:05:56 +000015 minHeight: this.props.fullscreen ? "100vh" : "calc(100vh - (2 * max(2em, 4vw)) - 1em)",
pineafana5ce9102021-09-02 17:21:31 +010016 }} id={this.props.id ? this.props.id : null}>
pineafana841c762021-11-14 21:21:04 +000017 <div className={Styles.backgroundGradient} style={{
18 backgroundImage: `linear-gradient(69.44deg, #${this.props.gradient[0]} 0%, #${this.props.gradient[1]} 100%)`,
19 }} />
pineafan876af7d2021-10-14 20:31:21 +010020 <Head>
pineafan4f9cf4d2021-10-24 09:02:30 +010021 <title>{this.props.nameOverwrite ? this.props.nameOverwrite : this.props.name} - Clicks Minute Per</title>
pineafan40a7e4b2021-10-16 21:26:03 +010022 <meta name="title" content={this.props.name} />
23 <meta name="og:title" content={this.props.name} />
pineafan876af7d2021-10-14 20:31:21 +010024 <meta name="description" content={this.props.subtext} />
25 <meta name="og:description" content={this.props.subtext} />
pineafan40a7e4b2021-10-16 21:26:03 +010026 <meta name="theme-color" content={"#" + this.props.gradient[1]} />
27 <meta name="og:theme-color" content={"#" + this.props.gradient[1]} />
28 <meta name="author" content="Clicks Minute Per" />
29 <meta name="og:author" content="Clicks Minute Per" />
pineafan876af7d2021-10-14 20:31:21 +010030 </Head>
pineafana841c762021-11-14 21:21:04 +000031 <img draggable={false} alt="" className={Styles.backgroundImage} src={`https://assets.clicksminuteper.net/${this.props.wave}.svg`} />
pineafana5ce9102021-09-02 17:21:31 +010032 <div className={Styles.panel}>
33 <div className={Styles.titleContainer}>
34 <h1 className={Styles.title}>{this.props.name}</h1>
35 </div>
36 <p className={Styles.subtext + " " + (this.props.buttons.length ? Styles.subtextExtra : null)}>{this.props.subtext}</p>
37 <div className={Styles.buttonLayout}>
38 {
Samuel Shuert604e31d2021-09-02 16:06:20 -050039 this.props.buttons ? this.props.buttons.map((button, index) => {
pineafana5ce9102021-09-02 17:21:31 +010040 return <a
Samuel Shuert604e31d2021-09-02 16:06:20 -050041 key={index}
pineafana5ce9102021-09-02 17:21:31 +010042 className={Styles.button}
pineafan9b1b68c2021-11-05 17:47:27 +000043 style={{ backgroundColor: `#${button.color}`, color: `#${button.buttonText}` }}
Samuel Shuert835c71f2021-09-03 15:49:26 -050044 href={button.link}
pineafan1de98762022-02-13 13:35:30 +000045 onClick={() => { if (button.id) { this.props.callback(this.props.that, button.id) } }}
pineafanaed30242021-09-04 09:33:40 +010046 target={button.target ? "_blank" : null}
pineafan0a178732022-02-09 21:00:05 +000047 rel="noreferrer">
pineafan9b1b68c2021-11-05 17:47:27 +000048 {button.text}
pineafana5ce9102021-09-02 17:21:31 +010049 </a>
50 }) : null
51 }
52 </div>
53 </div>
pineafan78727452021-11-04 21:25:07 +000054 <span className={Styles.arrowSpan + " " + (this.props.hideArrow ? Styles.arrowHidden : null)} draggable={false}>
pineafana841c762021-11-14 21:21:04 +000055 <a href="#start" draggable={false}><img alt="Down arrow" src="https://assets.clicksminuteper.net/web/icons/arrow.svg" className={Styles.arrow} draggable={false} style={{
pineafan31d5d602021-11-13 21:10:30 +000056 height: "49px", width: "87px"
57 }}/></a>
pineafana5ce9102021-09-02 17:21:31 +010058 </span>
59 </div>
pineafan9b1b68c2021-11-05 17:47:27 +000060 )
61 }
pineafana5ce9102021-09-02 17:21:31 +010062}
63
64export default Header;