-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add example/documentation website
- Loading branch information
Showing
35 changed files
with
1,460 additions
and
0 deletions.
There are no files selected for viewing
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.