Redesign 1 bcrypt #226

Merged
bones7242 merged 156 commits from redesign-1-bcrypt into master 2017-10-30 15:55:14 +01:00
3 changed files with 43 additions and 15 deletions
Showing only changes of commit 37685c3d33 - Show all commits

View file

@ -539,6 +539,14 @@ table {
text-align: center;
}
.progress-bar--inactive {
color: lightgrey;
}
.progress-bar--active {
color: dodgerblue;
}
/* ---- grid items ---- */
.grid-item {

View file

@ -62,22 +62,43 @@ function toggleSection(event){
}
}
function createProgressBar(element, size){
var x = 1;
function createProgressBar(element, size){
console.log('creating progress bar');
var x = 0;
var adder = 1;
function addOne(){
var bars = '<p>|';
for (var i = 0; i < x; i++){ bars += ' | '; }
bars += '</p>';
element.innerHTML = bars;
if (x === size){
adder = -1;
} else if ( x === 0){
adder = 1;
}
x += adder;
// create the bar holder & place it
var barHolder = document.createElement('p');
for (var i = 0; i < size; i++) {
const bar = document.createElement('span');
bar.innerText = '| ';
bar.setAttribute('class', 'progress-bar progress-bar--inactive');
barHolder.appendChild(bar);
}
element.appendChild(barHolder);
// get the bars
const bars = document.getElementsByClassName('progress-bar');
// function to update the bars' classes
function updateOneBar(){
// update the appropriate bar
if (x > -1 && x < size){
if (adder === 1){
bars[x].setAttribute('class', 'progress-bar progress-bar--active');
} else {
bars[x].setAttribute('class', 'progress-bar progress-bar--inactive');
}
}
// set x
if (x === size){
adder = -1;
} else if ( x === -1){
adder = 1;
}
// update the adder
x += adder;
};
setInterval(addOne, 300);
// start updater
setInterval(updateOneBar, 300);
}
function setCookie(key, value) {

View file

@ -39,7 +39,6 @@
</div>
</div>
</div>
<div id="publish-status" class="hidden">
<div id="publish-update" class="row align-content-center"></div>
<div id="publish-progress-bar" class="row align-content-center"></div>