Styled loader and modal

This commit is contained in:
Djeex
2025-08-22 15:29:18 +02:00
parent 1591886505
commit b5f8ceeb31
6 changed files with 84 additions and 32 deletions

View File

@ -5,18 +5,20 @@
* @param {number} duration - Duration in ms.
*/
function showLoader(text = "Building...") {
// --- Loader helpers ---
function showLoader(text = "Uploading...") {
const loader = document.getElementById("global-loader");
if (loader) {
loader.style.display = "flex";
loader.classList.add("active");
document.getElementById("loader-text").textContent = text;
}
}
function hideLoader() {
const loader = document.getElementById("global-loader");
if (loader) loader.style.display = "none";
if (loader) loader.classList.remove("active");
}
// --- Toast helpers ---
function showToast(message, type = "success", duration = 3000) {
const container = document.getElementById("toast-container");
if (!container) return;

View File

@ -16,13 +16,13 @@ function showToast(message, type = "success", duration = 3000) {
function showLoader(text = "Uploading...") {
const loader = document.getElementById("global-loader");
if (loader) {
loader.style.display = "flex";
loader.classList.add("active");
document.getElementById("loader-text").textContent = text;
}
}
function hideLoader() {
const loader = document.getElementById("global-loader");
if (loader) loader.style.display = "none";
if (loader) loader.classList.remove("active");
}
document.addEventListener("DOMContentLoaded", () => {

View File

@ -35,15 +35,16 @@ function showToast(message, type = "success", duration = 3000) {
function showLoader(text = "Uploading...") {
const loader = document.getElementById("global-loader");
if (loader) {
loader.style.display = "flex";
loader.classList.add("active");
document.getElementById("loader-text").textContent = text;
}
}
function hideLoader() {
const loader = document.getElementById("global-loader");
if (loader) loader.style.display = "none";
if (loader) loader.classList.remove("active");
}
// --- Color Picker
function setupColorPicker(colorId, btnId, textId, initial) {
const colorInput = document.getElementById(colorId);
const colorBtn = document.getElementById(btnId);

View File

@ -2,13 +2,13 @@
function showLoader(text = "Uploading...") {
const loader = document.getElementById("global-loader");
if (loader) {
loader.style.display = "flex";
loader.classList.add("active");
document.getElementById("loader-text").textContent = text;
}
}
function hideLoader() {
const loader = document.getElementById("global-loader");
if (loader) loader.style.display = "none";
if (loader) loader.classList.remove("active");
}
// --- Upload gallery images ---