Skip to content

Commit 1198854

Browse files
committed
Replace toPrecision by toFixed in clampedPRNG
1 parent 49e6bf0 commit 1198854

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</script>
4040
</head>
4141
<body>
42-
<div id="app" style="flex: 1; display: flex; flex-direction: column"></div>
42+
<div id="app"></div>
4343
<script type="module" src="/src/main.ts"></script>
4444
</body>
4545
</html>

src/assets/sass/_main.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ body {
4545

4646
display: flex;
4747
flex-direction: column;
48+
49+
#app {
50+
flex: 1;
51+
display: flex;
52+
flex-direction: column;
53+
}
4854
}
4955
body:has(dialog[open]) {
5056
touch-action: none;

src/core/utils/math-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export function regeneratePRNGIfNecessary(force?: boolean): void {
3030
PRNG_SEED.value = s;
3131
currentPRNGSeed = s;
3232
}
33-
export function clampedPRNG(min: number, max: number, precision: number = 3): number {
34-
return Number(((max - min) * PRNG.value() + min).toPrecision(precision));
33+
export function clampedPRNG(min: number, max: number, digits: number = 3): number {
34+
return Number(((max - min) * PRNG.value() + min).toFixed(digits));
3535
}
3636
export function clampedPRNGSpaced(prev: number, min: number, max: number, precision: number = 3, spacing: number = 1) {
3737
let result = clampedPRNG(min, max, precision);

src/views/PageNotFoundView.vue

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,34 @@
44
<div class="text">
55
<h1 class="title" :class="{ ultra: msgVariant === 4 }">{{ loadMessage() }}</h1>
66
<h2 class="subtitle">{{ $t('404.subtext') }}</h2>
7-
<LgvLink
8-
variant="button"
9-
icon="mingcute:book-2-line"
10-
href="/"
11-
>
7+
<LgvLink variant="button" icon="mingcute:book-2-line" href="/">
128
{{ $t('404.link') }}
139
</LgvLink>
1410
</div>
1511
</div>
1612
</template>
1713

1814
<script setup lang="ts">
19-
import LgvLink from '@/_lib/components/LgvLink.vue'
20-
import AppLogo from '@components/global/elements/AppLogo.vue'
21-
import { useHead } from '@unhead/vue'
22-
import { ref } from 'vue'
23-
import { useI18n } from 'vue-i18n'
15+
import LgvLink from '@/_lib/components/LgvLink.vue';
16+
import AppLogo from '@components/global/elements/AppLogo.vue';
17+
import { useHead } from '@unhead/vue';
18+
import { ref } from 'vue';
19+
import { useI18n } from 'vue-i18n';
2420
25-
const i18n = useI18n()
21+
const i18n = useI18n();
2622
useHead({
2723
title: i18n.t('404.$title') + ' · ' + i18n.t('main.$title'),
2824
meta: [
2925
{ name: 'robots', content: 'noindex' },
3026
{ name: 'description', content: 'Page not found' },
3127
],
32-
})
28+
});
3329
34-
const msgVariant = ref(0)
30+
const msgVariant = ref(0);
3531
function loadMessage(): string {
36-
msgVariant.value = Math.floor(Math.random() * 4) + 1
37-
return i18n.t(`404.text_${msgVariant.value.toString().padStart(2, '0')}`)
32+
msgVariant.value = Math.floor(Math.random() * 4) + 1;
33+
return i18n.t(`404.text_${msgVariant.value.toString().padStart(2, '0')}`);
3834
}
39-
4035
</script>
4136

4237
<style lang="scss">

0 commit comments

Comments
 (0)