Skip to content

Commit

Permalink
small style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
giventofly committed Jul 3, 2019
1 parent fdbd029 commit 5690c75
Show file tree
Hide file tree
Showing 8 changed files with 426 additions and 142 deletions.
26 changes: 18 additions & 8 deletions docs/assets/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,21 @@ document.getElementById("pixlInput").onchange = function(e) {

//function to apply effects
const pixelit = ()=>{
px.setScale(blocksize.value).setPalette(paletteList[currentPalette]).draw().pixelate();
greyscale.checked ? px.convertGrayscale() : null;
palette.checked ? px.convertPalette() : null;
maxheight.value ? px.setMaxHeight(maxheight.value).resizeImage() : null;
maxwidth.value ? px.setMaxWidth(maxwidth.value).resizeImage() : null;
document.querySelector('.loader').classList.toggle('active');
px.setScale(blocksize.value).setPalette(paletteList[currentPalette]).draw().pixelate();
greyscale.checked ? px.convertGrayscale() : null;
palette.checked ? px.convertPalette() : null;
maxheight.value ? px.setMaxHeight(maxheight.value).resizeImage() : null;
maxwidth.value ? px.setMaxWidth(maxwidth.value).resizeImage() : null;
setTimeout(() => {
document.querySelector('.loader').classList.toggle('active');
}, 250);

}





const makePaletteGradient = ()=>{
//create palette
Expand All @@ -130,13 +137,16 @@ const makePaletteGradient = ()=>{
document.querySelector('#palettecolor').innerHTML = '';
paletteList[currentPalette].forEach(elem=>{
let div = document.createElement('div');
div.innerHTML = `<div class="colorblock" style="background-color: rgba(${elem[0]},${elem[1]},${elem[2]},1)"></div>`;
div.classList = 'colorblock';
div.style.backgroundColor = `rgba(${elem[0]},${elem[1]},${elem[2]},1)`;
//div.innerHTML = `<div class="colorblock" style="background-color: rgba(${elem[0]},${elem[1]},${elem[2]},1)"></div>`;
document.querySelector('#palettecolor').appendChild(div);
//pdivs += `<div class="colorblock" style="background-color: rgba(${elem[0]},${elem[1]},${elem[2]},1)"></div>`;
});
document.querySelector('#palettecolor').innerHTML = pdivs;
//document.querySelector('#palettecolor').innerHTML = pdivs;
}
makePaletteGradient();

makePaletteGradient();

//block size
const blocksize = document.querySelector('#blocksize');
Expand Down
11 changes: 8 additions & 3 deletions docs/assets/mainmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ document.addEventListener("DOMContentLoaded", function () {


var pixelit = function pixelit() {
document.querySelector('.loader').classList.toggle('active');
px.setScale(blocksize.value).setPalette(paletteList[currentPalette]).draw().pixelate();
greyscale.checked ? px.convertGrayscale() : null;
palette.checked ? px.convertPalette() : null;
maxheight.value ? px.setMaxHeight(maxheight.value).resizeImage() : null;
maxwidth.value ? px.setMaxWidth(maxwidth.value).resizeImage() : null;
setTimeout(function () {
document.querySelector('.loader').classList.toggle('active');
}, 250);
};

var makePaletteGradient = function makePaletteGradient() {
Expand All @@ -42,10 +46,11 @@ document.addEventListener("DOMContentLoaded", function () {
document.querySelector('#palettecolor').innerHTML = '';
paletteList[currentPalette].forEach(function (elem) {
var div = document.createElement('div');
div.innerHTML = "<div class=\"colorblock\" style=\"background-color: rgba(".concat(elem[0], ",").concat(elem[1], ",").concat(elem[2], ",1)\"></div>");
div.classList = 'colorblock';
div.style.backgroundColor = "rgba(".concat(elem[0], ",").concat(elem[1], ",").concat(elem[2], ",1)"); //div.innerHTML = `<div class="colorblock" style="background-color: rgba(${elem[0]},${elem[1]},${elem[2]},1)"></div>`;

document.querySelector('#palettecolor').appendChild(div); //pdivs += `<div class="colorblock" style="background-color: rgba(${elem[0]},${elem[1]},${elem[2]},1)"></div>`;
});
document.querySelector('#palettecolor').innerHTML = pdivs;
}); //document.querySelector('#palettecolor').innerHTML = pdivs;
};

makePaletteGradient(); //block size
Expand Down
185 changes: 176 additions & 9 deletions docs/assets/style.css

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

Loading

0 comments on commit 5690c75

Please sign in to comment.