jfrery-zama commited on
Commit
efaac09
·
unverified ·
1 Parent(s): aa387a3

add examples

Browse files
Files changed (2) hide show
  1. index.html +4 -0
  2. wasm-demo.js +11 -0
index.html CHANGED
@@ -420,6 +420,10 @@ sequenceDiagram
420
  </div>
421
  <label for="tokenInput" class="visually-hidden">Text to encrypt</label>
422
  <textarea id="tokenInput" rows="2" placeholder="Enter text to encrypt" autocomplete="off"></textarea>
 
 
 
 
423
  <div class="controls" style="margin-top: auto;">
424
  <button id="btnEncrypt" class="btn" disabled>🛡️ Encrypt</button>
425
  <span id="encryptSpin" class="loader" hidden aria-label="Encrypting"></span>
 
420
  </div>
421
  <label for="tokenInput" class="visually-hidden">Text to encrypt</label>
422
  <textarea id="tokenInput" rows="2" placeholder="Enter text to encrypt" autocomplete="off"></textarea>
423
+ <div style="display: flex; gap: calc(var(--spacing-unit) * 1); margin-bottom: calc(var(--spacing-unit) * 2); flex-wrap: wrap;">
424
+ <button id="btnWatermarked" class="btn" style="min-width: auto; padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1.5); font-size: 1rem;">✅ Watermarked</button>
425
+ <button id="btnNotWatermarked" class="btn" style="min-width: auto; padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1.5); font-size: 1rem;">❌ Not watermarked</button>
426
+ </div>
427
  <div class="controls" style="margin-top: auto;">
428
  <button id="btnEncrypt" class="btn" disabled>🛡️ Encrypt</button>
429
  <span id="encryptSpin" class="loader" hidden aria-label="Encrypting"></span>
wasm-demo.js CHANGED
@@ -175,6 +175,17 @@ $('btnLoadSaved').onclick = async () => {
175
  }
176
  };
177
 
 
 
 
 
 
 
 
 
 
 
 
178
  // Add token counter functionality
179
  $('tokenInput').addEventListener('input', () => {
180
  const text = $('tokenInput').value.trim();
 
175
  }
176
  };
177
 
178
+ // Add example text buttons
179
+ $('btnWatermarked').onclick = () => {
180
+ $('tokenInput').value = 'watermarking is useful for a variety of reasons like authentication, privacy';
181
+ $('tokenInput').dispatchEvent(new Event('input'));
182
+ };
183
+
184
+ $('btnNotWatermarked').onclick = () => {
185
+ $('tokenInput').value = 'watermarking serves multiple purposes, including verifying authenticity and enhancing data confidentiality';
186
+ $('tokenInput').dispatchEvent(new Event('input'));
187
+ };
188
+
189
  // Add token counter functionality
190
  $('tokenInput').addEventListener('input', () => {
191
  const text = $('tokenInput').value.trim();