Spaces:
Runtime error
Runtime error
+ 2 icônes inopérantes
Browse files- templates/index.html +15 -24
templates/index.html
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
<!DOCTYPE html>
|
3 |
<html lang="en">
|
4 |
<head>
|
@@ -6,6 +5,7 @@
|
|
6 |
<title>Fraud Score</title>
|
7 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
|
9 |
<style>
|
10 |
:root{
|
11 |
--apple-blue:#007aff;
|
@@ -15,35 +15,30 @@
|
|
15 |
}
|
16 |
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--apple-gray);color:#1c1c1e;}
|
17 |
h1,h2,h5{font-weight:600;}
|
18 |
-
/* preset thumbnails */
|
19 |
.preset-image-container{overflow:hidden;margin-bottom:12px}
|
20 |
.preset-image{width:100%;border-radius:12px;border:2px solid transparent;box-shadow:var(--apple-shadow);transition:transform .3s ease,border-color .3s ease;cursor:pointer}
|
21 |
.preset-image:hover{transform:scale(1.05)}
|
22 |
.preset-image.selected{border-color:var(--apple-blue)}
|
23 |
-
/* dropzone */
|
24 |
.dropzone{border:2px dashed var(--apple-border);border-radius:16px;background:#fff;padding:20px;text-align:center;box-shadow:var(--apple-shadow)}
|
25 |
-
/* preview */
|
26 |
.preview-image{max-width:220px;border-radius:16px;box-shadow:var(--apple-shadow);opacity:0;transition:opacity .4s ease}
|
27 |
.preview-image.visible{opacity:1}
|
28 |
-
/* buttons */
|
29 |
.btn-primary{background:var(--apple-blue);border:none;font-weight:500}
|
30 |
.btn-primary:hover{background:#005ecb}
|
31 |
-
|
32 |
-
.jauge-container{display:none;align-items:center;gap:14px;margin-top:24px}
|
33 |
.jauge{width:24px;height:160px;border-radius:12px;background:#e5e5ea;position:relative;overflow:hidden;border:1px solid var(--apple-border)}
|
34 |
.jauge-level{position:absolute;bottom:0;width:100%;border-radius:12px;background:var(--apple-blue);transition:height .6s ease,background .3s ease}
|
35 |
.jauge-labels{font-size:.7rem;color:#636366;display:flex;flex-direction:column;justify-content:space-between;height:160px}
|
36 |
-
|
|
|
37 |
#compareSection{margin-top:40px;text-align:center;display:none}
|
38 |
</style>
|
39 |
</head>
|
40 |
<body>
|
41 |
<div class="container py-5">
|
42 |
<h1 class="text-center mb-1">Fraud Score</h1>
|
43 |
-
<p class="text-center text-muted mb-5 fs-5">
|
44 |
|
45 |
<div class="row g-5">
|
46 |
-
<!-- Original column -->
|
47 |
<div class="col-md-6">
|
48 |
<h5 class="text-center mb-3">Select Original Image</h5>
|
49 |
<div class="row">
|
@@ -58,7 +53,6 @@
|
|
58 |
</div>
|
59 |
</div>
|
60 |
|
61 |
-
<!-- AI column -->
|
62 |
<div class="col-md-6">
|
63 |
<h5 class="text-center mb-3">Select AI Generated Image</h5>
|
64 |
<div class="row">
|
@@ -74,33 +68,32 @@
|
|
74 |
</div>
|
75 |
</div>
|
76 |
|
77 |
-
<!-- Compare / previews + button + gauge -->
|
78 |
<div id="compareSection">
|
79 |
<div class="d-flex justify-content-center align-items-center gap-5 mt-5">
|
80 |
<img id="previewImage1" class="preview-image" alt="Original preview">
|
81 |
-
|
82 |
<div class="d-flex flex-column align-items-center">
|
83 |
-
<!-- dynamic button here -->
|
84 |
<div id="compareButtonContainer" class="mb-3"></div>
|
85 |
-
<!-- hidden score & gauge -->
|
86 |
<div id="scoreBlock" style="display:none;">
|
87 |
<h2 class="fw-semibold mb-3">Fraud Score <span id="euclidVal" class="text-muted"></span>%</h2>
|
88 |
-
<div class="
|
89 |
-
<div class="jauge
|
90 |
-
|
91 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
</div>
|
93 |
</div>
|
94 |
</div>
|
95 |
</div>
|
96 |
-
|
97 |
<img id="previewImage2" class="preview-image" alt="AI preview">
|
98 |
</div>
|
99 |
-
|
100 |
<div id="results" class="mt-4"></div>
|
101 |
</div>
|
102 |
</div>
|
103 |
-
|
104 |
<script>
|
105 |
let file1=null, file2=null;
|
106 |
function resetSelection(target){
|
@@ -156,10 +149,8 @@
|
|
156 |
const data=await res.json();
|
157 |
const euclid=parseFloat(data.distance);
|
158 |
const fraud=Math.min(100,Math.max(2,185-2.73*euclid));
|
159 |
-
// show score block and update value
|
160 |
document.getElementById('euclidVal').textContent=fraud.toFixed(1);
|
161 |
document.getElementById('scoreBlock').style.display='block';
|
162 |
-
// gauge color & height
|
163 |
let color='#198754';
|
164 |
if(fraud>90)color='#dc3545';
|
165 |
else if(fraud>75)color='#fd7e14';
|
|
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
<head>
|
|
|
5 |
<title>Fraud Score</title>
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
7 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
8 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
|
9 |
<style>
|
10 |
:root{
|
11 |
--apple-blue:#007aff;
|
|
|
15 |
}
|
16 |
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--apple-gray);color:#1c1c1e;}
|
17 |
h1,h2,h5{font-weight:600;}
|
|
|
18 |
.preset-image-container{overflow:hidden;margin-bottom:12px}
|
19 |
.preset-image{width:100%;border-radius:12px;border:2px solid transparent;box-shadow:var(--apple-shadow);transition:transform .3s ease,border-color .3s ease;cursor:pointer}
|
20 |
.preset-image:hover{transform:scale(1.05)}
|
21 |
.preset-image.selected{border-color:var(--apple-blue)}
|
|
|
22 |
.dropzone{border:2px dashed var(--apple-border);border-radius:16px;background:#fff;padding:20px;text-align:center;box-shadow:var(--apple-shadow)}
|
|
|
23 |
.preview-image{max-width:220px;border-radius:16px;box-shadow:var(--apple-shadow);opacity:0;transition:opacity .4s ease}
|
24 |
.preview-image.visible{opacity:1}
|
|
|
25 |
.btn-primary{background:var(--apple-blue);border:none;font-weight:500}
|
26 |
.btn-primary:hover{background:#005ecb}
|
27 |
+
.jauge-container{display:none;align-items:center;gap:24px;margin-top:24px}
|
|
|
28 |
.jauge{width:24px;height:160px;border-radius:12px;background:#e5e5ea;position:relative;overflow:hidden;border:1px solid var(--apple-border)}
|
29 |
.jauge-level{position:absolute;bottom:0;width:100%;border-radius:12px;background:var(--apple-blue);transition:height .6s ease,background .3s ease}
|
30 |
.jauge-labels{font-size:.7rem;color:#636366;display:flex;flex-direction:column;justify-content:space-between;height:160px}
|
31 |
+
.icon-buttons { display: flex; flex-direction: column; gap: 16px; justify-content: center; align-items: center; margin-left: 12px; }
|
32 |
+
.icon-buttons button { background: none; border: none; color: var(--apple-blue); font-size: 24px; cursor: pointer; }
|
33 |
#compareSection{margin-top:40px;text-align:center;display:none}
|
34 |
</style>
|
35 |
</head>
|
36 |
<body>
|
37 |
<div class="container py-5">
|
38 |
<h1 class="text-center mb-1">Fraud Score</h1>
|
39 |
+
<p class="text-center text-muted mb-5 fs-5">Is my work used by generative AI ?</p>
|
40 |
|
41 |
<div class="row g-5">
|
|
|
42 |
<div class="col-md-6">
|
43 |
<h5 class="text-center mb-3">Select Original Image</h5>
|
44 |
<div class="row">
|
|
|
53 |
</div>
|
54 |
</div>
|
55 |
|
|
|
56 |
<div class="col-md-6">
|
57 |
<h5 class="text-center mb-3">Select AI Generated Image</h5>
|
58 |
<div class="row">
|
|
|
68 |
</div>
|
69 |
</div>
|
70 |
|
|
|
71 |
<div id="compareSection">
|
72 |
<div class="d-flex justify-content-center align-items-center gap-5 mt-5">
|
73 |
<img id="previewImage1" class="preview-image" alt="Original preview">
|
|
|
74 |
<div class="d-flex flex-column align-items-center">
|
|
|
75 |
<div id="compareButtonContainer" class="mb-3"></div>
|
|
|
76 |
<div id="scoreBlock" style="display:none;">
|
77 |
<h2 class="fw-semibold mb-3">Fraud Score <span id="euclidVal" class="text-muted"></span>%</h2>
|
78 |
+
<div class="d-flex align-items-center gap-4">
|
79 |
+
<div class="jauge-container mx-auto" id="gaugeWrapper">
|
80 |
+
<div class="jauge"><div class="jauge-level" id="jaugeLevel"></div></div>
|
81 |
+
<div class="jauge-labels text-start">
|
82 |
+
<span>most certainly</span><span>very probably</span><span>probably</span><span>possibly</span><span>probably not</span><span>definitely not</span>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
<div class="icon-buttons">
|
86 |
+
<button title="Print"><i class="fas fa-print"></i></button>
|
87 |
+
<button title="Certificate"><i class="fas fa-certificate"></i></button>
|
88 |
</div>
|
89 |
</div>
|
90 |
</div>
|
91 |
</div>
|
|
|
92 |
<img id="previewImage2" class="preview-image" alt="AI preview">
|
93 |
</div>
|
|
|
94 |
<div id="results" class="mt-4"></div>
|
95 |
</div>
|
96 |
</div>
|
|
|
97 |
<script>
|
98 |
let file1=null, file2=null;
|
99 |
function resetSelection(target){
|
|
|
149 |
const data=await res.json();
|
150 |
const euclid=parseFloat(data.distance);
|
151 |
const fraud=Math.min(100,Math.max(2,185-2.73*euclid));
|
|
|
152 |
document.getElementById('euclidVal').textContent=fraud.toFixed(1);
|
153 |
document.getElementById('scoreBlock').style.display='block';
|
|
|
154 |
let color='#198754';
|
155 |
if(fraud>90)color='#dc3545';
|
156 |
else if(fraud>75)color='#fd7e14';
|