|
| 1 | +--- |
| 2 | +import BackLink from "@/components/BackLink/BackLink.astro"; |
| 3 | +import Profile from "@/components/Profile/Profile.astro"; |
| 4 | +import TimelineEntry from "@/components/AboutPage/TimelineEntry.astro"; |
| 5 | +import WorksGrid from "@/components/WorksGrid/WorksGrid.astro"; |
| 6 | +import { type PersonalData } from "@/data/personal"; |
| 7 | +import { |
| 8 | + formatHistoryDate, |
| 9 | + sortByDateDesc, |
| 10 | + sortHistory, |
| 11 | + type AboutCopy, |
| 12 | +} from "@/libraries/about"; |
| 13 | +import styles from "@/styles/about.module.scss"; |
| 14 | +
|
| 15 | +interface Props { |
| 16 | + copy: AboutCopy; |
| 17 | + personalData: PersonalData; |
| 18 | + supplementalLink?: { |
| 19 | + href: string; |
| 20 | + label: string; |
| 21 | + ariaLabel?: string; |
| 22 | + }; |
| 23 | +} |
| 24 | +
|
| 25 | +const { copy, personalData, supplementalLink } = Astro.props as Props; |
| 26 | +
|
| 27 | +const sortedHistory = sortHistory(personalData.history); |
| 28 | +const educationHistory = sortedHistory.filter( |
| 29 | + (item) => item.type === "education" |
| 30 | +); |
| 31 | +const careerHistory = sortedHistory.filter((item) => item.type !== "education"); |
| 32 | +const sortedCerts = sortByDateDesc(personalData.certs); |
| 33 | +const sortedCtfs = sortByDateDesc(personalData.ctfs); |
| 34 | +--- |
| 35 | + |
| 36 | +<div class={styles.container}> |
| 37 | + <BackLink title={copy.backLinkTitle} supplementalLink={supplementalLink} /> |
| 38 | + <Profile mode="row" hideAbout class={styles.header} priority data={personalData} /> |
| 39 | + <div class={styles.content}> |
| 40 | + <section class={styles.interests}> |
| 41 | + <div class={styles.sectionHeader}> |
| 42 | + <h2 class={styles.sectionTitle}>{copy.sections.interests}</h2> |
| 43 | + </div> |
| 44 | + <div class={styles.sectionContent}> |
| 45 | + <ul> |
| 46 | + {personalData.interests.map((interest) => <li>{interest}</li>)} |
| 47 | + </ul> |
| 48 | + </div> |
| 49 | + </section> |
| 50 | + <section class={styles.likes}> |
| 51 | + <div class={styles.sectionHeader}> |
| 52 | + <h2 class={styles.sectionTitle}>{copy.sections.likes}</h2> |
| 53 | + </div> |
| 54 | + <div class={styles.sectionContent}> |
| 55 | + <ul> |
| 56 | + {personalData.likes.map((like) => <li>{like}</li>)} |
| 57 | + </ul> |
| 58 | + <div class={styles.spotifyEmbed}> |
| 59 | + <iframe |
| 60 | + title="Top Tracks" |
| 61 | + src={`https://stats-embeds.kq5.jp/embed/top?user=${personalData.statsfmUsername}`} |
| 62 | + width="100%" |
| 63 | + height="160" |
| 64 | + loading="lazy"></iframe> |
| 65 | + </div> |
| 66 | + <p> |
| 67 | + {copy.music.prefix} |
| 68 | + <a href="/music/" class={styles.itemLink}>{copy.music.label}</a> |
| 69 | + {copy.music.suffix} |
| 70 | + </p> |
| 71 | + </div> |
| 72 | + </section> |
| 73 | + <section class={styles.history}> |
| 74 | + <div class={styles.sectionHeader}> |
| 75 | + <h2 class={styles.sectionTitle}>{copy.sections.education}</h2> |
| 76 | + </div> |
| 77 | + <div class:list={[styles.sectionContent, styles.timeline]}> |
| 78 | + { |
| 79 | + educationHistory.map((item) => ( |
| 80 | + <TimelineEntry |
| 81 | + date={formatHistoryDate(item)} |
| 82 | + title={item.title} |
| 83 | + links={item.links} |
| 84 | + layout="term" |
| 85 | + > |
| 86 | + {item.description && <p>{item.description}</p>} |
| 87 | + </TimelineEntry> |
| 88 | + )) |
| 89 | + } |
| 90 | + </div> |
| 91 | + </section> |
| 92 | + <section class={styles.history}> |
| 93 | + <div class={styles.sectionHeader}> |
| 94 | + <h2 class={styles.sectionTitle}>{copy.sections.career}</h2> |
| 95 | + </div> |
| 96 | + <div class:list={[styles.sectionContent, styles.timeline]}> |
| 97 | + { |
| 98 | + careerHistory.map((item) => ( |
| 99 | + <TimelineEntry |
| 100 | + date={formatHistoryDate(item)} |
| 101 | + title={item.title} |
| 102 | + links={item.links} |
| 103 | + layout="term" |
| 104 | + > |
| 105 | + {item.description && <p>{item.description}</p>} |
| 106 | + </TimelineEntry> |
| 107 | + )) |
| 108 | + } |
| 109 | + </div> |
| 110 | + </section> |
| 111 | + <section class={styles.certs}> |
| 112 | + <div class={styles.sectionHeader}> |
| 113 | + <h2 class={styles.sectionTitle}>{copy.sections.certs}</h2> |
| 114 | + </div> |
| 115 | + <div class:list={[styles.sectionContent, styles.timeline]}> |
| 116 | + { |
| 117 | + sortedCerts.map((cert) => ( |
| 118 | + <TimelineEntry |
| 119 | + date={cert.date} |
| 120 | + title={cert.name} |
| 121 | + links={cert.links} |
| 122 | + layout="date" |
| 123 | + > |
| 124 | + {cert.description && <p>{cert.description}</p>} |
| 125 | + </TimelineEntry> |
| 126 | + )) |
| 127 | + } |
| 128 | + </div> |
| 129 | + </section> |
| 130 | + <section class={styles.ctfs}> |
| 131 | + <div class={styles.sectionHeader}> |
| 132 | + <h2 class={styles.sectionTitle}>{copy.sections.ctfs}</h2> |
| 133 | + </div> |
| 134 | + <div class:list={[styles.sectionContent, styles.timeline]}> |
| 135 | + { |
| 136 | + sortedCtfs.map((ctf) => ( |
| 137 | + <TimelineEntry |
| 138 | + date={ctf.date} |
| 139 | + title={ctf.name} |
| 140 | + links={ctf.links} |
| 141 | + layout="date" |
| 142 | + > |
| 143 | + <p> |
| 144 | + {ctf.team} / {ctf.rank} |
| 145 | + </p> |
| 146 | + </TimelineEntry> |
| 147 | + )) |
| 148 | + } |
| 149 | + </div> |
| 150 | + </section> |
| 151 | + <section class={styles.works}> |
| 152 | + <div class={styles.sectionHeader}> |
| 153 | + <h2 class={styles.sectionTitle}>{copy.sections.works}</h2> |
| 154 | + <a |
| 155 | + href="/works/" |
| 156 | + class={styles.sectionHeaderLink} |
| 157 | + aria-label={copy.worksLink.ariaLabel} |
| 158 | + > |
| 159 | + {copy.worksLink.label} |
| 160 | + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg> |
| 161 | + </a> |
| 162 | + </div> |
| 163 | + <WorksGrid onlyPinned={true} works={personalData.works} /> |
| 164 | + </section> |
| 165 | + <section class={styles.extraLinks}> |
| 166 | + <div class={styles.sectionHeader}> |
| 167 | + <h2 class={styles.sectionTitle}>{copy.sections.extraLinks}</h2> |
| 168 | + </div> |
| 169 | + <div class={styles.sectionContent}> |
| 170 | + <ul> |
| 171 | + { |
| 172 | + personalData.extraLinks.map((link) => ( |
| 173 | + <li> |
| 174 | + <a href={link.url} target="_blank" rel="noopener noreferrer"> |
| 175 | + {link.name} |
| 176 | + </a> |
| 177 | + </li> |
| 178 | + )) |
| 179 | + } |
| 180 | + </ul> |
| 181 | + </div> |
| 182 | + </section> |
| 183 | + </div> |
| 184 | +</div> |
0 commit comments