mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-05 13:02:58 +00:00
d
This commit is contained in:
+15
-6
@@ -826,6 +826,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
if (saveBannerBtn) {
|
if (saveBannerBtn) {
|
||||||
saveBannerBtn.addEventListener('click', saveBanner);
|
saveBannerBtn.addEventListener('click', saveBanner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set up color input listeners
|
||||||
|
setupColorInputListeners();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle dropped files
|
// Handle dropped files
|
||||||
@@ -1524,25 +1527,31 @@ const debouncedUpdatePreview = debounce(() => {
|
|||||||
updateBannerPreview();
|
updateBannerPreview();
|
||||||
}, 300);
|
}, 300);
|
||||||
|
|
||||||
bannerBgColor.addEventListener('input', () => {
|
// This function will be called after DOM is loaded
|
||||||
|
function setupColorInputListeners() {
|
||||||
|
if (bannerBgColor) {
|
||||||
|
bannerBgColor.addEventListener('input', () => {
|
||||||
// Update color preview immediately
|
// Update color preview immediately
|
||||||
const bgColorPreview = document.getElementById('bgColorPreview');
|
|
||||||
if (bgColorPreview) {
|
if (bgColorPreview) {
|
||||||
bgColorPreview.style.backgroundColor = bannerBgColor.value;
|
bgColorPreview.style.backgroundColor = bannerBgColor.value;
|
||||||
}
|
}
|
||||||
// Debounce the full preview update
|
// Debounce the full preview update
|
||||||
debouncedUpdatePreview();
|
debouncedUpdatePreview();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
bannerTextColor.addEventListener('input', () => {
|
|
||||||
|
if (bannerTextColor) {
|
||||||
|
bannerTextColor.addEventListener('input', () => {
|
||||||
// Update color preview immediately
|
// Update color preview immediately
|
||||||
const textColorPreview = document.getElementById('textColorPreview');
|
|
||||||
if (textColorPreview) {
|
if (textColorPreview) {
|
||||||
textColorPreview.style.backgroundColor = bannerTextColor.value;
|
textColorPreview.style.backgroundColor = bannerTextColor.value;
|
||||||
}
|
}
|
||||||
// Debounce the full preview update
|
// Debounce the full preview update
|
||||||
debouncedUpdatePreview();
|
debouncedUpdatePreview();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Connect color pickers to input fields
|
// Connect color pickers to input fields
|
||||||
const bannerBgColorPicker = document.getElementById('bannerBgColorPicker');
|
const bannerBgColorPicker = document.getElementById('bannerBgColorPicker');
|
||||||
|
|||||||
Reference in New Issue
Block a user