blob: 85a2407139767d327312828c4ed549c5cd9c0497 [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={{
12 backgroundImage:`linear-gradient(69.44deg, #${this.props.gradient[0]} 0%, #${this.props.gradient[1]} 100%)`,
13 margin: "0"
14 }}>
pineafan78727452021-11-04 21:25:07 +000015 <img alt="" className={Styles.backgroundImage} src={`/Waves/${this.props.wave}.svg`} draggable={false} />
pineafana5ce9102021-09-02 17:21:31 +010016 <div className={Styles.panel}>
17 <div className={Styles.titleContainer}>
pineafan939ee982021-10-25 12:44:40 +010018 <img alt="Project icon" className={Styles.image} src={"/Icons/" + (this.props.icon ? this.props.icon : this.props.wave) + ".svg"} />
pineafana5ce9102021-09-02 17:21:31 +010019 <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 Shuert604e31d2021-09-02 16:06:20 -050024 this.props.buttons ? this.props.buttons.map((button, i) => {
pineafana5ce9102021-09-02 17:21:31 +010025 return <a
Samuel Shuert604e31d2021-09-02 16:06:20 -050026 key={i}
pineafana5ce9102021-09-02 17:21:31 +010027 className={Styles.button}
28 style={{backgroundColor:`#${button.color}`, color:`#${this.props.buttonText}`}}
Samuel Shuert52f37772021-09-02 12:29:40 -050029 href={button.link}
pineafanaed30242021-09-04 09:33:40 +010030 target={button.newTab ? "_blank" : undefined}
31 rel="noreferror">{button.text}
pineafana5ce9102021-09-02 17:21:31 +010032 </a>
33 }) : null
34 }
35 </div>
Samuel Shuert016ea022021-09-01 16:17:24 -050036 </div>
37 </div>
38 )
39 }
40}
41
42export default Card;