Skip to content

Commit 2dc7706

Browse files
committed
feat: add skeleton to mathjax loading
1 parent 333eafb commit 2dc7706

File tree

1 file changed

+56
-18
lines changed

1 file changed

+56
-18
lines changed

pages/index.vue

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,46 @@ useHead({
149149
will change into a (1, 3) scenario.
150150
</p>
151151
<div class="overflow-x-auto">
152-
<div ref="stateTransitionDiagram"></div>
152+
<div class="mx-auto w-fit" ref="stateTransitionDiagram"></div>
153153
</div>
154154
<p>
155155
Note: The graph may be disconnected if some values are too close to zero
156156
due to insufficient precision.
157157
</p>
158158
<div>
159-
<input
160-
id="showMathematicalProofCheckbox"
161-
type="checkbox"
162-
v-model="isMathematicalProofEnabled"
163-
/>
164-
<label for="showMathematicalProofCheckbox">
159+
<UButton
160+
v-if="isMathematicalProofEnabled"
161+
class="font-bold my-2"
162+
icon="i-heroicons-eye-slash"
163+
color="red"
164+
variant="soft"
165+
@click="isMathematicalProofEnabled = false"
166+
>
167+
Hide Mathematical Proof
168+
</UButton>
169+
<UButton
170+
v-else
171+
class="font-bold my-2"
172+
icon="i-heroicons-eye"
173+
variant="soft"
174+
@click="isMathematicalProofEnabled = true"
175+
>
165176
Show Mathematical Proof (WIP)
166-
</label>
177+
</UButton>
167178
</div>
168179
<div v-if="isMathematicalProofEnabled" class="overflow-x-auto">
180+
<div v-if="!isMathRendered" class="flex flex-col gap-2 w-full">
181+
<USkeleton class="h-4" />
182+
<USkeleton class="h-4" />
183+
<USkeleton class="h-96 w-96 mx-auto" />
184+
<USkeleton class="h-96" />
185+
<USkeleton class="h-96" />
186+
<USkeleton class="h-96" />
187+
<USkeleton class="h-96" />
188+
<USkeleton class="h-96" />
189+
<USkeleton class="h-96" />
190+
<USkeleton class="h-96" />
191+
</div>
169192
<ClientOnly>
170193
<p
171194
class="has-mathjax"
@@ -247,19 +270,34 @@ useHead({
247270
}}
248271
</p>
249272
</ClientOnly>
250-
<div class="flex flex-col gap-2 font-bold my-2">
251-
<div class="flex items-center">
252-
<img src="/img/ryoshu.png" class="w-28 h-28 block rounded-lg" />
253-
<div class="speech-left p-2 ml-4 rounded-lg relative">Q.E.D.</div>
254-
</div>
255-
<div class="flex items-center">
256-
<img src="/img/sinclair.png" class="w-28 h-28 block rounded-lg" />
257-
<div class="speech-left p-2 ml-4 rounded-lg relative">
258-
Quantitative Education Delivered.
259-
</div>
273+
</div>
274+
<div
275+
v-if="isMathematicalProofEnabled"
276+
class="flex flex-col gap-2 font-bold my-2"
277+
>
278+
<div class="flex items-center">
279+
<img src="/img/ryoshu.png" class="w-28 h-28 block rounded-lg" />
280+
<div class="speech-left p-2 ml-4 rounded-lg relative">Q.E.D.</div>
281+
</div>
282+
<div class="flex items-center">
283+
<img src="/img/sinclair.png" class="w-28 h-28 block rounded-lg" />
284+
<div class="speech-left p-2 ml-4 rounded-lg relative">
285+
Quantitative Education Delivered.
260286
</div>
261287
</div>
262288
</div>
289+
<div>
290+
<UButton
291+
v-if="isMathematicalProofEnabled"
292+
class="font-bold my-2"
293+
icon="i-heroicons-eye-slash"
294+
color="red"
295+
variant="soft"
296+
@click="isMathematicalProofEnabled = false"
297+
>
298+
Hide Mathematical Proof
299+
</UButton>
300+
</div>
263301
</div>
264302
</div>
265303
</template>

0 commit comments

Comments
 (0)