updates
Browse files- static/index.html +89 -51
static/index.html
CHANGED
@@ -37,13 +37,12 @@
|
|
37 |
<div class="row">
|
38 |
<div class="col">
|
39 |
<h1>
|
40 |
-
|
41 |
<div class="badge bg-secondary">experimental</div>
|
42 |
</h1>
|
43 |
<p>
|
44 |
-
|
45 |
-
|
46 |
-
imperdiet est lobortis lectus sit vel.
|
47 |
</p>
|
48 |
</div>
|
49 |
</div>
|
@@ -89,8 +88,16 @@
|
|
89 |
<div class="alert alert-secondary action-menu" role="alert">
|
90 |
<div class="row">
|
91 |
<div class="col">
|
92 |
-
<p class="mb-0"
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
</div>
|
95 |
<div class="col flex-grow-0">
|
96 |
<a id="download-button" class="btn btn-outline-primary"
|
@@ -121,8 +128,10 @@
|
|
121 |
<img id="uploaded-image" class="thumbnail" />
|
122 |
</div>
|
123 |
<div class="col">
|
124 |
-
<div id="content-crendentials-icon"></div>
|
125 |
-
<
|
|
|
|
|
126 |
</div>
|
127 |
</div>
|
128 |
</div>
|
@@ -143,10 +152,12 @@
|
|
143 |
/>
|
144 |
</div>
|
145 |
<div class="output-container mt-5" style="display: none">
|
146 |
-
<h3 class="mt-4 mb-4">Verification
|
147 |
<div id="verification-output"></div>
|
148 |
|
149 |
-
<h3 class="mt-4 pt-4 mb-4" id="certificates-h3">
|
|
|
|
|
150 |
<div class="certificate" id="certificate-output">
|
151 |
<h4>Certificate chain</h4>
|
152 |
<ul id="certificate-list"></ul>
|
@@ -224,7 +235,10 @@
|
|
224 |
</div>
|
225 |
<div class="col mt-4 pt-4" id="logo">
|
226 |
<img src="images/logo.png" />
|
227 |
-
<p class="small mt-3 mb-5">
|
|
|
|
|
|
|
228 |
</div>
|
229 |
</div>
|
230 |
<div class="col right-column">
|
@@ -261,30 +275,40 @@
|
|
261 |
id="generate-terms"
|
262 |
/>
|
263 |
<label class="form-check-label" for="defaultCheck1">
|
264 |
-
By using this demo you agree to the
|
265 |
-
<a
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
</label>
|
267 |
</div>
|
268 |
|
269 |
-
<button
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
</form>
|
271 |
|
272 |
<div class="how-it-works">
|
273 |
<p><strong>How it works</strong></p>
|
274 |
|
275 |
<p>
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
website.
|
286 |
</p>
|
287 |
-
<p>Want to know more? Read our community blog post.</p>
|
288 |
</div>
|
289 |
</div>
|
290 |
<div class="display-verify">
|
@@ -308,29 +332,39 @@
|
|
308 |
id="verify-terms"
|
309 |
/>
|
310 |
<label class="form-check-label" for="defaultCheck1">
|
311 |
-
By using this demo you agree to the
|
312 |
-
<a
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
</label>
|
314 |
</div>
|
315 |
|
316 |
-
<button
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
</form>
|
318 |
<div class="how-it-works">
|
319 |
<p><strong>How it works</strong></p>
|
320 |
|
321 |
<p>
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
website.
|
332 |
</p>
|
333 |
-
<p>Want to know more? Read our community blog post.</p>
|
334 |
</div>
|
335 |
</div>
|
336 |
</div>
|
@@ -366,9 +400,13 @@
|
|
366 |
const verificationOutput = document.getElementById("verification-output");
|
367 |
const certificateList = document.getElementById("certificate-list");
|
368 |
const outputContainer = document.querySelector(".output-container");
|
369 |
-
const contentCredentialsIcon = document.getElementById(
|
370 |
-
|
371 |
-
|
|
|
|
|
|
|
|
|
372 |
var certificates = [];
|
373 |
|
374 |
[imagePrompt, model, generateTerms].forEach((item) => {
|
@@ -378,7 +416,8 @@
|
|
378 |
});
|
379 |
|
380 |
const setGenerateButtonStatus = () => {
|
381 |
-
if (imagePrompt.value && model.value && generateTerms.checked)
|
|
|
382 |
else generateButton.classList.remove("active");
|
383 |
};
|
384 |
|
@@ -466,16 +505,16 @@
|
|
466 |
.then((data) => {
|
467 |
console.log(data);
|
468 |
|
469 |
-
if (data.contains_c2pa ==
|
470 |
-
contentCredentialsIcon.setAttribute(
|
471 |
} else {
|
472 |
-
contentCredentialsIcon.setAttribute(
|
473 |
}
|
474 |
|
475 |
-
if (data.contains_watermark ==
|
476 |
-
digitalWatermarkIcon.setAttribute(
|
477 |
} else {
|
478 |
-
digitalWatermarkIcon.setAttribute(
|
479 |
}
|
480 |
|
481 |
if (
|
@@ -555,8 +594,7 @@
|
|
555 |
imageGenForm.addEventListener("submit", async (event) => {
|
556 |
event.preventDefault();
|
557 |
|
558 |
-
if (!imagePrompt.value || !model.value || !generateTerms.checked)
|
559 |
-
return;
|
560 |
|
561 |
placeholder = document.querySelector(".display-generate .placeholder");
|
562 |
spinner = document.querySelector(".display-generate .spinner");
|
|
|
37 |
<div class="row">
|
38 |
<div class="col">
|
39 |
<h1>
|
40 |
+
Watermarked Content Credentials
|
41 |
<div class="badge bg-secondary">experimental</div>
|
42 |
</h1>
|
43 |
<p>
|
44 |
+
Generate images with C2PA content credentials and Steg.ai
|
45 |
+
digital watermarking for enhanced AI label robustness
|
|
|
46 |
</p>
|
47 |
</div>
|
48 |
</div>
|
|
|
88 |
<div class="alert alert-secondary action-menu" role="alert">
|
89 |
<div class="row">
|
90 |
<div class="col">
|
91 |
+
<p class="mb-0">
|
92 |
+
<strong
|
93 |
+
>Download the signed, watermarked image to share
|
94 |
+
it.</strong
|
95 |
+
>
|
96 |
+
</p>
|
97 |
+
<p class="mb-0">
|
98 |
+
Use the verify tab two view the details for an image you
|
99 |
+
have or that's been shared with you.
|
100 |
+
</p>
|
101 |
</div>
|
102 |
<div class="col flex-grow-0">
|
103 |
<a id="download-button" class="btn btn-outline-primary"
|
|
|
128 |
<img id="uploaded-image" class="thumbnail" />
|
129 |
</div>
|
130 |
<div class="col">
|
131 |
+
<div id="content-crendentials-icon"></div>
|
132 |
+
Content Credentials<br />
|
133 |
+
<div id="digital-watermark-icon"></div>
|
134 |
+
Digital watermark
|
135 |
</div>
|
136 |
</div>
|
137 |
</div>
|
|
|
152 |
/>
|
153 |
</div>
|
154 |
<div class="output-container mt-5" style="display: none">
|
155 |
+
<h3 class="mt-4 mb-4">Verification output</h3>
|
156 |
<div id="verification-output"></div>
|
157 |
|
158 |
+
<h3 class="mt-4 pt-4 mb-4" id="certificates-h3">
|
159 |
+
Certificates
|
160 |
+
</h3>
|
161 |
<div class="certificate" id="certificate-output">
|
162 |
<h4>Certificate chain</h4>
|
163 |
<ul id="certificate-list"></ul>
|
|
|
235 |
</div>
|
236 |
<div class="col mt-4 pt-4" id="logo">
|
237 |
<img src="images/logo.png" />
|
238 |
+
<p class="small mt-3 mb-5">
|
239 |
+
This is a conceptual application meant for demonstration
|
240 |
+
purposes only.
|
241 |
+
</p>
|
242 |
</div>
|
243 |
</div>
|
244 |
<div class="col right-column">
|
|
|
275 |
id="generate-terms"
|
276 |
/>
|
277 |
<label class="form-check-label" for="defaultCheck1">
|
278 |
+
By using this demo you agree to the terms and conditions of
|
279 |
+
<a
|
280 |
+
href="https://truepic.com/terms-and-conditions/"
|
281 |
+
target="_blank"
|
282 |
+
>Truepic</a
|
283 |
+
>
|
284 |
+
and
|
285 |
+
<a href="https://steg.ai/tos" target="_blank">Steg.ai</a>
|
286 |
</label>
|
287 |
</div>
|
288 |
|
289 |
+
<button
|
290 |
+
type="submit"
|
291 |
+
class="btn btn-primary"
|
292 |
+
id="generate-button"
|
293 |
+
>
|
294 |
+
Submit
|
295 |
+
</button>
|
296 |
</form>
|
297 |
|
298 |
<div class="how-it-works">
|
299 |
<p><strong>How it works</strong></p>
|
300 |
|
301 |
<p>
|
302 |
+
When an image is generated and signed with C2PA Content
|
303 |
+
Credentials, an imperceptible digital watermark, powered by
|
304 |
+
Steg.ai, is also added to the image pixels. The watermark
|
305 |
+
serves as a backup in case the Content Credentials are lost,
|
306 |
+
such as when sharing the image between currently incompatible
|
307 |
+
services like text messaging. By using the watermark, it is
|
308 |
+
possible to retrieve a restored, signed version of the image
|
309 |
+
from before the data was decoupled, which you can try in the
|
310 |
+
verify tab.
|
|
|
311 |
</p>
|
|
|
312 |
</div>
|
313 |
</div>
|
314 |
<div class="display-verify">
|
|
|
332 |
id="verify-terms"
|
333 |
/>
|
334 |
<label class="form-check-label" for="defaultCheck1">
|
335 |
+
By using this demo you agree to the terms and conditions of
|
336 |
+
<a
|
337 |
+
href="https://truepic.com/terms-and-conditions/"
|
338 |
+
target="_blank"
|
339 |
+
>Truepic</a
|
340 |
+
>
|
341 |
+
and
|
342 |
+
<a href="https://steg.ai/tos" target="_blank">Steg.ai</a>
|
343 |
</label>
|
344 |
</div>
|
345 |
|
346 |
+
<button
|
347 |
+
type="submit"
|
348 |
+
class="btn btn-primary"
|
349 |
+
id="verify-button"
|
350 |
+
>
|
351 |
+
Submit
|
352 |
+
</button>
|
353 |
</form>
|
354 |
<div class="how-it-works">
|
355 |
<p><strong>How it works</strong></p>
|
356 |
|
357 |
<p>
|
358 |
+
When an image is generated and signed with C2PA Content
|
359 |
+
Credentials, an imperceptible digital watermark, powered by
|
360 |
+
Steg.ai, is also added to the image pixels. The watermark
|
361 |
+
serves as a backup in case the Content Credentials are lost,
|
362 |
+
such as when sharing the image between currently incompatible
|
363 |
+
services like text messaging. By using the watermark, it is
|
364 |
+
possible to retrieve a restored, signed version of the image
|
365 |
+
from before the data was decoupled, which you can try in the
|
366 |
+
verify tab.
|
|
|
367 |
</p>
|
|
|
368 |
</div>
|
369 |
</div>
|
370 |
</div>
|
|
|
400 |
const verificationOutput = document.getElementById("verification-output");
|
401 |
const certificateList = document.getElementById("certificate-list");
|
402 |
const outputContainer = document.querySelector(".output-container");
|
403 |
+
const contentCredentialsIcon = document.getElementById(
|
404 |
+
"content-crendentials-icon"
|
405 |
+
);
|
406 |
+
const digitalWatermarkIcon = document.getElementById(
|
407 |
+
"digital-watermark-icon"
|
408 |
+
);
|
409 |
+
|
410 |
var certificates = [];
|
411 |
|
412 |
[imagePrompt, model, generateTerms].forEach((item) => {
|
|
|
416 |
});
|
417 |
|
418 |
const setGenerateButtonStatus = () => {
|
419 |
+
if (imagePrompt.value && model.value && generateTerms.checked)
|
420 |
+
generateButton.classList.add("active");
|
421 |
else generateButton.classList.remove("active");
|
422 |
};
|
423 |
|
|
|
505 |
.then((data) => {
|
506 |
console.log(data);
|
507 |
|
508 |
+
if (data.contains_c2pa == "true") {
|
509 |
+
contentCredentialsIcon.setAttribute("class", "check-icon");
|
510 |
} else {
|
511 |
+
contentCredentialsIcon.setAttribute("class", "x-icon");
|
512 |
}
|
513 |
|
514 |
+
if (data.contains_watermark == "true") {
|
515 |
+
digitalWatermarkIcon.setAttribute("class", "check-icon");
|
516 |
} else {
|
517 |
+
digitalWatermarkIcon.setAttribute("class", "x-icon");
|
518 |
}
|
519 |
|
520 |
if (
|
|
|
594 |
imageGenForm.addEventListener("submit", async (event) => {
|
595 |
event.preventDefault();
|
596 |
|
597 |
+
if (!imagePrompt.value || !model.value || !generateTerms.checked) return;
|
|
|
598 |
|
599 |
placeholder = document.querySelector(".display-generate .placeholder");
|
600 |
spinner = document.querySelector(".display-generate .spinner");
|