Skip to content

Commit

Permalink
Add pixelated Button component
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfs committed Aug 22, 2024
1 parent 1954e5f commit 9c53cd8
Show file tree
Hide file tree
Showing 4 changed files with 409 additions and 61 deletions.
72 changes: 60 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,64 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Radicle</title>
<link
rel="preload"
href="/fonts/Inter-Regular.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
<link
rel="preload"
href="/fonts/Inter-Medium.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
<link
rel="preload"
href="/fonts/Inter-SemiBold.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
<link
rel="preload"
href="/fonts/Inter-Bold.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
<link
rel="preload"
href="/fonts/JetBrainsMono-Regular.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
<link
rel="preload"
href="/fonts/JetBrainsMono-Medium.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
<link
rel="preload"
href="/fonts/JetBrainsMono-SemiBold.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
<link
rel="preload"
href="/fonts/JetBrainsMono-Bold.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Radicle</title>
</head>
<link rel="stylesheet" type="text/css" href="/typography.css" />
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
144 changes: 144 additions & 0 deletions public/typography.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
@font-face {
font-family: "Inter";
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("fonts/Inter-Regular.woff2");
}

@font-face {
font-family: "Inter";
font-weight: 500;
font-display: swap;
src: url("fonts/Inter-Medium.woff2");
}

@font-face {
font-family: "Inter";
font-weight: 600;
font-display: swap;
src: url("fonts/Inter-SemiBold.woff2");
}

@font-face {
font-family: "Inter";
font-weight: 700;
font-display: swap;
src: url("fonts/Inter-Bold.woff2");
}

@font-face {
font-family: "JetBrains Mono";
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("fonts/JetBrainsMono-Regular.woff2");
}

@font-face {
font-family: "JetBrains Mono";
font-style: normal;
font-weight: 500;
font-display: swap;
src: url("fonts/JetBrainsMono-Medium.woff2");
}

@font-face {
font-family: "JetBrains Mono";
font-weight: 600;
font-display: swap;
src: url("fonts/JetBrainsMono-SemiBold.woff2");
}

@font-face {
font-family: "JetBrains Mono";
font-weight: 700;
font-display: swap;
src: url("fonts/JetBrainsMono-Bold.woff2");
}

:root {
--font-family-sans-serif: Inter, sans-serif;
--font-family-monospace: monospace;
--font-weight-regular: 400;
--font-weight-medium: 500;
--font-weight-semibold: 600;
--font-weight-bold: 700;
--font-size-tiny: 0.75rem; /* 12px */
--font-size-small: 0.875rem; /* 14px */
--font-size-regular: 1rem; /* 16px */
--font-size-medium: 1.25rem; /* 20px */
--font-size-large: 1.5rem; /* 24px */
--font-size-x-large: 2rem; /* 32px */
--font-size-xx-large: 3rem; /* 48px */
}

[data-codefont="system"] {
--font-family-monospace: monospace;
}

[data-codefont="jetbrains"] {
--font-family-monospace: "JetBrains Mono";
}

html {
-ms-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
font-family: var(--font-family-sans-serif);
font-feature-settings: "zero";
/* The root element font size has to be set in px,
* otherwise Safari breaks. */
font-size: 16px;
font-weight: var(--font-weight-regular);
line-height: 1.5;
}

p {
margin: 1rem 0;
}
.txt-tiny {
font-size: var(--font-size-tiny);
}
.txt-small {
font-size: var(--font-size-small);
}
.txt-regular {
font-size: var(--font-size-regular);
}
.txt-medium {
font-size: var(--font-size-medium);
}
.txt-large {
font-size: var(--font-size-large);
}
.txt-huge {
font-size: var(--font-size-x-large);
}
.txt-humongous {
font-size: var(--font-size-xx-large);
}

.txt-monospace {
font-family: var(--font-family-monospace);
}
.txt-bold {
font-weight: var(--font-weight-bold) !important;
}
.txt-semibold {
font-weight: var(--font-weight-semibold) !important;
}
.txt-missing {
color: var(--color-foreground-dim);
}
.txt-emoji {
height: 1em;
width: 1em;
margin: 0 0.05em 0 0.1em;
vertical-align: -0.1em;
}
.txt-overflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
51 changes: 2 additions & 49 deletions src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,54 +1,7 @@
<script lang="ts">
import { invoke } from "@tauri-apps/api/core";
import svelteLogo from "./assets/svelte.svg";
import viteLogo from "/vite.svg";
import Button from "./Button.svelte";
</script>

<style>
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.svelte:hover {
filter: drop-shadow(0 0 2em #ff3e00aa);
}
.read-the-docs {
color: #888;
}
</style>

<main>
<div>
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
<img src={viteLogo} class="logo" alt="Vite Logo" />
</a>
<a href="https://svelte.dev" target="_blank" rel="noreferrer">
<img src={svelteLogo} class="logo svelte" alt="Svelte Logo" />
</a>
</div>
<h1>Vite + Svelte</h1>

{#await invoke("greet", { name: "radicle" }) then result}
<span>
Greetings from the Tauri core: {result}
</span>
{/await}

<p>
Check out <a
href="https://github.com/sveltejs/kit#readme"
target="_blank"
rel="noreferrer">
SvelteKit
</a>
, the official Svelte app framework powered by Vite!
</p>

<p class="read-the-docs">Click on the Vite and Svelte logos to learn more</p>
<Button>Press me</Button>
</main>
Loading

0 comments on commit 9c53cd8

Please sign in to comment.