daisy/site/index.html

153 lines
3.6 KiB
HTML
Raw Permalink Normal View History

2023-09-21 14:12:10 -07:00
<!DOCTYPE html>
2023-09-20 14:29:14 -07:00
<html>
<head>
2023-09-21 19:16:30 -07:00
<title>Daisy Web</title>
<link rel="icon" href="resources/daisy-icon-light.svg" sizes="any" type="image/svg+xml">
<link rel="preload" href="resources/Fantasque.ttf" as="font" type="font/ttf" crossorigin>
2023-09-20 14:29:14 -07:00
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
2023-09-21 12:06:13 -07:00
<link rel="stylesheet" href="node_modules/xterm/css/xterm.css" />
<script src="node_modules/xterm/lib/xterm.js"></script>
<style>
@font-face {
font-family: Fantasque;
2023-09-21 19:16:30 -07:00
src: url("resources/Fantasque.ttf") format("opentype");
2023-09-21 12:06:13 -07:00
}
html, body {
color: #FFFFFF;
background-color: #272A30;
font-size: 14pt;
font-family: Fantasque;
margin: 0;
padding: 0;
overflow: hidden;
height: 100vh;
}
body {
max-width: 1000px;
margin: 0 auto !important;
float: none !important;
}
a {
font-size: 12pt;
}
a:link, a:visited {
color: #00B6B6;
text-decoration: none;
}
a:hover, a:active {
color: #04F1F1;
text-decoration: underline;
}
#terminal {
width: 90%;
height: auto;
margin: 0 auto !important;
padding: 20px;
background: #1D1F21;
box-sizing: box;
border: 0mm;
2023-09-21 14:12:10 -07:00
box-shadow: 0px 0px 10px 4px #3c4044;
2023-09-21 12:06:13 -07:00
}
#header {
padding-top: 20px;
padding-bottom: 20px;
width: 90%;
margin: 0 auto !important;
}
#footer {
padding-top: 20px;
padding-bottom: 20px;
width: 90%;
margin: 0 auto !important;
text-align: center;
}
#banner {
width: 40%;
}
</style>
2023-09-20 14:29:14 -07:00
</head>
<body>
2023-09-21 12:06:13 -07:00
<div id="header">
2023-09-21 14:07:21 -07:00
<img id="banner" src = "resources/daisy-light.svg" alt="Daisy Banner"/>
2023-09-21 12:06:13 -07:00
<p>A high-precision, general-purpose scientific calculator</p>
</div>
<div id="terminal"></div>
<div id="footer">
<a href="https://github.com/rm-dr/daisy" target="_blank" rel="noopener noreferrer">Source Code</a> |
<a href="https://github.com/rm-dr/daisy#-usage" target="_blank" rel="noopener noreferrer">Documentation</a> |
<a href="https://github.com/rm-dr/daisy/blob/master/LICENSE" target="_blank" rel="noopener noreferrer">License</a>
<br>
<a href="https://crates.io/crates/daisycalc" target="_blank" rel="noopener noreferrer">crates.io</a> |
<a href="https://aur.archlinux.org/packages/daisy" target="_blank" rel="noopener noreferrer">AUR</a>
2023-09-20 14:29:14 -07:00
</div>
<script type="module">
// See wasm-pack docs
2023-09-21 19:21:07 -07:00
// Build with `wasm-pack build --release --target web --out-dir pkg`
2023-09-21 12:06:13 -07:00
import init, { daisy_init, daisy_free, daisy_char, daisy_prompt } from './pkg/daisycalc.js';
2023-09-20 14:29:14 -07:00
await init();
2023-09-21 12:06:13 -07:00
const term = new Terminal({
"fontFamily": "Fantasque",
"rows": 32,
"fontSize": 16,
"tabStopWidth": 8,
"cursorBlink": true,
"theme": {
"background": "#1D1F21",
"foreground": "#F8F8F8",
"cursor": "#F8F8F2",
"black": "#282828",
"blue": "#0087AF",
"brightBlack": "#555555",
"brightBlue": "#87DFFF",
"brightCyan": "#28D1E7",
"brightGreen": "#A8FF60",
"brightMagenta": "#985EFF",
"brightRed": "#FFAA00",
"brightWhite": "#D0D0D0",
"brightYellow": "#F1FF52",
"cyan": "#87DFEB",
"green": "#B4EC85",
"magenta": "#BD99FF",
"red": "#FF6600",
"white": "#F8F8F8",
"yellow": "#FFFFB6"
2023-09-20 14:29:14 -07:00
}
});
2023-09-21 12:06:13 -07:00
term.open(document.getElementById("terminal"));
const state = daisy_init();
term.write(daisy_char(state, "h"));
term.write(daisy_char(state, "e"));
term.write(daisy_char(state, "l"));
term.write(daisy_char(state, "p"));
term.write(daisy_char(state, "\r"));
term.focus();
term.onData( data => { term.write(daisy_char(state, data)); });
2023-09-20 14:29:14 -07:00
</script>
</body>
</html>