Speech as a package #416
2 changed files with 0 additions and 57 deletions
|
@ -1,4 +0,0 @@
|
||||||
<div id="new-release-banner" class="row row--short row--wide">
|
|
||||||
<p style="font-size: medium"> Hi there! Spee.ch is currently undergoing maintenance, and as a result publishing may be disabled. Please visit our <a style="
|
|
||||||
color:white; text-decoration: underline" target="_blank" href="https://discord.gg/YjYbwhS">discord channel</a> for updates.</p>
|
|
||||||
</div>
|
|
|
@ -1,53 +0,0 @@
|
||||||
<p id="bar-holder"></p>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
const ProgressBar = function() {
|
|
||||||
this.data = {
|
|
||||||
x: 0,
|
|
||||||
adder: 1,
|
|
||||||
bars: [],
|
|
||||||
};
|
|
||||||
this.barHolder = document.getElementById('bar-holder');
|
|
||||||
this.createProgressBar = function (size) {
|
|
||||||
this.data['size'] = size;
|
|
||||||
for (var i = 0; i < size; i++) {
|
|
||||||
const bar = document.createElement('span');
|
|
||||||
bar.innerText = '| ';
|
|
||||||
bar.setAttribute('class', 'progress-bar progress-bar--inactive');
|
|
||||||
this.barHolder.appendChild(bar);
|
|
||||||
this.data.bars.push(bar);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
this.startProgressBar = function () {
|
|
||||||
this.updateInterval = setInterval(this.updateProgressBar.bind(this), 300);
|
|
||||||
};
|
|
||||||
this.updateProgressBar = function () {
|
|
||||||
const x = this.data.x;
|
|
||||||
const adder = this.data.adder;
|
|
||||||
const size = this.data.size;
|
|
||||||
// update the appropriate bar
|
|
||||||
if (x > -1 && x < size){
|
|
||||||
if (adder === 1){
|
|
||||||
this.data.bars[x].setAttribute('class', 'progress-bar progress-bar--active');
|
|
||||||
} else {
|
|
||||||
this.data.bars[x].setAttribute('class', 'progress-bar progress-bar--inactive');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// update adder
|
|
||||||
if (x === size){
|
|
||||||
this.data['adder'] = -1;
|
|
||||||
} else if ( x === -1){
|
|
||||||
this.data['adder'] = 1;
|
|
||||||
}
|
|
||||||
// update x
|
|
||||||
this.data['x'] = x + adder;
|
|
||||||
};
|
|
||||||
this.stopProgressBar = function () {
|
|
||||||
clearInterval(this.updateInterval);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const progressBar = new ProgressBar();
|
|
||||||
progressBar.createProgressBar(10);
|
|
||||||
progressBar.startProgressBar();
|
|
||||||
</script>
|
|
Loading…
Reference in a new issue