Embed and use FiraGo

It doesn't seem to be working correctly on Android though. A quick
google implies that my Android might not support woff2 files, so maybe
I should try ttf or woff instead.

Edit: Apparently, it *does* just work on my phone now. No idea why it
didn't work before.
This commit is contained in:
Joscha 2025-01-27 14:12:04 +01:00
parent d1f0d28dac
commit 14e85207e9
19 changed files with 139 additions and 140 deletions

View file

@ -1,159 +1,158 @@
<script setup lang="ts">
import { ref } from "vue";
import { invoke } from "@tauri-apps/api/core";
const greetMsg = ref("");
const name = ref("");
async function greet() {
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
greetMsg.value = await invoke("greet", { name: name.value });
}
// const sample = "Apps is a gude";
</script>
<template>
<main class="container">
<p class="font-bold underline">Hello</p>
<h1>Welcome to Tauri + Vue</h1>
<div class="row">
<a href="https://vitejs.dev" target="_blank">
<img src="/vite.svg" class="logo vite" alt="Vite logo" />
</a>
<a href="https://tauri.app" target="_blank">
<img src="/tauri.svg" class="logo tauri" alt="Tauri logo" />
</a>
<a href="https://vuejs.org/" target="_blank">
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
</a>
<div class="flex items-baseline justify-between bg-black p-2 text-white">
<div
class="cursor-default rounded-md bg-neutral-800 pl-2 pr-1 text-lg hover:bg-neutral-700 active:bg-neutral-500"
>
GedächtNAS<span class="relative -top-1 select-none"> </span>
</div>
<p>Click on the Tauri, Vite, and Vue logos to learn more.</p>
<form class="row" @submit.prevent="greet">
<input id="greet-input" v-model="name" placeholder="Enter a name..." />
<button type="submit">Greet</button>
</form>
<p>{{ greetMsg }}</p>
</main>
<div
class="cursor-pointer select-none rounded-md bg-neutral-800 px-2 text-xl hover:bg-neutral-700 active:bg-neutral-500"
>
</div>
</div>
<p class="p-1 font-thin">The quick brown fox Qiii</p>
<p class="p-1 font-extralight">The quick brown fox Qiii</p>
<p class="p-1 font-light">The quick brown fox Qiii</p>
<p class="p-1 font-normal">The quick brown fox Qiii</p>
<p class="p-1 font-medium">The quick brown fox Qiii</p>
<p class="p-1 font-semibold">The quick brown fox Qiii</p>
<p class="p-1 font-bold">The quick brown fox Qiii</p>
<p class="p-1 font-extrabold">The quick brown fox Qiii</p>
<p class="p-1 font-black">The quick brown fox Qiii</p>
</template>
<style scoped>
.logo.vite:hover {
filter: drop-shadow(0 0 2em #747bff);
}
.logo.vue:hover {
filter: drop-shadow(0 0 2em #249b73);
}
</style>
<style>
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
@import "tailwindcss";
/*
Weights according to https://github.com/bBoxType/FiraGO?tab=readme-ov-file#firago-font-weights
100 - Thin
200 - UltraLight
300 - Light
400 - Regular
500 - Medium
600 - SemiBold
700 - Bold
800 - ExtraBold
900 - Heavy
*/
@font-face {
font-family: FiraGO;
font-style: normal;
font-weight: 100;
src: url("/fonts/FiraGO-Thin.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: normal;
font-weight: 200;
src: url("/fonts/FiraGO-UltraLight.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: normal;
font-weight: 300;
src: url("/fonts/FiraGO-Light.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: normal;
font-weight: 400;
color: #0f0f0f;
background-color: #f6f6f6;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
src: url("/fonts/FiraGO-Regular.woff2") format("woff2");
}
.container {
margin: 0;
padding-top: 10vh;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: 0.75s;
}
.logo.tauri:hover {
filter: drop-shadow(0 0 2em #24c8db);
}
.row {
display: flex;
justify-content: center;
}
a {
@font-face {
font-family: FiraGO;
font-style: normal;
font-weight: 500;
color: #646cff;
text-decoration: inherit;
src: url("/fonts/FiraGO-Medium.woff2") format("woff2");
}
a:hover {
color: #535bf2;
@font-face {
font-family: FiraGO;
font-style: normal;
font-weight: 600;
src: url("/fonts/FiraGO-SemiBold.woff2") format("woff2");
}
h1 {
text-align: center;
@font-face {
font-family: FiraGO;
font-style: normal;
font-weight: 700;
src: url("/fonts/FiraGO-Bold.woff2") format("woff2");
}
input,
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
@font-face {
font-family: FiraGO;
font-style: normal;
font-weight: 800;
src: url("/fonts/FiraGO-ExtraBold.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: normal;
font-weight: 900;
src: url("/fonts/FiraGO-Heavy.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: italic;
font-weight: 100;
src: url("/fonts/FiraGO-ThinItalic.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: italic;
font-weight: 200;
src: url("/fonts/FiraGO-UltraLightItalic.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: italic;
font-weight: 300;
src: url("/fonts/FiraGO-LightItalic.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: italic;
font-weight: 400;
src: url("/fonts/FiraGO-Italic.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: italic;
font-weight: 500;
font-family: inherit;
color: #0f0f0f;
background-color: #ffffff;
transition: border-color 0.25s;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
src: url("/fonts/FiraGO-MediumItalic.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: italic;
font-weight: 600;
src: url("/fonts/FiraGO-SemiBoldItalic.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: italic;
font-weight: 700;
src: url("/fonts/FiraGO-BoldItalic.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: italic;
font-weight: 800;
src: url("/fonts/FiraGO-ExtraBoldItalic.woff2") format("woff2");
}
@font-face {
font-family: FiraGO;
font-style: italic;
font-weight: 900;
src: url("/fonts/FiraGO-HeavyItalic.woff2") format("woff2");
}
button {
cursor: pointer;
}
button:hover {
border-color: #396cd8;
}
button:active {
border-color: #396cd8;
background-color: #e8e8e8;
}
input,
button {
outline: none;
}
#greet-input {
margin-right: 5px;
}
@media (prefers-color-scheme: dark) {
:root {
color: #f6f6f6;
background-color: #2f2f2f;
}
a:hover {
color: #24c8db;
}
input,
button {
color: #ffffff;
background-color: #0f0f0f98;
}
button:active {
background-color: #0f0f0f69;
}
@theme {
--font-sans: FiraGO;
}
</style>