Gain slidey

This commit is contained in:
ehpersonal38
2022-05-24 14:53:50 -04:00
parent f9e6cd8ed0
commit d86d94e64e
2 changed files with 46 additions and 1 deletions
+24
View File
@@ -551,9 +551,11 @@ button:hover {
width:25px !important; width:25px !important;
height:25px !important; height:25px !important;
} }
.relative { .relative {
position:relative; position:relative;
} }
.sortbutton { .sortbutton {
margin-top:10px; margin-top:10px;
font-size:x-large; font-size:x-large;
@@ -561,6 +563,7 @@ button:hover {
padding:5px; padding:5px;
box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.10); box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.10);
} }
button.legacyview { button.legacyview {
color:gray; color:gray;
margin:5px; margin:5px;
@@ -573,6 +576,7 @@ button.legacyview {
transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1); transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%); box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%);
} }
button.legacyview:hover { button.legacyview:hover {
box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%); box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);
} }
@@ -586,12 +590,15 @@ button.loadmore {
box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%); box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%);
} }
button.loadmore:hover { button.loadmore:hover {
box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%); box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);
} }
#searchterm { #searchterm {
transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1); transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
} }
#searchterm:hover { #searchterm:hover {
box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%); box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);
} }
@@ -599,29 +606,36 @@ button.loadmore:hover {
tr { tr {
background-color:#9fe29b; background-color:#9fe29b;
} }
.history.centered form { .history.centered form {
display:flex; display:flex;
justify-content: center; justify-content: center;
} }
.history.centered input { .history.centered input {
margin-right:5px; margin-right:5px;
border:0px; border:0px;
} }
.centered form#views button { .centered form#views button {
box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.10); box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.10);
margin:2px; margin:2px;
transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1); transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%); box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%);
} }
.centered form#views button:hover { .centered form#views button:hover {
box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%); box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);
} }
input { input {
box-shadow: 0px 0px 17px 1px rgba(0, 0, 0, 0.10); box-shadow: 0px 0px 17px 1px rgba(0, 0, 0, 0.10);
} }
dialog { dialog {
border:none; border:none;
} }
dialog::backdrop { dialog::backdrop {
background: repeating-linear-gradient( background: repeating-linear-gradient(
30deg, 30deg,
@@ -632,12 +646,14 @@ dialog::backdrop {
); );
backdrop-filter: blur(1px) backdrop-filter: blur(1px)
} }
.centered_image_container { .centered_image_container {
font-size:19px !important; font-size:19px !important;
display:inline-block; display:inline-block;
position:relative; position:relative;
margin-bottom:3px; margin-bottom:3px;
} }
.centered_image_container img.img1 { .centered_image_container img.img1 {
transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1); transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%); box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%);
@@ -649,19 +665,27 @@ dialog::backdrop {
border-radius: 5px; border-radius: 5px;
width:unset; width:unset;
} }
.centered_image_container img.img1:hover{ .centered_image_container img.img1:hover{
opacity:0.8; opacity:0.8;
box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%); box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);
} }
.centered_image_container * { .centered_image_container * {
font-size:19px !important; font-size:19px !important;
} }
.centered_image_container form { .centered_image_container form {
margin-bottom:0px; margin-bottom:0px;
} }
.brbanner { .brbanner {
padding:15px; padding:15px;
background-color:rgb(159, 226, 155); background-color:rgb(159, 226, 155);
text-align:center; text-align:center;
font-size:large; font-size:large;
}
#gain.centered {
margin-bottom:10px;
} }
+22 -1
View File
@@ -5,6 +5,7 @@
// before a user gesture. This fixes it. // before a user gesture. This fixes it.
var started = null; var started = null;
var player = null; var player = null;
var gain = 128;
const ctx = null; const ctx = null;
window.onload = function(){ window.onload = function(){
// if user agent includes iPhone or Mac use legacy mode // if user agent includes iPhone or Mac use legacy mode
@@ -129,7 +130,7 @@ function initialize() {
CTX.putImageData(imgData, 0, 0); CTX.putImageData(imgData, 0, 0);
ANALYSER.getByteFrequencyData(DATA); ANALYSER.getByteFrequencyData(DATA);
for (let i = 0; i < LEN; i++) { for (let i = 0; i < LEN; i++) {
let rat = DATA[i] / 128 ; let rat = DATA[i] / gain ;
let hue = Math.round((rat * 120) + 280 % 360); let hue = Math.round((rat * 120) + 280 % 360);
let sat = '100%'; let sat = '100%';
let lit = 10 + (70 * rat) + '%'; let lit = 10 + (70 * rat) + '%';
@@ -166,6 +167,26 @@ h1 {
<img id="spectrogramimage" style="width:100%;height:100%;display:none" src="/spectrogram.png?nocache=<?php echo $time;?>"> <img id="spectrogramimage" style="width:100%;height:100%;display:none" src="/spectrogram.png?nocache=<?php echo $time;?>">
<div id="gain" class="centered">
<label>Gain: </label>
<span class="slidecontainer">
<input name="gain_input" type="range" min="0" max="255" value="128" class="slider" id="gain_input">
<span id="gain_value"></span>%
</span>
</div>
<audio style="display:none" controls="" crossorigin="anonymous" id='player' preload="none"><source src="/stream"></audio> <audio style="display:none" controls="" crossorigin="anonymous" id='player' preload="none"><source src="/stream"></audio>
<h1>Loading...</h1> <h1>Loading...</h1>
<canvas></canvas> <canvas></canvas>
<script>
var slider = document.getElementById("gain_input");
var output = document.getElementById("gain_value");
output.innerHTML = slider.value; // Display the default slider value
// Update the current slider value (each time you drag the slider handle)
slider.oninput = function() {
output.innerHTML = this.value;
gain=Math.abs(this.value - 255);
}
</script>