|
13 | 13 | // alwaysShowTracks: false
|
14 | 14 | // });
|
15 | 15 | let data = await getData();
|
16 |
| - project = [...data.projectsPage?.engineeringProjects!, ...data.projectsPage?.programmingProjects!].find( |
| 16 | + project = [ |
| 17 | + ...data.projectsPage?.engineeringProjects!, |
| 18 | + ...data.projectsPage?.programmingProjects! |
| 19 | + ].find( |
17 | 20 | (p) =>
|
18 | 21 | p.name?.trim().replaceAll(' ', '-') ===
|
19 | 22 | $page.params.projectName.trim().replaceAll(' ', '-')
|
20 | 23 | );
|
21 |
| - project?.description?.subheadings?.forEach((s) => {s.showSubHeadings = true}) |
| 24 | + project?.description?.subheadings?.forEach((s) => { |
| 25 | + s.showSubHeadings = true; |
| 26 | + }); |
22 | 27 | });
|
23 | 28 | $: console.log(project);
|
24 | 29 | </script>
|
|
36 | 41 | <p class="relative text-left text-xl pl-[12.5%]">{project.description?.overview}</p>
|
37 | 42 | </div>
|
38 | 43 | {#each project.description?.subheadings || [] as subHeading}
|
39 |
| - <div class="relative left-[12.5%] w-[75%] mt-[2%] mb-[2%] {subHeading.border ? 'border-b' : ''} pb-[2%] border-slate-500"> |
40 |
| - <h1 |
41 |
| - class="relative text-3xl mt-[2%] font-semi-bold text-sky-500 mb-2 text-left underline" |
42 |
| - > |
43 |
| - {subHeading.title || ''} |
44 |
| - </h1> |
| 44 | + <div |
| 45 | + class="relative left-[12.5%] w-[75%] mt-[2%] mb-[2%] {subHeading.border |
| 46 | + ? 'border-b' |
| 47 | + : ''} pb-[2%] border-slate-500" |
| 48 | + > |
| 49 | + {#if subHeading.title} |
| 50 | + <h1 |
| 51 | + class="relative text-3xl mt-[2%] font-semi-bold text-sky-500 mb-2 text-left underline" |
| 52 | + > |
| 53 | + {subHeading.title || ''} |
| 54 | + </h1> |
| 55 | + {/if} |
45 | 56 | {#if subHeading.html}
|
46 | 57 | {@html subHeading.content}
|
47 | 58 | {:else}
|
|
56 | 67 | on:click={() => {
|
57 | 68 | subHeading.showSubHeadings = !subHeading.showSubHeadings;
|
58 | 69 | }}
|
59 |
| - class="w-fit absolute right-[12.5%] top-[2%] text-slate-400 hover:text-sky-500 transition-all duration-200 {subHeading.subheadings ? '' : 'hidden'}" |
| 70 | + class="w-fit absolute right-[12.5%] top-[2%] text-slate-400 hover:text-sky-500 transition-all duration-200 {subHeading.subheadings |
| 71 | + ? '' |
| 72 | + : 'hidden'}" |
60 | 73 | >
|
61 | 74 | {#if subHeading.showSubHeadings}
|
62 | 75 | <svg
|
|
92 | 105 | </button>
|
93 | 106 | {#each subHeading.subheadings || [] as subsubHeading}
|
94 | 107 | <div
|
95 |
| - class="relative left-[12.5%] w-[75%] mt-[2%] mb-[2%] border-slate-500 pb-[2%] {subsubHeading.border ? 'border-b' : ''} {subHeading.showSubHeadings |
96 |
| - ? '' |
97 |
| - : 'hidden'}" |
| 108 | + class="relative left-[12.5%] w-[75%] mt-[2%] mb-[2%] border-slate-500 pb-[2%] {subsubHeading.border |
| 109 | + ? 'border-b' |
| 110 | + : ''} {subHeading.showSubHeadings ? '' : 'hidden'}" |
98 | 111 | >
|
99 |
| - <h1 |
100 |
| - class="relative text-3xl mt-[2%] font-semi-bold text-sky-500 mb-2 text-left underline" |
101 |
| - > |
102 |
| - {subsubHeading.title || ''} |
103 |
| - </h1> |
| 112 | + {#if subsubHeading.title} |
| 113 | + <h1 |
| 114 | + class="relative text-3xl mt-[2%] font-semi-bold text-sky-500 mb-2 text-left underline" |
| 115 | + > |
| 116 | + {subsubHeading.title || ''} |
| 117 | + </h1> |
| 118 | + {/if} |
104 | 119 | {#if subsubHeading.html}
|
105 | 120 | {@html subsubHeading.content}
|
106 | 121 | {:else}
|
|
0 commit comments