|
| 1 | +<script> |
| 2 | + export let title; |
| 3 | + export let info; |
| 4 | + export let tag; |
| 5 | + export let type; |
| 6 | +
|
| 7 | + import Fa from 'svelte-fa'; |
| 8 | + import { |
| 9 | + faQuestion, //Questions |
| 10 | + faCalendarAlt, // Date |
| 11 | + faChalkboard, //Lecture / lesson |
| 12 | + faLightbulb, //Drill |
| 13 | + faClipboard, //Test |
| 14 | + faPencilAlt, //Midterm |
| 15 | + faPenAlt, //Exam |
| 16 | + faUser // Person |
| 17 | + } from '@fortawesome/free-solid-svg-icons'; |
| 18 | +
|
| 19 | + const tagIcons = { |
| 20 | + Lecture: faChalkboard, |
| 21 | + Drill: faLightbulb, |
| 22 | + Test: faClipboard, |
| 23 | + Midterm: faPencilAlt, |
| 24 | + Exam: faPenAlt |
| 25 | + }; |
| 26 | +
|
| 27 | + const infoIcons = { |
| 28 | + Lecture: faCalendarAlt, |
| 29 | + Drill: faQuestion, |
| 30 | + Test: faQuestion, |
| 31 | + Midterm: faQuestion, |
| 32 | + Exam: faQuestion, |
| 33 | + User: faUser |
| 34 | + }; |
| 35 | +</script> |
| 36 | + |
| 37 | +<div class="content-card"> |
| 38 | + <div class="content-card-tag"> |
| 39 | + <!--<Fa icon={tagIcons[type]} />--> |
| 40 | + {tag} |
| 41 | + </div> |
| 42 | + <div class="content-card-title">{title}</div> |
| 43 | + <div class="content-card-info"> |
| 44 | + <Fa icon={infoIcons[type]} /> |
| 45 | + <span class="content-card-info-spacing" />{info} |
| 46 | + </div> |
| 47 | +</div> |
| 48 | + |
| 49 | +<style type="text/scss"> |
| 50 | + .content-card { |
| 51 | + padding: 1rem; |
| 52 | + min-width: 200px; |
| 53 | + max-width: 250px; |
| 54 | + height: 125px; |
| 55 | + box-shadow: 0 0px 4px 0 rgba(0, 0, 0, 0.02), |
| 56 | + 0 6px 20px 0 rgba(0, 0, 0, 0.02); |
| 57 | + transition: all 0.15s; |
| 58 | + overflow: hidden; |
| 59 | + font-family: 'Assistant', sans-serif; |
| 60 | + } |
| 61 | +
|
| 62 | + .content-card:hover { |
| 63 | + box-shadow: 0 0px 4px 0 rgba(0, 0, 0, 0.035), |
| 64 | + 0 6px 20px 0 rgba(0, 0, 0, 0.035); |
| 65 | + opacity: 1; |
| 66 | + } |
| 67 | +
|
| 68 | + .content-card-tag { |
| 69 | + transition: all 0.15s; |
| 70 | + background: #ffab0443; |
| 71 | + margin-bottom: 1rem; |
| 72 | + background: #ffab04; |
| 73 | + color: white; |
| 74 | + font-weight: bold; |
| 75 | + font-size: 0.7rem; |
| 76 | + border-radius: 0.2rem; |
| 77 | + padding: 0.25rem 0.7rem; |
| 78 | + width: fit-content; |
| 79 | + opacity: 0.8; |
| 80 | + } |
| 81 | +
|
| 82 | + .content-card-title { |
| 83 | + font-weight: bold; |
| 84 | + font-size: 1rem; |
| 85 | + margin-bottom: 10px; |
| 86 | + min-height: 60px; |
| 87 | + width: 100%; |
| 88 | + opacity: 0.6; |
| 89 | + transition: all 0.15s; |
| 90 | + } |
| 91 | +
|
| 92 | + .content-card-info { |
| 93 | + margin-bottom: 5px; |
| 94 | + color: #6c717a; |
| 95 | + font-size: 0.9rem; |
| 96 | + opacity: 0.6; |
| 97 | + transition: all 0.15s; |
| 98 | + } |
| 99 | +
|
| 100 | + .content-card-info-spacing { |
| 101 | + margin-left: 0.25rem; |
| 102 | + } |
| 103 | +
|
| 104 | + .content-card:hover { |
| 105 | + .content-card-info { |
| 106 | + opacity: 1; |
| 107 | + } |
| 108 | +
|
| 109 | + .content-card-title { |
| 110 | + opacity: 1; |
| 111 | + } |
| 112 | +
|
| 113 | + .content-card-tag { |
| 114 | + background: #ffab04; |
| 115 | + color: white; |
| 116 | + opacity: 1; |
| 117 | + } |
| 118 | + } |
| 119 | +</style> |
0 commit comments