Skip to content

Commit

Permalink
feat: add example/documentation website
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcur committed May 3, 2024
1 parent c2faab5 commit 47aa7b4
Show file tree
Hide file tree
Showing 35 changed files with 1,460 additions and 0 deletions.
15 changes: 15 additions & 0 deletions example/sprokkel.uint.one/assets/emoji_u1f54a.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
38 changes: 38 additions & 0 deletions example/sprokkel.uint.one/assets/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(() => {
// <stdin>
var ColorScheme = {
Light: "light",
Dark: "dark"
};
function defaultColorScheme() {
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
return ColorScheme.Dark;
} else {
return ColorScheme.Light;
}
}
function hydrateColorScheme() {
let cs = localStorage.getItem("color-scheme");
if (cs === null) {
cs = defaultColorScheme();
}
if (cs === ColorScheme.Dark) {
document.documentElement.classList.add("dark");
}
}
function listenColorSchemeToggle() {
document.querySelector("#color-scheme-toggle").onclick = () => {
document.documentElement.classList.toggle("dark");
if (document.documentElement.classList.contains("dark")) {
localStorage.setItem("color-scheme", "dark");
} else {
localStorage.setItem("color-scheme", "light");
}
};
}
function main() {
hydrateColorScheme();
window.addEventListener("load", () => listenColorSchemeToggle());
}
main();
})();
34 changes: 34 additions & 0 deletions example/sprokkel.uint.one/cat/css/style.css/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@font-face {
font-family: "Source Sans 3";
src: url("/fonts/SourceSans3-600-Regular.woff2") format("woff2");
font-weight: 600;
font-style: normal;
}

@font-face {
font-family: "DejaVu Serif";
src: url("/fonts/DejaVuSerif.woff2") format("woff2");
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: "DejaVu Serif";
src: url("/fonts/DejaVuSerif-Italic.woff2") format("woff2");
font-weight: 400;
font-style: italic;
}

@font-face {
font-family: "DejaVu Serif";
src: url("/fonts/DejaVuSerif-Bold.woff2") format("woff2");
font-weight: 600;
font-style: italic;
}

@font-face {
font-family: "DejaVu Sans";
src: url("/fonts/DejaVuSans-Bold.woff2") format("woff2");
font-weight: 600;
font-style: normal;
}
23 changes: 23 additions & 0 deletions example/sprokkel.uint.one/cat/css/style.css/highlight.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pre {
background-color: var(--bgHighlight);
padding: 1em;
overflow: auto;
}

pre code {
.keyword, .string.special {
font-weight: bold;
}

.comment, .string {
color: var(--textHighlight);
}

.comment {
font-style: italic;
}

.type {
color: var(--textHighlight); font-weight: bold;
}
}
Loading

0 comments on commit 47aa7b4

Please sign in to comment.