blob: a158c4fea7ac3f78a3182fe8e4d72a299d84f4ff [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 }
Samuel Shuert016ea022021-09-01 16:17:24 -05008
9 render() {
10 return (
pineafana5ce9102021-09-02 17:21:31 +010011 <div className={Styles.card} style={{
pineafana5ce9102021-09-02 17:21:31 +010012 margin: "0"
13 }}>
pineafana841c762021-11-14 21:21:04 +000014 <div className={Styles.backgroundGradient} style={{
15 backgroundImage: `linear-gradient(69.44deg, #${this.props.gradient[0]} 0%, #${this.props.gradient[1]} 100%)`
16 }} />
17 <img alt="" className={Styles.backgroundImage} src={`https://assets.clicksminuteper.net/web/waves/card/${this.props.wave}.svg`} draggable={false} />
pineafana5ce9102021-09-02 17:21:31 +010018 <div className={Styles.panel}>
19 <div className={Styles.titleContainer}>
pineafana841c762021-11-14 21:21:04 +000020 <img alt="Project icon" className={Styles.image} src={"https://assets.clicksminuteper.net/" + (this.props.icon ? this.props.icon : this.props.wave) + ".svg"} />
pineafana5ce9102021-09-02 17:21:31 +010021 <h1 className={Styles.title}>{this.props.title}</h1>
22 </div>
23 <p className={Styles.subtext}>{this.props.subtext}</p>
24 <div className={Styles.buttonLayout}>
25 {
Samuel Shuert604e31d2021-09-02 16:06:20 -050026 this.props.buttons ? this.props.buttons.map((button, i) => {
pineafana5ce9102021-09-02 17:21:31 +010027 return <a
Samuel Shuert604e31d2021-09-02 16:06:20 -050028 key={i}
pineafana5ce9102021-09-02 17:21:31 +010029 className={Styles.button}
30 style={{backgroundColor:`#${button.color}`, color:`#${this.props.buttonText}`}}
Samuel Shuert52f37772021-09-02 12:29:40 -050031 href={button.link}
pineafanaed30242021-09-04 09:33:40 +010032 target={button.newTab ? "_blank" : undefined}
pineafan0a178732022-02-09 21:00:05 +000033 rel="noreferrer">{button.text}
pineafana5ce9102021-09-02 17:21:31 +010034 </a>
35 }) : null
36 }
37 </div>
Samuel Shuert016ea022021-09-01 16:17:24 -050038 </div>
39 </div>
40 )
41 }
42}
43
44export default Card;