diff --git a/frontends/web/templates/decode.html b/frontends/web/templates/decode.html
index 15dc998..7897078 100644
--- a/frontends/web/templates/decode.html
+++ b/frontends/web/templates/decode.html
@@ -241,18 +241,14 @@
Tries LSB first, then DCT
@@ -514,15 +510,10 @@ document.querySelector('input[name="rsa_key"]')?.addEventListener('change', upda
// MODE SWITCHING
// ============================================================================
-const modeRadios = document.querySelectorAll('input[name="embed_mode"]');
-const modeBtns = { 'auto': document.getElementById('autoModeCard'), 'lsb': document.getElementById('lsbModeCard'), 'dct': document.getElementById('dctModeCard') };
-
-modeRadios.forEach(radio => {
- radio.addEventListener('change', () => {
- Object.values(modeBtns).forEach(btn => btn?.classList.remove('active'));
- modeBtns[radio.value]?.classList.add('active');
- });
-});
+// Apply disabled styling to DCT if not available
+if (document.getElementById('modeDct')?.disabled) {
+ document.getElementById('dctModeLabel')?.classList.add('disabled', 'text-muted');
+}
// ============================================================================
// LOADING STATE
diff --git a/frontends/web/templates/encode.html b/frontends/web/templates/encode.html
index 1236336..26a3447 100644
--- a/frontends/web/templates/encode.html
+++ b/frontends/web/templates/encode.html
@@ -206,16 +206,13 @@
-
-
+
+
+
+
+
+
- |
@@ -646,7 +643,7 @@ carrierInput?.addEventListener('change', function() {
// ============================================================================
const modeRadios = document.querySelectorAll('input[name="embed_mode"]');
-const modeBtns = { 'dct': document.getElementById('dctModeCard'), 'lsb': document.getElementById('lsbModeCard') };
+const dctModeLabel = document.getElementById('dctModeLabel');
const grayModeInput = document.getElementById('grayMode');
const grayModeLabel = document.getElementById('grayModeLabel');
const jpegFormatInput = document.getElementById('jpegFormat');
@@ -654,6 +651,11 @@ const jpegFormatLabel = document.getElementById('jpegFormatLabel');
const colorModeInput = document.getElementById('colorMode');
const pngFormatInput = document.getElementById('pngFormat');
+// Apply disabled styling to DCT if not available
+if (document.getElementById('modeDct')?.disabled) {
+ dctModeLabel?.classList.add('disabled', 'text-muted');
+}
+
function updateOutputOptions(mode) {
const isLsb = mode === 'lsb';
if (isLsb) {
@@ -676,11 +678,7 @@ function updateOutputOptions(mode) {
}
modeRadios.forEach(radio => {
- radio.addEventListener('change', () => {
- Object.values(modeBtns).forEach(btn => btn?.classList.remove('active'));
- modeBtns[radio.value]?.classList.add('active');
- updateOutputOptions(radio.value);
- });
+ radio.addEventListener('change', () => updateOutputOptions(radio.value));
});
// Initialize output options based on initial mode