Replace modal with inline dynamic danger disclaimer; hide legacy modal styles

This commit is contained in:
EP
2025-08-20 20:18:04 -07:00
parent 0c477ac037
commit 80df0db814
2 changed files with 12 additions and 23 deletions
+3 -5
View File
@@ -1,9 +1,7 @@
.danger-modal-backdrop { position: fixed !important; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,.6); z-index: 10000; display:none; align-items:center; justify-content:center; }
.danger-modal-backdrop.danger-active { display:flex; }
.danger-modal { width: 560px; max-width: calc(100% - 32px); background: #0b0f0b; border: 1px solid #2e7d32; border-radius: 10px; box-shadow: 0 18px 48px rgba(0,0,0,.6); transform: scale(.96); animation: danger-pop .18s ease-out forwards; }
.danger-modal-backdrop { display: none; }
.danger-modal-backdrop.danger-active { display: none; }
.danger-modal { display: none; }
@keyframes danger-pop { to { transform: scale(1); } }
.danger-header { display:flex; align-items:center; gap:8px; padding: 14px 16px; color:#69f0ae; border-bottom:1px solid #1b5e20; font-size:1.05rem; }
.danger-body { padding: 14px 16px; color:#e0f2f1; opacity:.95; }
.danger-actions { display:flex; gap:8px; justify-content:flex-end; padding: 12px 16px; border-top:1px solid #1b5e20; }
.danger-cancel { background: var(--button-bg); border:1px solid var(--input-border); padding:8px 12px; border-radius:6px; cursor:pointer; }
.danger-proceed { background:#1b5e20; border:1px solid #2e7d32; color:#69f0ae; padding:8px 12px; border-radius:6px; cursor:pointer; box-shadow: 0 0 12px rgba(105,240,174,.35) inset, 0 0 16px rgba(105,240,174,.2); }
+9 -18
View File
@@ -250,10 +250,17 @@
<small>Craft dense token sequences with emojis and zero-width characters</small>
</h3>
</div>
<div class="tokenade-disclaimer">
<div class="tokenade-disclaimer" v-if="estimateTokenadeTokens() <= dangerThresholdTokens">
<i class="fas fa-triangle-exclamation"></i>
<span><strong>Safety notice:</strong> Tokenade payloads can severely degrade model performance and crash UIs. Use for testing only. Do not deploy to production or target systems without explicit permission.</span>
</div>
<div class="tokenade-disclaimer danger" v-else>
<i class="fas fa-radiation"></i>
<span>
<strong>Danger zone:</strong> Estimated length {{ estimateTokenadeLength().toLocaleString() }} chars exceeds the safe threshold ({{ dangerThresholdTokens.toLocaleString() }}).
Generating this will very likely freeze/crash your browser or downstream tools. Proceed only if you fully understand the risks.
</span>
</div>
<div class="tokenade-presets">
<button class="transform-button" title="Very light density" @click="applyTokenadePreset('feather')">🪶 Featherweight</button>
<button class="transform-button" title="Light density" @click="applyTokenadePreset('light')">🍃 Lightweight</button>
@@ -330,7 +337,7 @@
</label>
</div>
<div class="token-bomb-actions">
<button class="transform-button" @click="checkTokenadeDangerThenGenerate" title="Build the tokenade with current settings">
<button class="transform-button" @click="generateTokenBomb" title="Build the tokenade with current settings">
<i class="fas fa-hammer"></i> Generate Tokenade
</button>
<button class="copy-button" v-if="tokenBombOutput" @click="copyToClipboard(tokenBombOutput)">
@@ -803,22 +810,6 @@
</div>
</div>
<!-- Danger Zone Modal (must live inside #app for Vue bindings) -->
<div :class="['danger-modal-backdrop', showDangerModal ? 'danger-active' : '']">
<div class="danger-modal">
<div class="danger-header">
<i class="fas fa-radiation"></i>
<strong>Danger zone warning</strong>
</div>
<div class="danger-body">
<p>Your projected payload size exceeds <strong>25,000,000</strong> characters. Generating this will very likely <strong>freeze/crash</strong> your browser or downstream tools, and can rack up serious costs if sent to a model.</p>
<p>Proceed only if you fully understand the risks and are testing in a safe, isolated environment.</p>
</div>
<div class="danger-actions">
<button class="danger-proceed" @click="proceedDangerAction"><i class="fas fa-skull-crossbones"></i> I understand, proceed</button>
</div>
</div>
</div>
</div>