This commit is contained in:
Ian Remsen 2023-03-04 23:28:06 -05:00
parent 6f65168fb8
commit 0c42541b31
3 changed files with 418 additions and 0 deletions

7
inc/große_fuge.json Normal file
View File

@ -0,0 +1,7 @@
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.18.0</center>
</body>
</html>

95
index.html Normal file
View File

@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>GROẞE FUGE</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="ir">
<meta name="description" content="i.a.r.">
<script src="//unpkg.com/tone"></script>
<script>
function playNote() {
// create a synth
const synth = new Tone.Synth().toDestination();
// play a note from that synth
synth.triggerAttackRelease("C4", "8n");
}
</script>
<link rel="stylesheet" href="style/style.css">
<link rel="stylesheet" href="https://envs.net/css/fork-awesome.min.css">
</head>
<body id="body" class="dark-mode">
<main>
<section style="clear: both; text-align: center;" class="center">
<p>×××××</p>
<h1>GROẞE FUGE</h1>
<button>invocation</button>
<p>×××××</p>
</section>
<address>
<a href="mailto:ir@envs.net">📧 malmö me 🐐</a>
</address>
</main>
<section id="sidebar">
<pre class="sidebar">
more text
</pre>
</section>
<script>
currentMidi = "";
async function populate() {
const requestURL = 'inc/große_fuge.json';
const request = new Request(requestURL);
const response = await fetch(request);
currentMidi = await response.json();
}
populate();
const synths = [];
document
.querySelector("button")
.addEventListener("click", (e) => {
const playing = e.detail;
if (playing && currentMidi) {
const now = Tone.now() + 0.5;
currentMidi.tracks.forEach((track) => {
const sin2 = new Tone.OmniOscillator(432, "sine1");
//create a synth for each track
const synth = new Tone.PolySynth(Tone.Synth, {
oscillator: this.sin2,
envelope: {
attack: 0.02,
decay: 0.1,
sustain: 0.3,
release: 1,
},
}).toDestination();
synths.push(synth);
//schedule all of the events
track.notes.forEach((note) => {
synth.triggerAttackRelease(
note.name,
note.duration,
note.time + now,
note.velocity
);
});
});
} else {
//dispose the synth and make a new one
while (synths.length) {
const synth = synths.shift();
synth.disconnect();
}
}
});
</script>
</body>
</html>

316
style/style.css Normal file
View File

@ -0,0 +1,316 @@
@import url(https://envs.net/fonts/jetbrains-mono/font.css);
* {
font-family: 'JetBrains Mono','monospace'
}
body,input,select,textarea {
color: #353;
font-size: 16pt;
line-height: 1.65em;
letter-spacing: -.015em
}
body {
background: #f5f5f5
}
footer {
position: fixed;
text-align: center;
bottom: 0;
width: 100%;
padding: 1em;
background: #f5f5f5
}
main {
float: left;
margin: 0 0 2em 4em;
padding-bottom: 4em
}
#header_sub {
margin-left: 6em
}
#sidebar {
background: #2f4f4f;
color: #708090;
float: right;
padding: 0 2.5em 2.5em 0
}
#left_box {
float: left;
padding-right: 1em
}
a {
outline: 0;
border-bottom-color: transparent;
text-decoration: none;
color: teal
}
a:hover {
border-bottom: 1px dotted
}
summary.menu {
outline: 0
}
summary.menu:hover {
cursor: pointer;
color: teal
}
blockquote {
border-left: 4px solid silver;
font-style: italic;
margin: 0;
padding: 0 0 1.5em 4em
}
code {
font-family: monospace;
background: silver;
color: #353
}
pre {
margin-bottom: 0;
padding: 0
}
pre.clean {
margin: 0;
padding: 0
}
pre.banner {
line-height: 1.2em;
margin-bottom: 1em;
padding: 0
}
h1,h2,h3,h4,h5,h6 {
display: block;
line-height: 0;
margin: 0;
padding: .6em 0
}
hr.half {
width: 50%;
text-align: left;
margin-left: 0
}
li {
margin: 0;
padding: 0
}
ol,ul {
margin: 0;
padding: 0 0 0 2em
}
.ol.userlist,ul.userlist {
list-style-type: none;
margin: 0;
padding: 0 0 0 1.2em
}
table {
border-collapse: collapse;
width: 100%
}
td,th,tr {
text-align: left;
padding: 0
}
.table_pkg tbody tr:nth-child(2n) {
background: silver
}
.tw20 {
width: 20px
}
.tw25 {
width: 25px
}
.tw80 {
width: 80px
}
.tw100 {
width: 100px
}
.tw110 {
width: 110px
}
.tw130 {
width: 130px
}
.tw140 {
width: 140px
}
.tw160 {
width: 160px
}
.tw280 {
width: 280px
}
.clean,form,input {
margin: 0;
padding: 0
}
textarea {
padding: .3em 1em;
margin: 0 0 -.5em;
border: 1px solid #353;
border-radius: 10px
}
input[type=button],input[type=submit],input[type=text] {
font-size: 120%;
background-color: silver;
color: #353;
border-radius: 10px;
border: 1px solid #353;
text-decoration: none;
padding: .3em 1em
}
input[type=button]:hover,input[type=submit]:hover {
font-size: 120%;
background-color: #211921;
color: #ddd
}
input[type=file] {
font-size: 120%;
color: #353;
background-color: #f5f5f5;
padding: .3em 1em .3em 0
}
button {
font-size: 120%;
border-radius: 10px;
border: none;
text-decoration: none;
background-color: silver;
color: #353
}
button:hover {
background-color: #211921;
color: #fff5ee
}
.clear {
clear: both
}
.mark {
color: teal
}
.alert {
color: #353;
background: silver;
margin: 0 0 1.5em;
padding: .5em 1em 1.5em
}
.block {
border-left: 4px solid silver;
margin: .8em 0 1em;
padding: .8em 0 .8em 4em
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%)
}
.button_back {
float: left;
margin-top: 1em;
margin-left: .4em;
position: fixed;
top: 0;
left: 0
}
body.light-mode {
background: #f5f5f5;
color: #353
}
body.light-mode footer {
border-top: 2px solid silver;
background: #f5f5f5
}
body.light-mode blockquote {
border-left: 4px solid silver
}
body.light-mode code {
color: #353;
background: silver
}
body.light-mode .table_pkg tbody tr:nth-child(2n) {
background: silver
}
body.light-mode input[type=button],body.light-mode input[type=submit],body.light-mode input[type=text] {
background-color: silver;
color: #353;
border: 1px solid #353
}
body.light-mode input[type=button]:hover,body.light-mode input[type=submit]:hover {
background-color: #211921;
color: #fff5ee
}
body.light-mode input[type=file] {
color: #353;
background-color: #f5f5f5
}
body.light-mode textarea {
background: silver;
color: #353;
border: 1px solid #353
}
body.light-mode button {
background-color: silver;
color: #353
}
body.light-mode button:hover {
background-color: #211921;
color: #fff5ee
}
body.light-mode .alert {
color: #353;
background: silver
}
body.light-mode .block,body.light-mode .block_head {
border-left: 4px solid silver
}
body.dark-mode {
color: #fff5ee;
background: #040304
}
body.dark-mode footer {
border-top: 2px solid #211921;
background: #040304
}
body.dark-mode blockquote {
border-left: 4px solid #211921
}
body.dark-mode code {
color: #ddd;
background: #211921
}
body.dark-mode .table_pkg tbody tr:nth-child(2n) {
background: #211921
}
body.dark-mode input[type=button],body.dark-mode input[type=submit],body.dark-mode input[type=text] {
background-color: #211921;
color: #ddd;
border: 1px solid #ddd
}
body.dark-mode input[type=button]:hover,body.dark-mode input[type=submit]:hover {
background-color: silver;
color: #353
}
body.dark-mode input[type=file] {
color: #ddd;
background-color: #040304
}
body.dark-mode textarea {
color: #ddd;
background: #211921;
border: 1px solid #ddd
}
body.dark-mode button {
background-color: #211921;
color: #ddd
}
body.dark-mode button:hover {
background-color: silver;
color: #353
}
body.dark-mode .alert {
color: #ddd;
background: #211921
}
body.dark-mode .block,body.dark-mode .block_head {
border-left: 4px solid #211921
}