Update index.html
Browse files- index.html +241 -129
index.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
6 |
-
<title>هوشان -
|
7 |
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
<style>
|
9 |
@custom-variant dark (&:is(.dark *));
|
@@ -14,68 +14,101 @@
|
|
14 |
--popover: oklch(1 0 0);
|
15 |
--popover-foreground: oklch(0.145 0 0);
|
16 |
--border: oklch(0.922 0 0);
|
17 |
-
--card: oklch(1 0 0); /* For camera switch icon background */
|
18 |
}
|
19 |
:root {
|
20 |
-
--radius: 0.625rem;
|
21 |
-
--
|
22 |
-
--
|
23 |
-
|
24 |
}
|
25 |
.dark {
|
26 |
-
--background: oklch(0.145 0 0);
|
27 |
-
--foreground: oklch(0.985 0 0);
|
28 |
-
--popover: oklch(0.205 0 0);
|
29 |
-
--popover-foreground: oklch(0.985 0 0);
|
30 |
-
--border: oklch(1 0 0 / 10%);
|
31 |
-
--card: oklch(0.205 0 0); /* Dark card background */
|
32 |
-
/* ... other dark variables ... */
|
33 |
}
|
34 |
@layer base {
|
35 |
* { @apply border-border outline-ring/50; }
|
36 |
body { @apply bg-background text-foreground; overflow-x: hidden; }
|
37 |
}
|
38 |
|
39 |
-
/* Notification Popover */
|
40 |
.notification-popover-wrapper {
|
41 |
-
position: fixed;
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
|
|
45 |
.popover-content {
|
46 |
-
width: 100%;
|
47 |
-
border-
|
|
|
|
|
|
|
48 |
color: var(--popover-foreground);
|
49 |
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
50 |
-
outline: none;
|
51 |
-
opacity: 0;
|
52 |
-
|
53 |
-
|
54 |
-
.popover-content.initially-hidden { /* Class to ensure it's fully hidden on load */
|
55 |
-
display: none; opacity: 0;
|
56 |
}
|
|
|
57 |
.popover-content.open {
|
58 |
-
|
59 |
}
|
|
|
60 |
.notification-popover-text-content {
|
61 |
background-color: #eff6ff; /* bg-blue-50 */
|
|
|
62 |
font-size: 0.875rem; line-height: 1.5rem; direction: rtl;
|
63 |
-
padding: 1rem;
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
65 |
|
66 |
/* Header controls */
|
67 |
.header-controls {
|
68 |
-
display: flex;
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
|
|
72 |
.header-button {
|
73 |
display: flex; align-items: center; justify-content: center;
|
74 |
-
padding: 0.5rem; border-radius: var(--radius-lg
|
75 |
-
background-color:
|
|
|
76 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
-
.header-button
|
|
|
|
|
|
|
79 |
|
80 |
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
|
81 |
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
|
@@ -90,39 +123,66 @@
|
|
90 |
.footer-controls.layout-default { justify-content: space-between; }
|
91 |
.footer-controls.layout-with-small-logo { justify-content: space-around; }
|
92 |
|
93 |
-
.control-button
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
-
.
|
|
|
|
|
|
|
|
|
97 |
position: absolute;
|
98 |
-
bottom: calc(100% +
|
99 |
left: 50%;
|
100 |
-
transform: translateX(-50%)
|
101 |
-
background-color: var(--card);
|
102 |
-
border: 1px solid var(--border);
|
103 |
-
border-radius: 50%;
|
104 |
-
padding: 8px;
|
105 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.15);
|
106 |
-
cursor: pointer;
|
107 |
z-index: 5;
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
opacity: 1;
|
114 |
-
transform: translateX(-50%) scale(1); /* Scale to full size */
|
115 |
-
pointer-events: auto;
|
116 |
-
}
|
117 |
-
.control-button {
|
118 |
-
height: 80px; width: 80px; border-radius: 9999px;
|
119 |
-
padding: 0; display: flex; align-items: center; justify-content: center;
|
120 |
border-width: 1px;
|
121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
}
|
124 |
-
|
125 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
|
127 |
</style>
|
128 |
<script>
|
@@ -130,34 +190,33 @@
|
|
130 |
darkMode: 'class',
|
131 |
theme: {
|
132 |
extend: {
|
133 |
-
colors: { /*
|
134 |
-
borderRadius: { /*
|
135 |
-
inset: { /*
|
136 |
keyframes: {
|
137 |
'popover-drop-in': {
|
138 |
-
'0%': { opacity: '0', transform: 'translateY(-
|
139 |
-
'70%': { opacity: '1', transform: 'translateY(5px) scale(1.02)' },
|
140 |
'100%': { opacity: '1', transform: 'translateY(0) scale(1)' },
|
141 |
},
|
142 |
'popover-lift-out': {
|
143 |
'0%': { opacity: '1', transform: 'translateY(0) scale(1)' },
|
144 |
-
'100%': { opacity: '0', transform: 'translateY(-
|
145 |
}
|
146 |
},
|
147 |
animation: {
|
148 |
-
'popover-open-top-center': 'popover-drop-in 0.
|
149 |
-
'popover-close-top-center': 'popover-lift-out 0.
|
150 |
}
|
151 |
}
|
152 |
}
|
153 |
}
|
154 |
</script>
|
155 |
</head>
|
156 |
-
<body class="antialiased
|
157 |
|
158 |
<div class="w-full flex flex-col items-center justify-center min-h-[90dvh] md:min-h-screen">
|
159 |
<div class="max-w-3xl w-full flex flex-col items-center justify-center h-full relative">
|
160 |
-
<!-- Header -
|
161 |
<div class="header-controls">
|
162 |
<div id="notification-trigger-container">
|
163 |
<button id="notification-button" aria-label="Notifications" class="header-button">
|
@@ -172,46 +231,51 @@
|
|
172 |
</div>
|
173 |
|
174 |
<div id="notification-popover-wrapper" class="notification-popover-wrapper">
|
175 |
-
<div id="notification-popover" class="popover-content
|
176 |
<div class="notification-popover-text-content">
|
177 |
مدلهای هوش مصنوعی میتوانند اشتباه کنند، صحت اطلاعات مهم را بررسی کنید و از وارد کردن اطلاعات حساس بپرهیزید.
|
178 |
</div>
|
179 |
</div>
|
180 |
</div>
|
181 |
|
182 |
-
<div class="w-full flex flex-col items-center justify-center h-[90dvh] bg-
|
183 |
<video id="video-feed" autoplay playsinline class="absolute top-0 left-0 w-full h-full object-cover scale-x-[-1] hidden"></video>
|
184 |
<div id="large-logo-container" class="hidden"></div>
|
185 |
|
186 |
<div id="footer-controls" class="footer-controls layout-default">
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
<!-- SVG
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
</svg>
|
195 |
</div>
|
196 |
-
<div id="cam-button" class="control-button cam-button-color"></div>
|
197 |
</div>
|
198 |
|
199 |
<div id="small-logo-container" class="hidden"></div>
|
200 |
|
201 |
-
|
202 |
-
|
|
|
203 |
</div>
|
204 |
</div>
|
205 |
</div>
|
206 |
</div>
|
207 |
|
208 |
-
<!-- SVG Icon Definitions (same as previous) -->
|
209 |
<div style="display: none;">
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
</div>
|
216 |
|
217 |
<script>
|
@@ -220,7 +284,7 @@
|
|
220 |
const smallLogoContainer = document.getElementById('small-logo-container');
|
221 |
const micButton = document.getElementById('mic-button');
|
222 |
const camButton = document.getElementById('cam-button');
|
223 |
-
const
|
224 |
const footerControls = document.getElementById('footer-controls');
|
225 |
const notificationButton = document.getElementById('notification-button');
|
226 |
const notificationPopover = document.getElementById('notification-popover');
|
@@ -229,65 +293,111 @@
|
|
229 |
const microphoneIconSVG = document.getElementById('svg-microphoneIcon').cloneNode(true);
|
230 |
const cameraIconSVG = document.getElementById('svg-cameraIcon').cloneNode(true);
|
231 |
const stopCamIconSVG = document.getElementById('svg-stopCamIcon').cloneNode(true);
|
|
|
232 |
|
233 |
let isMicActive = false;
|
234 |
let isCamActive = false;
|
235 |
let isNotificationOpen = false;
|
236 |
|
237 |
-
function createLogoHTML(isMini, isHumanActive, isAiActive) {
|
|
|
238 |
if (!isHumanActive && !isAiActive) return '';
|
239 |
const size = isMini ? 80 : 200;
|
240 |
const iconSize = isMini ? 35 : 70;
|
241 |
const insetBase = isMini ? { ping: 10, outer: 0, mid: 5, inner: 12, icon: 22 }
|
242 |
: { ping: 40, outer: 0, mid: 20, inner: 50, icon: 65 };
|
243 |
const bgColorBase = isHumanActive ? 'blue' : (isAiActive ? 'green' : 'gray');
|
244 |
-
const iconNode = isHumanActive ? document.getElementById('svg-humanIcon') : (isAiActive ? document.getElementById('svg-humanIcon')
|
245 |
if (!iconNode) return '';
|
246 |
const iconSVG = iconNode.cloneNode(true);
|
247 |
iconSVG.setAttribute('width', iconSize);
|
248 |
iconSVG.setAttribute('height', iconSize);
|
249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
}
|
251 |
|
252 |
function updateUI() {
|
253 |
videoFeed.classList.toggle('hidden', !isCamActive);
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
footerControls.classList.toggle('layout-with-small-logo', isCamActive);
|
264 |
|
265 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
|
267 |
camButton.innerHTML = '';
|
268 |
camButton.appendChild(isCamActive ? stopCamIconSVG.cloneNode(true) : cameraIconSVG.cloneNode(true));
|
|
|
269 |
micButton.innerHTML = '';
|
270 |
micButton.appendChild(isMicActive ? pauseIconSVG.cloneNode(true) : microphoneIconSVG.cloneNode(true));
|
271 |
|
272 |
-
|
|
|
|
|
|
|
|
|
273 |
if (isNotificationOpen) {
|
274 |
-
notificationPopover.classList.remove(
|
275 |
-
notificationPopover.classList.add(
|
|
|
276 |
} else {
|
277 |
-
if (notificationPopover.classList.contains(
|
278 |
-
notificationPopover.classList.remove(
|
279 |
-
notificationPopover.classList.add(
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
|
|
|
|
|
|
|
|
|
|
284 |
}
|
285 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
} else {
|
287 |
-
|
288 |
-
notificationPopover.classList.remove('open'); // Ensure open is removed
|
289 |
-
notificationPopover.style.opacity = '0'; // Directly set opacity if not relying on class
|
290 |
-
notificationPopover.style.pointerEvents = 'none';
|
291 |
}
|
292 |
}
|
293 |
}
|
@@ -295,16 +405,12 @@
|
|
295 |
notificationButton.addEventListener('click', (event) => {
|
296 |
event.stopPropagation();
|
297 |
isNotificationOpen = !isNotificationOpen;
|
298 |
-
if(isNotificationOpen) { // If opening, remove initial hidden state
|
299 |
-
notificationPopover.classList.remove('initially-hidden');
|
300 |
-
notificationPopover.style.display = 'block'; // Make sure it's display block before animation
|
301 |
-
}
|
302 |
updateUI();
|
303 |
});
|
304 |
|
305 |
document.addEventListener('click', (event) => {
|
306 |
const popoverWrapper = document.getElementById('notification-popover-wrapper');
|
307 |
-
if (isNotificationOpen && !popoverWrapper.contains(event.target) && !notificationButton.contains(event.target)
|
308 |
isNotificationOpen = false;
|
309 |
updateUI();
|
310 |
}
|
@@ -312,14 +418,20 @@
|
|
312 |
|
313 |
camButton.addEventListener('click', () => { isCamActive = !isCamActive; updateUI(); });
|
314 |
micButton.addEventListener('click', () => { isMicActive = !isMicActive; updateUI(); });
|
315 |
-
|
316 |
-
|
|
|
|
|
317 |
});
|
318 |
|
319 |
-
//
|
320 |
-
|
321 |
-
|
322 |
-
|
|
|
|
|
|
|
|
|
323 |
</script>
|
324 |
</body>
|
325 |
</html>
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
6 |
+
<title>هوشان - چیدمان آینهای و نوتیفیکیشن جدید</title>
|
7 |
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
<style>
|
9 |
@custom-variant dark (&:is(.dark *));
|
|
|
14 |
--popover: oklch(1 0 0);
|
15 |
--popover-foreground: oklch(0.145 0 0);
|
16 |
--border: oklch(0.922 0 0);
|
|
|
17 |
}
|
18 |
:root {
|
19 |
+
--radius: 0.625rem; /* 10px */
|
20 |
+
--radius-md: 0.5rem; /* 8px for popover consistency */
|
21 |
+
--background: oklch(1 0 0); /* white */
|
22 |
+
--foreground: oklch(0.145 0 0); /* near black */
|
23 |
}
|
24 |
.dark {
|
25 |
+
--background: oklch(0.145 0 0); /* near black */
|
26 |
+
--foreground: oklch(0.985 0 0); /* near white */
|
27 |
+
--popover: oklch(0.205 0 0); /* dark gray */
|
28 |
+
--popover-foreground: oklch(0.985 0 0); /* near white */
|
29 |
+
--border: oklch(1 0 0 / 10%); /* white with 10% alpha */
|
|
|
|
|
30 |
}
|
31 |
@layer base {
|
32 |
* { @apply border-border outline-ring/50; }
|
33 |
body { @apply bg-background text-foreground; overflow-x: hidden; }
|
34 |
}
|
35 |
|
36 |
+
/* Notification Popover Wrapper & Content */
|
37 |
.notification-popover-wrapper {
|
38 |
+
position: fixed;
|
39 |
+
top: 1rem;
|
40 |
+
left: 50%;
|
41 |
+
transform: translateX(-50%);
|
42 |
+
z-index: 100;
|
43 |
+
width: calc(100% - 2rem);
|
44 |
+
max-width: 28rem; /* max-w-md */
|
45 |
+
display: flex;
|
46 |
+
justify-content: center;
|
47 |
+
pointer-events: none;
|
48 |
}
|
49 |
+
|
50 |
.popover-content {
|
51 |
+
width: 100%;
|
52 |
+
border-radius: var(--radius-md);
|
53 |
+
border-width: 1px;
|
54 |
+
border-color: var(--border);
|
55 |
+
background-color: var(--popover);
|
56 |
color: var(--popover-foreground);
|
57 |
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
58 |
+
outline: none;
|
59 |
+
opacity: 0;
|
60 |
+
transform: translateY(-20px) scale(0.95);
|
61 |
+
pointer-events: none;
|
|
|
|
|
62 |
}
|
63 |
+
|
64 |
.popover-content.open {
|
65 |
+
pointer-events: auto;
|
66 |
}
|
67 |
+
|
68 |
.notification-popover-text-content {
|
69 |
background-color: #eff6ff; /* bg-blue-50 */
|
70 |
+
color: oklch(0.145 0 0);
|
71 |
font-size: 0.875rem; line-height: 1.5rem; direction: rtl;
|
72 |
+
padding: 1rem;
|
73 |
+
border-radius: var(--radius-md);
|
74 |
+
}
|
75 |
+
.dark .notification-popover-text-content {
|
76 |
+
background-color: #1e3a8a; /* blue-800 for darker blue */
|
77 |
+
color: oklch(0.985 0 0);
|
78 |
}
|
79 |
|
80 |
/* Header controls */
|
81 |
.header-controls {
|
82 |
+
display: flex;
|
83 |
+
padding: 1rem;
|
84 |
+
justify-content: space-between;
|
85 |
+
align-items: center;
|
86 |
+
width: 100%;
|
87 |
+
position: absolute;
|
88 |
+
top: 0;
|
89 |
+
left: 0;
|
90 |
+
z-index: 10;
|
91 |
}
|
92 |
+
|
93 |
.header-button {
|
94 |
display: flex; align-items: center; justify-content: center;
|
95 |
+
padding: 0.5rem; border-radius: var(--radius-lg);
|
96 |
+
background-color: oklch(0.92 0 0 / 80%);
|
97 |
+
color: oklch(0.4 0 0);
|
98 |
cursor: pointer;
|
99 |
+
transition: background-color 0.2s;
|
100 |
+
}
|
101 |
+
.dark .header-button {
|
102 |
+
background-color: oklch(0.25 0 0 / 80%);
|
103 |
+
color: oklch(0.85 0 0);
|
104 |
+
}
|
105 |
+
.header-button:hover {
|
106 |
+
background-color: oklch(0.9 0 0);
|
107 |
}
|
108 |
+
.dark .header-button:hover {
|
109 |
+
background-color: oklch(0.3 0 0);
|
110 |
+
}
|
111 |
+
.header-button svg { opacity: 0.7; }
|
112 |
|
113 |
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
|
114 |
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
|
|
|
123 |
.footer-controls.layout-default { justify-content: space-between; }
|
124 |
.footer-controls.layout-with-small-logo { justify-content: space-around; }
|
125 |
|
126 |
+
.control-button {
|
127 |
+
height: 80px; width: 80px; border-radius: 9999px;
|
128 |
+
padding: 0; display: flex; align-items: center; justify-content: center;
|
129 |
+
border-width: 1px; border-color: var(--border);
|
130 |
+
box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
|
131 |
+
cursor: pointer;
|
132 |
+
transition: transform 0.15s ease-out;
|
133 |
+
}
|
134 |
+
.control-button:hover {
|
135 |
+
transform: scale(1.03);
|
136 |
}
|
137 |
+
.cam-button-color { background-color: #E0ECFF; }
|
138 |
+
.mic-button-color { background-color: #fecdd3; }
|
139 |
+
|
140 |
+
/* Switch Camera Button Specific Styles */
|
141 |
+
#switch-camera-button {
|
142 |
position: absolute;
|
143 |
+
bottom: calc(100% + 0.75rem); /* Increased spacing from main cam button */
|
144 |
left: 50%;
|
145 |
+
/* transform: translateX(-50%) is handled by Tailwind class */
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
z-index: 5;
|
147 |
+
|
148 |
+
background-color: oklch(1 0 0 / 0.85); /* white with 85% opacity for light mode */
|
149 |
+
color: var(--foreground); /* For SVG stroke, adapts to light/dark */
|
150 |
+
|
151 |
+
border-radius: 9999px; /* rounded-full */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
border-width: 1px;
|
153 |
+
border-color: var(--border); /* Adapts to light/dark */
|
154 |
+
|
155 |
+
padding: 0.625rem; /* 10px padding (p-2.5) */
|
156 |
+
|
157 |
+
/* Tailwind's shadow-md equivalent for a subtle, modern shadow */
|
158 |
+
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
159 |
+
|
160 |
cursor: pointer;
|
161 |
+
display: flex;
|
162 |
+
align-items: center;
|
163 |
+
justify-content: center;
|
164 |
+
|
165 |
+
transition-property: background-color, border-color, transform, box-shadow;
|
166 |
+
transition-duration: 0.15s;
|
167 |
+
transition-timing-function: ease-in-out;
|
168 |
+
outline: none; /* Remove default outline for custom focus-visible */
|
169 |
+
}
|
170 |
+
|
171 |
+
#switch-camera-button:hover {
|
172 |
+
background-color: oklch(1 0 0 / 1); /* Solid white on hover */
|
173 |
+
/* hover:scale-105 is handled by Tailwind in HTML */
|
174 |
+
/* Tailwind's shadow-lg equivalent for hover */
|
175 |
+
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
176 |
}
|
177 |
+
|
178 |
+
.dark #switch-camera-button {
|
179 |
+
background-color: oklch(0.25 0 0 / 0.85); /* dark-gray with 85% opacity for dark mode */
|
180 |
+
}
|
181 |
+
|
182 |
+
.dark #switch-camera-button:hover {
|
183 |
+
background-color: oklch(0.3 0 0 / 1); /* Slightly lighter solid dark-gray on hover */
|
184 |
+
}
|
185 |
+
/* active:scale-95 and focus-visible styles are applied via Tailwind classes in HTML */
|
186 |
|
187 |
</style>
|
188 |
<script>
|
|
|
190 |
darkMode: 'class',
|
191 |
theme: {
|
192 |
extend: {
|
193 |
+
colors: { /* Using CSS variables */ },
|
194 |
+
borderRadius: { /* Using CSS variables */ },
|
195 |
+
inset: { /* Using CSS variables */ },
|
196 |
keyframes: {
|
197 |
'popover-drop-in': {
|
198 |
+
'0%': { opacity: '0', transform: 'translateY(-20px) scale(0.95)' },
|
|
|
199 |
'100%': { opacity: '1', transform: 'translateY(0) scale(1)' },
|
200 |
},
|
201 |
'popover-lift-out': {
|
202 |
'0%': { opacity: '1', transform: 'translateY(0) scale(1)' },
|
203 |
+
'100%': { opacity: '0', transform: 'translateY(-20px) scale(0.95)' },
|
204 |
}
|
205 |
},
|
206 |
animation: {
|
207 |
+
'popover-open-top-center': 'popover-drop-in 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards',
|
208 |
+
'popover-close-top-center': 'popover-lift-out 0.2s ease-in forwards',
|
209 |
}
|
210 |
}
|
211 |
}
|
212 |
}
|
213 |
</script>
|
214 |
</head>
|
215 |
+
<body class="antialiased">
|
216 |
|
217 |
<div class="w-full flex flex-col items-center justify-center min-h-[90dvh] md:min-h-screen">
|
218 |
<div class="max-w-3xl w-full flex flex-col items-center justify-center h-full relative">
|
219 |
+
<!-- Header - Notification (Left), Back (Right) - NO CHANGE FROM PREVIOUS -->
|
220 |
<div class="header-controls">
|
221 |
<div id="notification-trigger-container">
|
222 |
<button id="notification-button" aria-label="Notifications" class="header-button">
|
|
|
231 |
</div>
|
232 |
|
233 |
<div id="notification-popover-wrapper" class="notification-popover-wrapper">
|
234 |
+
<div id="notification-popover" class="popover-content">
|
235 |
<div class="notification-popover-text-content">
|
236 |
مدلهای هوش مصنوعی میتوانند اشتباه کنند، صحت اطلاعات مهم را بررسی کنید و از وارد کردن اطلاعات حساس بپرهیزید.
|
237 |
</div>
|
238 |
</div>
|
239 |
</div>
|
240 |
|
241 |
+
<div class="w-full flex flex-col items-center justify-center h-[90dvh] bg-background top-0 left-0 relative">
|
242 |
<video id="video-feed" autoplay playsinline class="absolute top-0 left-0 w-full h-full object-cover scale-x-[-1] hidden"></video>
|
243 |
<div id="large-logo-container" class="hidden"></div>
|
244 |
|
245 |
<div id="footer-controls" class="footer-controls layout-default">
|
246 |
+
<div class="relative flex flex-col items-center">
|
247 |
+
<button id="switch-camera-button"
|
248 |
+
class="hidden -translate-x-1/2 hover:scale-105 active:scale-95 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-[var(--color-background)]">
|
249 |
+
<!-- SVG injected by JS -->
|
250 |
+
</button>
|
251 |
+
<div id="cam-button" class="control-button cam-button-color">
|
252 |
+
<!-- SVG injected by JS -->
|
|
|
253 |
</div>
|
|
|
254 |
</div>
|
255 |
|
256 |
<div id="small-logo-container" class="hidden"></div>
|
257 |
|
258 |
+
<div id="mic-button" class="control-button mic-button-color">
|
259 |
+
<!-- SVG injected by JS -->
|
260 |
+
</div>
|
261 |
</div>
|
262 |
</div>
|
263 |
</div>
|
264 |
</div>
|
265 |
|
266 |
+
<!-- SVG Icon Definitions (same as previous response, including switchCameraIcon) -->
|
267 |
<div style="display: none;">
|
268 |
+
<svg id="svg-pauseIcon" width="37" height="37" viewBox="0 0 37 37" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.9872 29.6198V8.28342C15.9872 6.25781 15.132 5.44757 12.9713 5.44757H7.52469C5.36404 5.44757 4.50879 6.25781 4.50879 8.28342V29.6198C4.50879 31.6454 5.36404 32.4556 7.52469 32.4556H12.9713C15.132 32.4556 15.9872 31.6454 15.9872 29.6198Z" fill="#BE123C"/><path opacity="0.4" d="M31.5175 29.6198V8.28342C31.5175 6.25781 30.6622 5.44757 28.5016 5.44757H23.055C20.9093 5.44757 20.0391 6.25781 20.0391 8.28342V29.6198C20.0391 31.6454 20.8943 32.4556 23.055 32.4556H28.5016C30.6622 32.4556 31.5175 31.6454 31.5175 29.6198Z" fill="#BE123C"/></svg>
|
269 |
+
<svg id="svg-microphoneIcon" width="69" height="68" viewBox="0 0 69 68" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity="0.4" d="M49.9479 27.1824C49.0803 27.1824 48.3907 27.872 48.3907 28.7396V32.2544C48.3907 40.1293 41.984 46.5361 34.109 46.5361C26.234 46.5361 19.8273 40.1293 19.8273 32.2544V28.7173C19.8273 27.8497 19.1377 27.1601 18.2701 27.1601C17.4025 27.1601 16.7129 27.8497 16.7129 28.7173V32.2321C16.7129 41.2861 23.6758 48.7384 32.5518 49.5393V54.2776C32.5518 55.1452 33.2414 55.8348 34.109 55.8348C34.9766 55.8348 35.6662 55.1452 35.6662 54.2776V49.5393C44.52 48.7607 51.5051 41.2861 51.5051 32.2321V28.7173C51.4829 27.872 50.7933 27.1824 49.9479 27.1824Z" fill="#BE123C"/><path d="M34.1099 11.3434C28.682 11.3434 24.2773 15.7481 24.2773 21.176V32.5658C24.2773 37.9938 28.682 42.3984 34.1099 42.3984C39.5379 42.3984 43.9425 37.9938 43.9425 32.5658V21.176C43.9425 15.7481 39.5379 11.3434 34.1099 11.3434ZM37.0241 26.8042C36.8684 27.3826 36.3567 27.7608 35.7784 27.7608C35.6671 27.7608 35.5559 27.7385 35.4447 27.7163C34.5771 27.4716 33.665 27.4716 32.7974 27.7163C32.0856 27.9165 31.396 27.4938 31.218 26.8042C31.0178 26.1146 31.4404 25.4027 32.1301 25.2247C33.4426 24.8688 34.8218 24.8688 36.1343 25.2247C36.8017 25.4027 37.2021 26.1146 37.0241 26.8042ZM38.2031 22.4885C38.0029 23.0224 37.5135 23.3339 36.9796 23.3339C36.8239 23.3339 36.6904 23.3116 36.5347 23.2671C34.9775 22.6887 33.2423 22.6887 31.6852 23.2671C31.0178 23.5118 30.2614 23.1559 30.0167 22.4885C29.772 21.8212 30.128 21.0648 30.7953 20.8423C32.9309 20.0637 35.289 20.0637 37.4245 20.8423C38.0919 21.087 38.4478 21.8212 38.2031 22.4885Z" fill="#BE123C"/></svg>
|
270 |
+
<svg id="svg-cameraIcon" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity="0.4" d="M21.8118 5.52235H11.9265C6.29183 5.52235 4.10059 7.7136 4.10059 13.3482V26.5286C4.10059 30.318 6.16002 34.3545 11.9265 34.3545H21.8118C27.4464 34.3545 29.6376 32.1633 29.6376 26.5286V13.3482C29.6376 7.7136 27.4464 5.52235 21.8118 5.52235Z" fill="#2252A0"/><path d="M19.3406 18.9169C21.0512 18.9169 22.438 17.5302 22.438 15.8195C22.438 14.1089 21.0512 12.7222 19.3406 12.7222C17.6299 12.7222 16.2432 14.1089 16.2432 15.8195C16.2432 17.5302 17.6299 18.9169 19.3406 18.9169Z" fill="#2252A0"/><path d="M36.0629 10.3332C35.3874 9.98721 33.9705 9.5918 32.0429 10.9428L29.6045 12.6562C29.621 12.8869 29.6374 13.1011 29.6374 13.3482V26.5286C29.6374 26.7758 29.6045 26.9899 29.6045 27.2206L32.0429 28.934C33.0643 29.659 33.954 29.8896 34.6625 29.8896C35.2721 29.8896 35.7499 29.7249 36.0629 29.5601C36.7384 29.2141 37.8752 28.275 37.8752 25.919V13.9743C37.8752 11.6183 36.7384 10.6792 36.0629 10.3332Z" fill="#2252A0"/></svg>
|
271 |
+
<svg id="svg-stopCamIcon" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity="0.4" d="M29.0785 10.8076L6.91966 32.9665C4.61316 31.5002 3.70703 28.8807 3.70703 26.36V13.18C3.70703 7.54555 5.89821 5.35437 11.5327 5.35437H21.4177C26.1789 5.35437 28.4854 6.9195 29.0785 10.8076Z" fill="#2252A0"/><path opacity="0.4" d="M29.2427 15.2394V26.36C29.2427 26.4918 29.2262 26.5907 29.2262 26.706C29.2262 26.8213 29.2097 26.9366 29.2097 27.052H29.2262C29.045 32.1757 26.8208 34.1856 21.417 34.1856H11.532C11.1202 34.1856 10.7412 34.1692 10.3623 34.1197L29.2427 15.2394Z" fill="#2252A0"/><path opacity="0.4" d="M29.21 27.052C29.21 26.9366 29.2264 26.8213 29.2264 26.706C29.2429 26.8213 29.2429 26.9366 29.2264 27.052H29.21Z" fill="#2252A0"/><path opacity="0.4" d="M29.2264 12.4716C29.2429 12.5869 29.2429 12.7187 29.2264 12.834C29.2264 12.7187 29.21 12.6034 29.21 12.488L29.2264 12.4716Z" fill="#2252A0"/><path d="M37.4804 13.8061V25.734C37.4804 28.0899 36.3436 29.029 35.6682 29.3749C35.3551 29.5397 34.8774 29.7209 34.2678 29.7209C33.5594 29.7209 32.6697 29.4903 31.6483 28.7654L29.2264 27.052H29.21C29.21 26.9366 29.2264 26.8213 29.2264 26.706C29.2264 26.5907 29.2429 26.4918 29.2429 26.36V15.2394L34.6302 9.85205C35.0751 9.885 35.421 10.0168 35.6682 10.1651C36.3436 10.5111 37.4804 11.4501 37.4804 13.8061Z" fill="#2252A0"/><path d="M35.8666 3.67393C35.3723 3.17968 34.565 3.17968 34.0708 3.67393L3.6744 34.0868C3.18015 34.581 3.18015 35.3883 3.6744 35.8826C3.92152 36.1132 4.23455 36.245 4.56405 36.245C4.89355 36.245 5.20657 36.1132 5.4537 35.8661L35.8666 5.45323C36.3773 4.95898 36.3773 4.16818 35.8666 3.67393Z" fill="#2252A0"/></svg>
|
272 |
+
<svg id="svg-humanIcon" width="70" height="70" viewBox="0 0 88 89" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M75.1481 81.6361H12.9259C9.66667 81.6361 7 78.9721 7 75.7161V58.5112C7 57.5862 7 57.1052 7.44444 56.2172C8.85185 52.9612 13 50.2232 19.4815 47.8922C24.1111 56.6982 33.3704 62.6921 44 62.6921C54.6296 62.6921 63.9259 56.6982 68.5185 47.8922C75 50.1862 79.1852 52.9982 80.5556 56.2172C81 56.6612 81 57.6232 81 58.5112V75.7161C81 78.9721 78.3333 81.6361 75.0741 81.6361H75.1481Z" stroke="#FCFCFC" stroke-width="6.42146" stroke-linecap="round" stroke-linejoin="round"/><path d="M44.0371 50.1862C33.8519 50.1862 25.5186 41.8612 25.5186 31.6863V26.1363C25.5186 15.9613 33.8519 7.63635 44.0371 7.63635C54.2223 7.63635 62.5556 15.9613 62.5556 26.1363V31.6863C62.5556 41.8612 54.2223 50.1862 44.0371 50.1862Z" stroke="#FCFCFC" stroke-width="6.42146" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
273 |
+
<svg id="svg-switchCameraIcon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
274 |
+
<path d="M23 4v6h-6"></path>
|
275 |
+
<path d="M1 20v-6h6"></path>
|
276 |
+
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10"></path>
|
277 |
+
<path d="M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path>
|
278 |
+
</svg>
|
279 |
</div>
|
280 |
|
281 |
<script>
|
|
|
284 |
const smallLogoContainer = document.getElementById('small-logo-container');
|
285 |
const micButton = document.getElementById('mic-button');
|
286 |
const camButton = document.getElementById('cam-button');
|
287 |
+
const switchCameraButton = document.getElementById('switch-camera-button');
|
288 |
const footerControls = document.getElementById('footer-controls');
|
289 |
const notificationButton = document.getElementById('notification-button');
|
290 |
const notificationPopover = document.getElementById('notification-popover');
|
|
|
293 |
const microphoneIconSVG = document.getElementById('svg-microphoneIcon').cloneNode(true);
|
294 |
const cameraIconSVG = document.getElementById('svg-cameraIcon').cloneNode(true);
|
295 |
const stopCamIconSVG = document.getElementById('svg-stopCamIcon').cloneNode(true);
|
296 |
+
const switchCameraIconSVG = document.getElementById('svg-switchCameraIcon').cloneNode(true);
|
297 |
|
298 |
let isMicActive = false;
|
299 |
let isCamActive = false;
|
300 |
let isNotificationOpen = false;
|
301 |
|
302 |
+
function createLogoHTML(isMini, isHumanActive, isAiActive) {
|
303 |
+
// ... (same as previous response)
|
304 |
if (!isHumanActive && !isAiActive) return '';
|
305 |
const size = isMini ? 80 : 200;
|
306 |
const iconSize = isMini ? 35 : 70;
|
307 |
const insetBase = isMini ? { ping: 10, outer: 0, mid: 5, inner: 12, icon: 22 }
|
308 |
: { ping: 40, outer: 0, mid: 20, inner: 50, icon: 65 };
|
309 |
const bgColorBase = isHumanActive ? 'blue' : (isAiActive ? 'green' : 'gray');
|
310 |
+
const iconNode = isHumanActive ? document.getElementById('svg-humanIcon') : (isAiActive ? document.getElementById('svg-humanIcon') : null);
|
311 |
if (!iconNode) return '';
|
312 |
const iconSVG = iconNode.cloneNode(true);
|
313 |
iconSVG.setAttribute('width', iconSize);
|
314 |
iconSVG.setAttribute('height', iconSize);
|
315 |
+
|
316 |
+
return `
|
317 |
+
<div class="hidden bg-green-200 bg-green-300 bg-green-400 bg-blue-200 bg-blue-300 bg-blue-400 dark:bg-green-700 dark:bg-green-600 dark:bg-green-500 dark:bg-blue-700 dark:bg-blue-600 dark:bg-blue-500"></div>
|
318 |
+
<div class="relative" style="width: ${size}px; height: ${size}px;">
|
319 |
+
<div class="absolute rounded-full opacity-50 animate-ping bg-${bgColorBase}-200 dark:bg-${bgColorBase}-700" style="inset: ${insetBase.ping}px;"></div>
|
320 |
+
<div class="absolute inset-0 rounded-full opacity-50 bg-${bgColorBase}-200 dark:bg-${bgColorBase}-700"></div>
|
321 |
+
<div class="absolute rounded-full opacity-50 bg-${bgColorBase}-300 dark:bg-${bgColorBase}-600" style="inset: ${insetBase.mid}px;"></div>
|
322 |
+
<div class="absolute rounded-full opacity-50 bg-${bgColorBase}-400 dark:bg-${bgColorBase}-500" style="inset: ${insetBase.inner}px;"></div>
|
323 |
+
<div class="z-10 absolute" style="inset: ${insetBase.icon}px;">
|
324 |
+
${iconSVG.outerHTML}
|
325 |
+
</div>
|
326 |
+
</div>`;
|
327 |
}
|
328 |
|
329 |
function updateUI() {
|
330 |
videoFeed.classList.toggle('hidden', !isCamActive);
|
331 |
+
if (!isCamActive && isMicActive) {
|
332 |
+
largeLogoContainer.innerHTML = createLogoHTML(false, true, false);
|
333 |
+
largeLogoContainer.classList.remove('hidden');
|
334 |
+
largeLogoContainer.classList.add('flex');
|
335 |
+
} else {
|
336 |
+
largeLogoContainer.innerHTML = '';
|
337 |
+
largeLogoContainer.classList.add('hidden');
|
338 |
+
largeLogoContainer.classList.remove('flex');
|
339 |
+
}
|
|
|
340 |
|
341 |
+
if (isCamActive) {
|
342 |
+
smallLogoContainer.innerHTML = createLogoHTML(true, true, false);
|
343 |
+
smallLogoContainer.classList.remove('hidden');
|
344 |
+
smallLogoContainer.classList.add('flex');
|
345 |
+
footerControls.classList.remove('layout-default');
|
346 |
+
footerControls.classList.add('layout-with-small-logo');
|
347 |
+
|
348 |
+
switchCameraButton.classList.remove('hidden');
|
349 |
+
switchCameraButton.innerHTML = '';
|
350 |
+
switchCameraButton.appendChild(switchCameraIconSVG.cloneNode(true));
|
351 |
+
} else {
|
352 |
+
smallLogoContainer.innerHTML = '';
|
353 |
+
smallLogoContainer.classList.add('hidden');
|
354 |
+
smallLogoContainer.classList.remove('flex');
|
355 |
+
footerControls.classList.remove('layout-with-small-logo');
|
356 |
+
footerControls.classList.add('layout-default');
|
357 |
+
|
358 |
+
switchCameraButton.classList.add('hidden');
|
359 |
+
switchCameraButton.innerHTML = '';
|
360 |
+
}
|
361 |
|
362 |
camButton.innerHTML = '';
|
363 |
camButton.appendChild(isCamActive ? stopCamIconSVG.cloneNode(true) : cameraIconSVG.cloneNode(true));
|
364 |
+
|
365 |
micButton.innerHTML = '';
|
366 |
micButton.appendChild(isMicActive ? pauseIconSVG.cloneNode(true) : microphoneIconSVG.cloneNode(true));
|
367 |
|
368 |
+
const openAnimation = 'animate-popover-open-top-center';
|
369 |
+
const closeAnimation = 'animate-popover-close-top-center';
|
370 |
+
const openClass = 'open';
|
371 |
+
const popoverAnimationDuration = 200; // Corresponds to 'popover-lift-out' duration (0.2s)
|
372 |
+
|
373 |
if (isNotificationOpen) {
|
374 |
+
notificationPopover.classList.remove(closeAnimation);
|
375 |
+
notificationPopover.classList.add(openClass);
|
376 |
+
notificationPopover.classList.add(openAnimation);
|
377 |
} else {
|
378 |
+
if (notificationPopover.classList.contains(openClass) || notificationPopover.classList.contains(openAnimation)) {
|
379 |
+
notificationPopover.classList.remove(openAnimation);
|
380 |
+
notificationPopover.classList.add(closeAnimation);
|
381 |
+
|
382 |
+
const handleAnimationEnd = (event) => {
|
383 |
+
if (event.target === notificationPopover) {
|
384 |
+
// Check if this was the close animation that just ended
|
385 |
+
if (notificationPopover.classList.contains(closeAnimation)) {
|
386 |
+
notificationPopover.classList.remove(openClass);
|
387 |
+
notificationPopover.classList.remove(closeAnimation); // Clean up animation class
|
388 |
+
}
|
389 |
+
notificationPopover.removeEventListener('animationend', handleAnimationEnd);
|
390 |
}
|
391 |
+
};
|
392 |
+
notificationPopover.addEventListener('animationend', handleAnimationEnd);
|
393 |
+
|
394 |
+
setTimeout(() => {
|
395 |
+
if (!isNotificationOpen) { // If it's still meant to be closed
|
396 |
+
notificationPopover.classList.remove(openClass, openAnimation, closeAnimation); // Force clean state
|
397 |
+
}
|
398 |
+
}, popoverAnimationDuration + 50); // Fallback timeout
|
399 |
} else {
|
400 |
+
notificationPopover.classList.remove(openClass, openAnimation, closeAnimation);
|
|
|
|
|
|
|
401 |
}
|
402 |
}
|
403 |
}
|
|
|
405 |
notificationButton.addEventListener('click', (event) => {
|
406 |
event.stopPropagation();
|
407 |
isNotificationOpen = !isNotificationOpen;
|
|
|
|
|
|
|
|
|
408 |
updateUI();
|
409 |
});
|
410 |
|
411 |
document.addEventListener('click', (event) => {
|
412 |
const popoverWrapper = document.getElementById('notification-popover-wrapper');
|
413 |
+
if (isNotificationOpen && !popoverWrapper.contains(event.target) && !notificationButton.contains(event.target)) {
|
414 |
isNotificationOpen = false;
|
415 |
updateUI();
|
416 |
}
|
|
|
418 |
|
419 |
camButton.addEventListener('click', () => { isCamActive = !isCamActive; updateUI(); });
|
420 |
micButton.addEventListener('click', () => { isMicActive = !isMicActive; updateUI(); });
|
421 |
+
|
422 |
+
switchCameraButton.addEventListener('click', () => {
|
423 |
+
alert('دکمه تعویض دوربین کلیک شد!');
|
424 |
+
// Add actual camera switching logic here
|
425 |
});
|
426 |
|
427 |
+
// Optional: Apply dark mode based on system preference or localStorage
|
428 |
+
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
429 |
+
document.documentElement.classList.add('dark');
|
430 |
+
} else {
|
431 |
+
document.documentElement.classList.remove('dark');
|
432 |
+
}
|
433 |
+
|
434 |
+
updateUI(); // Initial UI state
|
435 |
</script>
|
436 |
</body>
|
437 |
</html>
|