1
1
<script setup lang="ts">
2
- import type { ChalInfo } from ' @/types/ChalInfo'
2
+ import type { ChalInfo , ChalCat } from ' @/types/ChalInfo'
3
3
import MaterialIcon from ' ./MaterialIcon.vue'
4
4
import MarkdownIt from ' markdown-it'
5
+ import { catIcons } from ' @/data/catIcons'
5
6
6
7
const { info } = defineProps <{ info: ChalInfo }>()
7
8
8
- const catIcons: { [cat : string ]: string } = {
9
- web: ' language' ,
10
- pwn: ' bug_report' ,
11
- rev: ' keyboard_double_arrow_left' ,
12
- misc: ' help' ,
13
- forensics: ' quick_reference_all' ,
14
- crypto: ' key' ,
15
- mobile: ' phone_android' ,
16
- cloud: ' cloud' ,
17
- osint: ' visibility' ,
18
- blockchain: ' currency_bitcoin' ,
19
- hardware: ' memory'
20
- }
21
-
22
9
const mdIt = new MarkdownIt ()
23
10
const descriptionRendered = mdIt .render (info .description )
24
11
@@ -31,7 +18,7 @@ function downloadAll() {
31
18
32
19
<template >
33
20
<div class =" w-full flex flex-col items-start" >
34
- <span class =" text-2xl opacity-40 mb-1" >{{ info.datePosted }}</span >
21
+ <span class =" text-xl opacity-40 mb-1" >{{ info.datePosted }}</span >
35
22
<h1 class =" mb-7" >{{ info.title }}</h1 >
36
23
<div class =" markdown mb-7 flex flex-col gap-y-3" v-html =" descriptionRendered" ></div >
37
24
<div class =" flex flex-wrap gap-3" >
@@ -40,7 +27,7 @@ function downloadAll() {
40
27
:key =" i"
41
28
class =" h-9 bg-white rounded-full flex items-center"
42
29
>
43
- <material-icon sm :name =" catIcons[cat]!" class =" ml-3 mr-2 text-black" />
30
+ <material-icon sm :name =" catIcons[cat as ChalCat ]!" class =" ml-3 mr-2 text-black" />
44
31
<span class =" mr-4 text-black font-semibold" >{{ cat }}</span >
45
32
</div >
46
33
<div class =" h-9 bg-almost-black rounded-full px-5 flex items-center" >
0 commit comments