Skip to content

Commit

Permalink
Replace google cdn with local for fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjacob committed May 23, 2024
1 parent aaab524 commit b1c1166
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
18 changes: 18 additions & 0 deletions assets/css/theme.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
@font-face {
font-family: 'Major Mono Display';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("/fonts/MajorMonoDisplay.woff2") format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 100 700;
font-display: swap;
src: url("/fonts/RobotoMono.woff2") format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
color-scheme: light dark;
--display-font: 'Major Mono Display', monospace;
Expand Down
10 changes: 3 additions & 7 deletions middleware/k.global.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
export default defineNuxtRouteMiddleware((to, from) => {
if (to != undefined && to.path != undefined) {
if (to.path.startsWith('/k')) {
const valid = [
'/k0', '/k1', '/k2', '/k3', '/k4',
];

if (!valid.includes(to.path)) {
return navigateTo('/');
if (to.path.startsWith('/k') && to.path.length > 2) {
if (!(['1', '2', '3', '4'].includes(to.path[1]))) {
return navigateTo('/');
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: ['@vite-pwa/nuxt', "@nuxt/fonts"],
modules: ['@vite-pwa/nuxt'],
css: [
'~/assets/css/theme.css'
],
Expand Down Expand Up @@ -35,4 +35,4 @@ export default defineNuxtConfig({
},
devtools: { enabled: true },
modules: ["@vite-pwa/nuxt"]
})
})
2 changes: 1 addition & 1 deletion pages/[id].vue → pages/k[id].vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
const route = useRoute();
const page = route.params.id[1];
const page = route.params.id[0];
const input = tools.s(k[page]);
const cipher = ref(input);
Expand Down
Binary file added public/fonts/MajorMonoDisplay.woff2
Binary file not shown.
Binary file added public/fonts/RobotoMono.woff2
Binary file not shown.

0 comments on commit b1c1166

Please sign in to comment.