blob: 5abc91bd296f710a32f8595a496387dca5e036b6 [file] [log] [blame]
pineafana5ce9102021-09-02 17:21:31 +01001import { Component } from "react";
2import Styles from '../styles/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={{
pineafana5ce9102021-09-02 17:21:31 +010014 margin: "0"
15 }} id={this.props.id ? this.props.id : null}>
pineafana841c762021-11-14 21:21:04 +000016 <div className={Styles.backgroundGradient} style={{
17 backgroundImage: `linear-gradient(69.44deg, #${this.props.gradient[0]} 0%, #${this.props.gradient[1]} 100%)`,
18 }} />
pineafan876af7d2021-10-14 20:31:21 +010019 <Head>
pineafan4f9cf4d2021-10-24 09:02:30 +010020 <title>{this.props.nameOverwrite ? this.props.nameOverwrite : this.props.name} - Clicks Minute Per</title>
pineafan40a7e4b2021-10-16 21:26:03 +010021 <meta name="title" content={this.props.name} />
22 <meta name="og:title" content={this.props.name} />
pineafan876af7d2021-10-14 20:31:21 +010023 <meta name="description" content={this.props.subtext} />
24 <meta name="og:description" content={this.props.subtext} />
pineafan40a7e4b2021-10-16 21:26:03 +010025 <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" />
pineafan876af7d2021-10-14 20:31:21 +010029 </Head>
pineafana841c762021-11-14 21:21:04 +000030 <img draggable={false} alt="" className={Styles.backgroundImage} src={`https://assets.clicksminuteper.net/${this.props.wave}.svg`} />
pineafana5ce9102021-09-02 17:21:31 +010031 <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 Shuert604e31d2021-09-02 16:06:20 -050038 this.props.buttons ? this.props.buttons.map((button, index) => {
pineafana5ce9102021-09-02 17:21:31 +010039 return <a
Samuel Shuert604e31d2021-09-02 16:06:20 -050040 key={index}
pineafana5ce9102021-09-02 17:21:31 +010041 className={Styles.button}
pineafan9b1b68c2021-11-05 17:47:27 +000042 style={{ backgroundColor: `#${button.color}`, color: `#${button.buttonText}` }}
Samuel Shuert835c71f2021-09-03 15:49:26 -050043 href={button.link}
pineafanaed30242021-09-04 09:33:40 +010044 target={button.target ? "_blank" : null}
pineafan0a178732022-02-09 21:00:05 +000045 rel="noreferrer">
pineafan9b1b68c2021-11-05 17:47:27 +000046 {button.text}
pineafana5ce9102021-09-02 17:21:31 +010047 </a>
48 }) : null
49 }
50 </div>
51 </div>
pineafan78727452021-11-04 21:25:07 +000052 <span className={Styles.arrowSpan + " " + (this.props.hideArrow ? Styles.arrowHidden : null)} draggable={false}>
pineafana841c762021-11-14 21:21:04 +000053 <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 +000054 height: "49px", width: "87px"
55 }}/></a>
pineafana5ce9102021-09-02 17:21:31 +010056 </span>
57 </div>
pineafan9b1b68c2021-11-05 17:47:27 +000058 )
59 }
pineafana5ce9102021-09-02 17:21:31 +010060}
61
62export default Header;