diff --git a/index.html b/index.html index ec51d48..d9f185a 100644 --- a/index.html +++ b/index.html @@ -168,19 +168,30 @@ -
- +
+
+ - + - - + - + +
diff --git a/script.js b/script.js index d224920..2c387f2 100644 --- a/script.js +++ b/script.js @@ -23,11 +23,14 @@ const draggables = []; addContainerDrag(imagesBar); document.querySelector("#new-tier").onclick = () => addRow(); -document.querySelector("#select-images").onclick = () => selectImages(); document.querySelector("#export-image").onclick = () => exportImage(); document.querySelector("#save-image").onclick = () => saveImage(); blackout.onclick = () => hideBlackout(); +document.querySelector("#select-images").onchange = (e) => { + uploadImages(e.target.files); +}; + document.querySelectorAll(".row").forEach((row, index) => { addRowListeners(row, defaultColors[index]); }); @@ -46,7 +49,7 @@ document.addEventListener("dragover", (e) => { }); document.addEventListener("mousedown", (e) => { - const ignoreSelectors = [".pcr-app", ".export-container", "#blackout"]; + const ignoreSelectors = [".pcr-app", ".export-container"]; const ignoreClick = ignoreSelectors.some((selector) => e.target.closest(selector), ); @@ -189,18 +192,11 @@ function moveRow(row, direction) { mainContainer.insertBefore(row, rowBefore); } -function selectImages() { - const input = document.createElement("input"); - input.type = "file"; - input.accept = "image/*"; - input.multiple = true; - - input.click(); - - input.addEventListener("change", () => uploadImages(input.files)); -} - function uploadImages(files) { + if (!files) { + return; + } + for (const file of files) { if (file.type.split("/")[0] !== "image") { continue; diff --git a/styles/buttons.css b/styles/buttons.css index f65b80d..2db968c 100644 --- a/styles/buttons.css +++ b/styles/buttons.css @@ -1,18 +1,16 @@ -.buttons-container { - border-bottom: 1px solid var(--buttons-color); - background-color: var(--buttons-bg); - text-align: center; -} - .button { + display: inline-flex; + justify-content: center; + align-items: center; transition: background-color 300ms; margin: 10px; border: none; border-radius: 3px; background-color: var(--buttons-color); - padding-block: 7px; + padding: 7px; min-width: 100px; color: var(--button-text); + font-size: 13px; } .button:hover { @@ -27,21 +25,30 @@ label { color: var(--button-text); } -label::before { - display: inline-block; - margin-right: 5px; - border-radius: 1px; - background-color: var(--button-text); - width: 11.6px; - height: 11.6px; - content: ""; +.checkbox { + display: inline-flex; + align-items: center; + cursor: pointer; + margin: 4px; + padding-block: 6px; + text-wrap: nowrap; +} + +.checkbox span { + color: var(--button-text); + font-size: 15px; } input[type="checkbox"] { - display: none; + appearance: none; + margin: 0 5px 0 0; + border-radius: 1px; + background-color: var(--button-text); + width: 12px; + height: 12px; } -input[type="checkbox"]:checked + label::before { +input[type="checkbox"]:checked { background-image: url("../assets/check.svg"); background-color: var(--button-hover); } diff --git a/styles/list-options.css b/styles/list-options.css new file mode 100644 index 0000000..bc8ed97 --- /dev/null +++ b/styles/list-options.css @@ -0,0 +1,11 @@ +.list-options { + display: flex; + justify-content: center; + border-bottom: 1px solid var(--buttons-color); + background-color: var(--buttons-bg); +} + +.list-options-container { + display: flex; + overflow-y: auto; +} diff --git a/styles/main.css b/styles/main.css index 3d44326..f3c309e 100644 --- a/styles/main.css +++ b/styles/main.css @@ -2,6 +2,7 @@ @import "./buttons.css"; @import "./dynamic-styles.css"; @import "./export.css"; +@import "./list-options.css"; @import "./pickr.css"; @import "./tier-label.css"; @import "./tier-options.css";