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={{ |
| 12 | backgroundImage:`linear-gradient(69.44deg, #${this.props.gradient[0]} 0%, #${this.props.gradient[1]} 100%)`, |
| 13 | margin: "0" |
| 14 | }}> |
pineafan | 7872745 | 2021-11-04 21:25:07 +0000 | [diff] [blame] | 15 | <img alt="" className={Styles.backgroundImage} src={`/Waves/${this.props.wave}.svg`} draggable={false} /> |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 16 | <div className={Styles.panel}> |
| 17 | <div className={Styles.titleContainer}> |
pineafan | 939ee98 | 2021-10-25 12:44:40 +0100 | [diff] [blame] | 18 | <img alt="Project icon" className={Styles.image} src={"/Icons/" + (this.props.icon ? this.props.icon : this.props.wave) + ".svg"} /> |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 19 | <h1 className={Styles.title}>{this.props.title}</h1> |
| 20 | </div> |
| 21 | <p className={Styles.subtext}>{this.props.subtext}</p> |
| 22 | <div className={Styles.buttonLayout}> |
| 23 | { |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 24 | this.props.buttons ? this.props.buttons.map((button, i) => { |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 25 | return <a |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 26 | key={i} |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 27 | className={Styles.button} |
| 28 | style={{backgroundColor:`#${button.color}`, color:`#${this.props.buttonText}`}} |
Samuel Shuert | 52f3777 | 2021-09-02 12:29:40 -0500 | [diff] [blame] | 29 | href={button.link} |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 30 | target={button.newTab ? "_blank" : undefined} |
pineafan | 31d5d60 | 2021-11-13 21:10:30 +0000 | [diff] [blame^] | 31 | rel="noopener">{button.text} |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 32 | </a> |
| 33 | }) : null |
| 34 | } |
| 35 | </div> |
Samuel Shuert | 016ea02 | 2021-09-01 16:17:24 -0500 | [diff] [blame] | 36 | </div> |
| 37 | </div> |
| 38 | ) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | export default Card; |