blob: 21ced4ae8c3c8c5c6b79b0cc6825d674147638b6 [file] [log] [blame]
Samuel Shuert016ea022021-09-01 16:17:24 -05001import { Component } from "react";
2import Styles from '../styles/card.module.css';
3
4class Card extends Component {
5 constructor(props) {
6 super(props);
Samuel Shuert52f37772021-09-02 12:29:40 -05007 this.keys = []
8 }
Samuel Shuert016ea022021-09-01 16:17:24 -05009
Samuel Shuert52f37772021-09-02 12:29:40 -050010 nextKey() {
11 let n = this.keys.length
12 this.keys.push(n);
13 return n
14 }
Samuel Shuert016ea022021-09-01 16:17:24 -050015
16 render() {
17 return (
pineafana5ce9102021-09-02 17:21:31 +010018 <div className={Styles.card} style={{
19 backgroundImage:`linear-gradient(69.44deg, #${this.props.gradient[0]} 0%, #${this.props.gradient[1]} 100%)`,
20 margin: "0"
21 }}>
22 <img className={Styles.backgroundImage} src={`/Waves/${this.props.wave}.svg`} />
23 <div className={Styles.panel}>
24 <div className={Styles.titleContainer}>
25 <img className={Styles.image} src={"/Icons/" + this.props.wave + ".svg"} />
26 <h1 className={Styles.title}>{this.props.title}</h1>
27 </div>
28 <p className={Styles.subtext}>{this.props.subtext}</p>
29 <div className={Styles.buttonLayout}>
30 {
31 this.props.buttons ? this.props.buttons.map(button => {
32 return <a
Samuel Shuert52f37772021-09-02 12:29:40 -050033 key={this.nextKey()}
pineafana5ce9102021-09-02 17:21:31 +010034 className={Styles.button}
35 style={{backgroundColor:`#${button.color}`, color:`#${this.props.buttonText}`}}
Samuel Shuert52f37772021-09-02 12:29:40 -050036 href={button.link}
37 target={button.newTab ? "_blank" : undefined}>{button.text}
pineafana5ce9102021-09-02 17:21:31 +010038 </a>
39 }) : null
40 }
41 </div>
Samuel Shuert016ea022021-09-01 16:17:24 -050042 </div>
43 </div>
44 )
45 }
46}
47
48export default Card;