Commit 10c2a0cd authored by Arnolds's avatar Arnolds
Browse files

Refactored and cleaned up frontend styling and logic in index.php: improved...

Refactored and cleaned up frontend styling and logic in index.php: improved code formatting, adjusted error message text, and streamlined section switching logic.
parent a0d46ff1
Loading
Loading
Loading
Loading
+69 −65
Original line number Diff line number Diff line
@@ -13,24 +13,30 @@ header('X-Robots-Tag: noindex, nofollow');
        .text-wrap-balance {
            text-wrap: balance;
        }

        html {
            height: 100%;
        }

        body {
            min-height: 100%;
            display: flex;
            flex-direction: column;
        }

        .footer {
            margin-top: auto;
        }

        .footer a {
            text-decoration: none;
            font-size: 1.2rem;
        }

        p {
            margin-bottom: .5rem;
        }

        .modal-body > *:last-child {
            margin-bottom: 0;
        }
@@ -76,7 +82,6 @@ header('X-Robots-Tag: noindex, nofollow');
            <button id="encryptBtn" class="btn btn-primary">💾 Noslēpt un izsniegt slepeno saiti</button>



            <div id="resultSection" class="mt-4" style="display: none;">
                <label class="form-label">🔗 Saite uz noslēpumu</label>
                <div style="position: relative; display: flex; align-items: center;" class="form-control">
@@ -233,11 +238,10 @@ header('X-Robots-Tag: noindex, nofollow');
            closeMainSections();
            openMainSection('encryptSection');
            return;
        }

        // Always show the "decrypt" UI (no existence leak)
        } else {
            closeMainSections();
            openMainSection('decryptSection');
        }

        // Always show passphrase input (even for unencrypted / non-existing)
        document.getElementById('passphrase-input-block').style.display = 'block';
@@ -268,7 +272,7 @@ header('X-Robots-Tag: noindex, nofollow');
                    closeMainSections();
                    openMainSection('errorSection');
                    errorSection.querySelector('.error-content').innerHTML =
                        '<p class="mb-0">Neizdevās atvērt noslēpumu. Iespējams, tas ir beidzies vai saite nav pareiza.</p>';
                        '<p class="mb-0">Neizdevās atvērt noslēpumu. Iespējams, tā termiņš ir beidzies vai saite nav pareiza.</p>';
                    return;
                }