Skip to content

Commit

Permalink
prepare for v1.4.3 [ci-build]
Browse files Browse the repository at this point in the history
  • Loading branch information
prixt committed Feb 15, 2020
2 parents 1b85f63 + 609c136 commit 4d98889
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "soundsense-rs"
version = "1.4.2"
version = "1.4.3"
build = "build.rs"
authors = ["prixt <paraxite@naver.com>"]
edition = "2018"
description = "A Rusty SoundSense alternative"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 3 additions & 3 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
<a ref ='#' class='w3-button'>Options</a>
<div class='w3-dropdown-content w3-bar-block' style='right:0'>
<button class='w3-bar-item w3-button'
onclick="external.invoke('link_original')">Link: zwei's original SoundSense & soundpack</button>
onclick="external.invoke('link_original')">🔗 zwei's original SoundSense & soundpack</button>
<button class='w3-bar-item w3-button'
onclick="external.invoke('link_fork')">Link: jecowa's soundpack fork</button>
onclick="external.invoke('link_fork')">🔗 jecowa's soundpack fork</button>
<button class='w3-bar-item w3-button'
onclick="external.invoke('show_about')">About</button>
onclick="external.invoke('show_about')">ℹ️ About</button>
</div>
</div>
</div>
Expand Down
31 changes: 14 additions & 17 deletions web/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ function createSlider(channel_name) {
}
function setSliderValue(channel_name, value) {
let slider = document.getElementById(channel_name+"_slider");
if (slider != null) {
slider.value = value;
}
if (slider != null) slider.value = value;
}
function clearSliders() {
while (channels.firstChild) {
while (channels.firstChild)
channels.removeChild(channels.firstChild);
}
}

let alerts_footer = null;
Expand All @@ -52,9 +49,8 @@ function addAlert(name, color, text) {
let new_alert = createAlert(name, color, text);
alerts[name] = new_alert;
alerts_footer.insertAdjacentElement('afterbegin', new_alert);
if (alerts_footer.childElementCount > 4) {
if (alerts_footer.childElementCount > 4)
removeAlert(alerts_footer.lastChild.name);
}
}
function removeAlert(name) {
let alert = document.getElementById("alert_"+name);
Expand Down Expand Up @@ -86,19 +82,20 @@ function main() {
alerts_footer = document.getElementById('alerts');
alerts = new Map();

let prev = Date.now();
let prev = null;
function step(now) {
let dt = (now - prev) * 0.001;
prev = now;
let dt = 0.0;
if (prev != null) dt = (now - prev) * 0.001;
prev = now;

for (let key in alerts) {
let alert = alerts[key];
alert.timer -= dt;
if (alert.timer <= 1) {alert.style.opacity = alert.timer;}
if (alert.timer <= 0) {removeAlert(alert.name);}
}
for (let key in alerts) {
let alert = alerts[key];
alert.timer -= dt;
if (alert.timer <= 1.0) alert.style.opacity = alert.timer;
if (alert.timer <= 0.0) removeAlert(alert.name);
}

window.requestAnimationFrame(step);
window.requestAnimationFrame(step);
}

window.requestAnimationFrame(step);
Expand Down

0 comments on commit 4d98889

Please sign in to comment.