s-ahal commited on
Commit
f95a7c2
·
verified ·
1 Parent(s): 180ae41

Update static/app.js

Browse files
Files changed (1) hide show
  1. static/app.js +42 -1
static/app.js CHANGED
@@ -82,7 +82,7 @@ function hideLoading() {
82
  if (loadingInterval) clearInterval(loadingInterval);
83
  }
84
  function updateLoadingFrame() {
85
- loadingImg.src = `static/assets/Infer_LoadingAnimation/Property 1=Variant${loadingFrame}.svg`;
86
  }
87
 
88
  function hideResultSection() {
@@ -393,3 +393,44 @@ window.addEventListener("DOMContentLoaded", function () {
393
  });
394
  }
395
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  if (loadingInterval) clearInterval(loadingInterval);
83
  }
84
  function updateLoadingFrame() {
85
+ loadingImg.src = `assets/Infer_LoadingAnimation/Property 1=Variant${loadingFrame}.svg`;
86
  }
87
 
88
  function hideResultSection() {
 
393
  });
394
  }
395
  });
396
+
397
+ // Resource card logic for resources page
398
+ (function () {
399
+ const resourceData = {
400
+ "do-not-train": {
401
+ title: "Do Not Train",
402
+ html: `<strong>What It Is:</strong> A simple metadata tag artists can add to their images to declare they don't consent to their work being used for training AI.<br><strong>How To Use:</strong> Add a do-not-train tag to your website's HTML or use platforms that support the tag.<br><strong>Note:</strong> It's not enforceable yet, but signals intent for future protections.<br><a href='https://spawning.ai/rightsholders-faq' class='action-button' target='_blank'><span>Learn more</span><span class='arrow'>⟶</span></a>`,
403
+ },
404
+ nightshade: {
405
+ title: "Nightshade",
406
+ html: `<strong>What It Is:</strong> A tool that poisons your artwork's pixels—imperceptibly to humans, but disruptive to training algorithms.<br><strong>Why It Works:</strong> It corrupts how AI models interpret your work, deterring them from using it.<br><a href='https://nightshade.cs.uchicago.edu/' class='action-button' target='_blank'><span>Try it out</span><span class='arrow'>⟶</span></a>`,
407
+ },
408
+ glaze: {
409
+ title: "Glaze",
410
+ html: `<strong>What It Is:</strong> A style cloak that protects your artistic fingerprint.<br><strong>What It Does:</strong> Applies a subtle, AI-visible filter that makes your work harder to mimic.<br><strong>Best For:</strong> Artists with a strong visual signature.<br><a href='https://glaze.cs.uchicago.edu/' class='action-button' target='_blank'><span>Try it out</span><span class='arrow'>⟶</span></a>`,
411
+ },
412
+ copyright: {
413
+ title: "Copyright Resources",
414
+ html: `<strong>Understand Your Rights:</strong><br>In many countries, your work is protected the moment it's created—but enforcing that is another story.<br><br><u>Includes:</u><ul><li>How to formally register your copyright</li><li>Templates for takedown notices</li><li>Intro to fair use & derivative work laws</li></ul>`,
415
+ },
416
+ licensing: {
417
+ title: "Licensing Tools",
418
+ html: `<strong>Put Terms in Writing:</strong><br>Use free or paid licenses to explicitly control how your work can be used.<br><br><u>Options to Explore:</u><ul><li>Creative Commons with "no AI use" clauses</li><li>Personal licensing agreements</li><li>Open-source licenses adapted for artists</li></ul>`,
419
+ },
420
+ };
421
+ const categories = document.querySelectorAll(".resource-category");
422
+ const info = document.getElementById("resource-info");
423
+ if (categories.length && info) {
424
+ function showResource(key) {
425
+ categories.forEach((btn) =>
426
+ btn.classList.toggle("active", btn.dataset.resource === key)
427
+ );
428
+ info.innerHTML = `<h3>${resourceData[key].title}</h3><p>${resourceData[key].html}</p>`;
429
+ }
430
+ categories.forEach((btn) => {
431
+ btn.addEventListener("click", () => showResource(btn.dataset.resource));
432
+ });
433
+ // Show default
434
+ showResource("do-not-train");
435
+ }
436
+ })();