Commit 318a97c4 authored by Nathan Pasko's avatar Nathan Pasko
Browse files

clean up comments

parent c109ddd1
......@@ -249,7 +249,9 @@ function removeLayer(position) {
}
}
function removeSourceForId(id) {
// try to find audio source
var i = sources.findIndex((s) => s.id == id);
// remove source if found
if (i >= 0) {
sources.splice(i, 1);
}
......@@ -322,16 +324,20 @@ function moveLayer(val) {
}
}
function setControlOscillator(val) {
// Control Start
// control layer start
if (val) {
// set up control layer audio context & oscillator
const AudioContext = window.AudioContext || window.webkitAudioContext;
controlContext = new AudioContext();
controlOsc = controlContext.createOscillator();
// frequency of planet Neptune
controlOsc.frequency.setValueAtTime(211.44, controlContext.currentTime);
controlOsc.connect(controlContext.destination);
// dampen the tone with a little bit here using a gain node?
// start oscillator
controlOsc.start();
}
// Control Stop
// control layer stop
else {
controlContext.suspend();
controlOsc.stop();
......@@ -340,13 +346,15 @@ function setControlOscillator(val) {
}
}
function tapAudio(elem, stop = false, control = false) {
// try to find source with ID
// try to find audio source with ID
var i = sources.findIndex((s) => s.id == parseInt(elem.id));
// if we found the source
if (i >= 0) {
// stop audio
if (stop) {
sources[i].source.disconnect();
sources[i].audioContext.suspend();
// stop control layer tone
if (control == true) {
setControlOscillator(false);
}
......@@ -355,6 +363,7 @@ function tapAudio(elem, stop = false, control = false) {
else {
sources[i].source.connect(sources[i].audioContext.destination);
sources[i].audioContext.resume();
// start control layer tone
if (control == true) {
setControlOscillator(true);
}
......@@ -365,6 +374,7 @@ function tapAudio(elem, stop = false, control = false) {
// Utility
function iOS() {
// return true if client device is running iOS
return (
[
'iPad Simulator',
......@@ -374,7 +384,6 @@ function iOS() {
'iPhone',
'iPod',
].includes(navigator.platform) ||
// iPad on iOS 13 detection
(navigator.userAgent.includes('Mac') && 'ontouchend' in document)
);
}
......@@ -423,9 +432,12 @@ function setLayerPosition(element, val) {
// Update
function updateBackground() {
// If layer has background setting
if (cartridge.layers[currentLayer].background != undefined) {
// set frame background
frame.style.background = cartridge.layers[currentLayer].background;
} else {
// otherwise clear the frame background
frame.style.background = 'unset';
}
}
......
......@@ -166,9 +166,7 @@ nav a, nav span {
flex-direction: row;
align-items: flex-end;
height: calc(1.25rem + 3px);
/*padding: 5px 0 0 1.75rem;*/
padding-left: 1.65rem;
/*background: var(--white);*/
z-index: 75;
}
#title {
......@@ -304,16 +302,6 @@ nav a, nav span {
max-width: 30vh;
}
#startup-logo svg path {
/*font-size: 3rem;
font-weight: 800;
text-transform: uppercase;
background-color: linear-gradient(-60deg, blue, darkviolet, purple, darkviolet);
background-size: 300%;
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
transform: scaleY(.95);
transform-origin: bottom;*/
opacity: 0;
animation: simpleFade 1.2s ease-in-out 1;
}
......@@ -354,13 +342,8 @@ nav a, nav span {
@media (prefers-color-scheme: Dark) {
html {
/*background: var(--black);
color: var(--white);*/
filter: invert(1);
}
* {
/*filter: invert();*/
}
}
/* Hover */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment