Skip to content

Commit d86d94e

Browse files
committed
Gain slidey
1 parent f9e6cd8 commit d86d94e

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

homepage/style.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,16 +551,19 @@ button:hover {
551551
width:25px !important;
552552
height:25px !important;
553553
}
554+
554555
.relative {
555556
position:relative;
556557
}
558+
557559
.sortbutton {
558560
margin-top:10px;
559561
font-size:x-large;
560562
background:#dbffeb;
561563
padding:5px;
562564
box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.10);
563565
}
566+
564567
button.legacyview {
565568
color:gray;
566569
margin:5px;
@@ -573,6 +576,7 @@ button.legacyview {
573576
transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
574577
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%);
575578
}
579+
576580
button.legacyview:hover {
577581
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%);
578582
}
@@ -586,42 +590,52 @@ button.loadmore {
586590
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%);
587591

588592
}
593+
589594
button.loadmore:hover {
590595
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%);
591596
}
597+
592598
#searchterm {
593599
transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
594600
}
601+
595602
#searchterm:hover {
596603
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%);
597604
}
598605

599606
tr {
600607
background-color:#9fe29b;
601608
}
609+
602610
.history.centered form {
603611
display:flex;
604612
justify-content: center;
605613
}
614+
606615
.history.centered input {
607616
margin-right:5px;
608617
border:0px;
609618
}
619+
610620
.centered form#views button {
611621
box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.10);
612622
margin:2px;
613623
transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
614624
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%);
615625
}
626+
616627
.centered form#views button:hover {
617628
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%);
618629
}
630+
619631
input {
620632
box-shadow: 0px 0px 17px 1px rgba(0, 0, 0, 0.10);
621633
}
634+
622635
dialog {
623636
border:none;
624637
}
638+
625639
dialog::backdrop {
626640
background: repeating-linear-gradient(
627641
30deg,
@@ -632,12 +646,14 @@ dialog::backdrop {
632646
);
633647
backdrop-filter: blur(1px)
634648
}
649+
635650
.centered_image_container {
636651
font-size:19px !important;
637652
display:inline-block;
638653
position:relative;
639654
margin-bottom:3px;
640655
}
656+
641657
.centered_image_container img.img1 {
642658
transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
643659
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 {
649665
border-radius: 5px;
650666
width:unset;
651667
}
668+
652669
.centered_image_container img.img1:hover{
653670
opacity:0.8;
654671
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%);
655672
}
673+
656674
.centered_image_container * {
657675
font-size:19px !important;
658676
}
677+
659678
.centered_image_container form {
660679
margin-bottom:0px;
661680
}
681+
662682
.brbanner {
663683
padding:15px;
664684
background-color:rgb(159, 226, 155);
665685
text-align:center;
666686
font-size:large;
687+
}
688+
689+
#gain.centered {
690+
margin-bottom:10px;
667691
}

scripts/spectrogram.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// before a user gesture. This fixes it.
66
var started = null;
77
var player = null;
8+
var gain = 128;
89
const ctx = null;
910
window.onload = function(){
1011
// if user agent includes iPhone or Mac use legacy mode
@@ -129,7 +130,7 @@ function loop() {
129130
CTX.putImageData(imgData, 0, 0);
130131
ANALYSER.getByteFrequencyData(DATA);
131132
for (let i = 0; i < LEN; i++) {
132-
let rat = DATA[i] / 128 ;
133+
let rat = DATA[i] / gain ;
133134
let hue = Math.round((rat * 120) + 280 % 360);
134135
let sat = '100%';
135136
let lit = 10 + (70 * rat) + '%';
@@ -166,6 +167,26 @@ function loop() {
166167

167168
<img id="spectrogramimage" style="width:100%;height:100%;display:none" src="/spectrogram.png?nocache=<?php echo $time;?>">
168169

170+
<div id="gain" class="centered">
171+
<label>Gain: </label>
172+
<span class="slidecontainer">
173+
<input name="gain_input" type="range" min="0" max="255" value="128" class="slider" id="gain_input">
174+
<span id="gain_value"></span>%
175+
</span>
176+
</div>
177+
169178
<audio style="display:none" controls="" crossorigin="anonymous" id='player' preload="none"><source src="/stream"></audio>
170179
<h1>Loading...</h1>
171180
<canvas></canvas>
181+
182+
<script>
183+
var slider = document.getElementById("gain_input");
184+
var output = document.getElementById("gain_value");
185+
output.innerHTML = slider.value; // Display the default slider value
186+
187+
// Update the current slider value (each time you drag the slider handle)
188+
slider.oninput = function() {
189+
output.innerHTML = this.value;
190+
gain=Math.abs(this.value - 255);
191+
}
192+
</script>

0 commit comments

Comments
 (0)