Samuel Shuert | 016ea02 | 2021-09-01 16:17:24 -0500 | [diff] [blame] | 1 | import { Component } from "react"; |
| 2 | import Styles from '../styles/card.module.css'; |
| 3 | |
| 4 | class Card extends Component { |
| 5 | constructor(props) { |
| 6 | super(props); |
Samuel Shuert | 52f3777 | 2021-09-02 12:29:40 -0500 | [diff] [blame] | 7 | } |
Samuel Shuert | 016ea02 | 2021-09-01 16:17:24 -0500 | [diff] [blame] | 8 | |
| 9 | render() { |
| 10 | return ( |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 11 | <div className={Styles.card} style={{ |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 12 | margin: "0" |
| 13 | }}> |
pineafan | a841c76 | 2021-11-14 21:21:04 +0000 | [diff] [blame] | 14 | <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} /> |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 18 | <div className={Styles.panel}> |
| 19 | <div className={Styles.titleContainer}> |
pineafan | a841c76 | 2021-11-14 21:21:04 +0000 | [diff] [blame] | 20 | <img alt="Project icon" className={Styles.image} src={"https://assets.clicksminuteper.net/" + (this.props.icon ? this.props.icon : this.props.wave) + ".svg"} /> |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 21 | <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 Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 26 | this.props.buttons ? this.props.buttons.map((button, i) => { |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 27 | return <a |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 28 | key={i} |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 29 | className={Styles.button} |
| 30 | style={{backgroundColor:`#${button.color}`, color:`#${this.props.buttonText}`}} |
Samuel Shuert | 52f3777 | 2021-09-02 12:29:40 -0500 | [diff] [blame] | 31 | href={button.link} |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 32 | target={button.newTab ? "_blank" : undefined} |
pineafan | 0a17873 | 2022-02-09 21:00:05 +0000 | [diff] [blame^] | 33 | rel="noreferrer">{button.text} |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 34 | </a> |
| 35 | }) : null |
| 36 | } |
| 37 | </div> |
Samuel Shuert | 016ea02 | 2021-09-01 16:17:24 -0500 | [diff] [blame] | 38 | </div> |
| 39 | </div> |
| 40 | ) |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | export default Card; |