Update index.html
Browse files- index.html +127 -254
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,101 +14,67 @@
|
|
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;
|
20 |
-
--
|
21 |
-
--
|
22 |
-
--foreground: oklch(0.145 0 0); /* near black */
|
23 |
}
|
24 |
.dark {
|
25 |
-
--background: oklch(0.145 0 0);
|
26 |
-
--foreground: oklch(0.985 0 0);
|
27 |
-
--popover: oklch(0.205 0 0);
|
28 |
-
--popover-foreground: oklch(0.985 0 0);
|
29 |
-
--border: oklch(1 0 0 / 10%);
|
|
|
|
|
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
|
37 |
.notification-popover-wrapper {
|
38 |
-
position: fixed;
|
39 |
-
|
40 |
-
|
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-
|
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 |
-
|
84 |
-
|
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:
|
97 |
-
color: oklch(0.4 0 0);
|
98 |
cursor: pointer;
|
99 |
-
|
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.
|
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,66 +89,44 @@
|
|
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 |
-
|
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 |
-
.
|
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% +
|
144 |
left: 50%;
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
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 |
-
|
162 |
-
|
163 |
-
|
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 |
-
|
172 |
-
|
173 |
-
|
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 |
-
|
179 |
-
|
180 |
}
|
181 |
|
182 |
-
.
|
183 |
-
|
|
|
|
|
|
|
|
|
184 |
}
|
185 |
-
|
|
|
186 |
|
187 |
</style>
|
188 |
<script>
|
@@ -190,33 +134,32 @@
|
|
190 |
darkMode: 'class',
|
191 |
theme: {
|
192 |
extend: {
|
193 |
-
colors: { /*
|
194 |
-
borderRadius: { /* Using CSS variables */ },
|
195 |
-
inset: { /* Using CSS variables */ },
|
196 |
keyframes: {
|
197 |
'popover-drop-in': {
|
198 |
-
'0%': { opacity: '0', transform: 'translateY(-
|
|
|
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(-
|
204 |
}
|
205 |
},
|
206 |
animation: {
|
207 |
-
'popover-open-top-center': 'popover-drop-in 0.
|
208 |
-
'popover-close-top-center': 'popover-lift-out 0.
|
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 (
|
220 |
<div class="header-controls">
|
221 |
<div id="notification-trigger-container">
|
222 |
<button id="notification-button" aria-label="Notifications" class="header-button">
|
@@ -231,173 +174,108 @@
|
|
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-
|
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 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
|
|
|
|
|
|
253 |
</div>
|
|
|
254 |
</div>
|
255 |
|
256 |
<div id="small-logo-container" class="hidden"></div>
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
</div>
|
261 |
</div>
|
262 |
</div>
|
263 |
</div>
|
264 |
</div>
|
265 |
|
266 |
-
<!-- SVG Icon Definitions
|
267 |
<div style="display: none;">
|
268 |
-
<svg id="svg-pauseIcon"
|
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>
|
282 |
const videoFeed = document.getElementById('video-feed');
|
283 |
const largeLogoContainer = document.getElementById('large-logo-container');
|
284 |
const smallLogoContainer = document.getElementById('small-logo-container');
|
285 |
-
const micButton = document.getElementById('mic-button');
|
286 |
-
const camButton = document.getElementById('cam-button');
|
287 |
-
const
|
288 |
const footerControls = document.getElementById('footer-controls');
|
289 |
-
const notificationButton = document.getElementById('notification-button');
|
290 |
const notificationPopover = document.getElementById('notification-popover');
|
291 |
|
292 |
const pauseIconSVG = document.getElementById('svg-pauseIcon').cloneNode(true);
|
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
|
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 |
-
|
332 |
-
|
333 |
-
|
334 |
-
largeLogoContainer.classList.add('flex');
|
335 |
-
} else {
|
336 |
-
largeLogoContainer.innerHTML = '';
|
337 |
-
largeLogoContainer.classList.add('hidden');
|
338 |
-
largeLogoContainer.classList.remove('flex');
|
339 |
-
}
|
340 |
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
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 |
-
|
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.
|
375 |
-
|
376 |
-
|
|
|
|
|
377 |
} else {
|
378 |
-
if (notificationPopover.classList.contains(
|
379 |
-
notificationPopover.classList.remove(
|
380 |
-
notificationPopover.classList.add(
|
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 |
-
|
396 |
-
notificationPopover.classList.remove(
|
397 |
-
|
398 |
-
|
|
|
399 |
} else {
|
400 |
-
|
|
|
401 |
}
|
402 |
}
|
403 |
}
|
@@ -409,8 +287,7 @@
|
|
409 |
});
|
410 |
|
411 |
document.addEventListener('click', (event) => {
|
412 |
-
|
413 |
-
if (isNotificationOpen && !popoverWrapper.contains(event.target) && !notificationButton.contains(event.target)) {
|
414 |
isNotificationOpen = false;
|
415 |
updateUI();
|
416 |
}
|
@@ -418,20 +295,16 @@
|
|
418 |
|
419 |
camButton.addEventListener('click', () => { isCamActive = !isCamActive; updateUI(); });
|
420 |
micButton.addEventListener('click', () => { isMicActive = !isMicActive; updateUI(); });
|
421 |
-
|
422 |
-
|
423 |
-
alert('دکمه تعویض دوربین کلیک شد!');
|
424 |
-
// Add actual camera switching logic here
|
425 |
});
|
426 |
|
427 |
-
//
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
updateUI(); // Initial UI state
|
435 |
</script>
|
436 |
</body>
|
437 |
</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 |
+
--card: oklch(1 0 0);
|
18 |
+
--card-foreground: oklch(0.145 0 0); /* Added for icon color */
|
19 |
}
|
20 |
:root {
|
21 |
+
--radius: 0.625rem;
|
22 |
+
--background: oklch(1 0 0);
|
23 |
+
--foreground: oklch(0.145 0 0);
|
|
|
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);
|
32 |
+
--card-foreground: oklch(0.985 0 0); /* Added for icon color */
|
33 |
}
|
34 |
@layer base {
|
35 |
* { @apply border-border outline-ring/50; }
|
36 |
+
body { @apply bg-background text-foreground; overflow-x: hidden; margin:0; padding:0; font-family: sans-serif; } /* Basic reset */
|
37 |
}
|
38 |
|
39 |
+
/* Notification Popover */
|
40 |
.notification-popover-wrapper {
|
41 |
+
position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
|
42 |
+
z-index: 100; width: calc(100% - 2rem); max-width: 28rem;
|
43 |
+
display: flex; justify-content: center; pointer-events: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
|
|
45 |
.popover-content {
|
46 |
+
width: 100%; border-radius: var(--radius-md, 0.5rem); border-width: 1px;
|
47 |
+
border-color: var(--border); background-color: var(--popover);
|
|
|
|
|
|
|
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; transition: opacity 0.3s ease-out, transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
|
51 |
+
opacity: 0; transform: translateY(-30px) scale(0.95); /* Start further up for drop */
|
|
|
52 |
pointer-events: none;
|
53 |
+
visibility: hidden; /* Ensure hidden when opacity is 0 */
|
54 |
}
|
|
|
55 |
.popover-content.open {
|
56 |
+
opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; visibility: visible;
|
57 |
}
|
|
|
58 |
.notification-popover-text-content {
|
59 |
background-color: #eff6ff; /* bg-blue-50 */
|
|
|
60 |
font-size: 0.875rem; line-height: 1.5rem; direction: rtl;
|
61 |
+
padding: 1rem; border-radius: inherit;
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
|
64 |
/* Header controls */
|
65 |
.header-controls {
|
66 |
+
display: flex; padding: 1rem; justify-content: space-between;
|
67 |
+
align-items: center; width: 100%; position: absolute;
|
68 |
+
top: 0; left: 0; z-index: 10;
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
|
|
70 |
.header-button {
|
71 |
display: flex; align-items: center; justify-content: center;
|
72 |
+
padding: 0.5rem; border-radius: var(--radius-lg, 0.625rem);
|
73 |
+
background-color: #e5e7eb; /* bg-gray-200 */
|
|
|
74 |
cursor: pointer;
|
75 |
+
color: var(--foreground); /* Ensure icon inherits text color */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
+
.header-button svg { opacity: 0.6; } /* Slightly less transparent */
|
78 |
|
79 |
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
|
80 |
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
|
|
|
89 |
.footer-controls.layout-default { justify-content: space-between; }
|
90 |
.footer-controls.layout-with-small-logo { justify-content: space-around; }
|
91 |
|
92 |
+
.control-button-wrapper {
|
93 |
+
position: relative; display: flex; align-items: center; justify-content: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
95 |
+
.camera-switch-icon {
|
|
|
|
|
|
|
|
|
96 |
position: absolute;
|
97 |
+
bottom: calc(100% + 10px); /* Positioned 10px above the camera button */
|
98 |
left: 50%;
|
99 |
+
transform: translateX(-50%) translateY(10px) scale(0.7); /* Initial: below, small, hidden */
|
100 |
+
background-color: var(--card);
|
101 |
+
color: var(--card-foreground); /* For SVG stroke */
|
102 |
+
border-radius: 50%;
|
103 |
+
padding: 10px; /* Increased padding */
|
104 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.08); /* Softer shadow */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
cursor: pointer;
|
106 |
+
z-index: 5;
|
107 |
+
transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
108 |
+
opacity: 0;
|
109 |
+
pointer-events: none;
|
|
|
|
|
|
|
|
|
110 |
}
|
111 |
+
.camera-switch-icon.visible {
|
112 |
+
opacity: 1;
|
113 |
+
transform: translateX(-50%) translateY(0) scale(1); /* Animate to final position */
|
114 |
+
pointer-events: auto;
|
|
|
|
|
115 |
}
|
116 |
+
.camera-switch-icon svg {
|
117 |
+
width: 24px; /* Consistent size */
|
118 |
+
height: 24px;
|
119 |
}
|
120 |
|
121 |
+
.control-button {
|
122 |
+
height: 80px; width: 80px; border-radius: 9999px;
|
123 |
+
padding: 0; display: flex; align-items: center; justify-content: center;
|
124 |
+
border-width: 1px;
|
125 |
+
box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
|
126 |
+
cursor: pointer;
|
127 |
}
|
128 |
+
.cam-button-color { background-color: #E0ECFF; } /* Left button */
|
129 |
+
.mic-button-color { background-color: #fecdd3; } /* Right button */
|
130 |
|
131 |
</style>
|
132 |
<script>
|
|
|
134 |
darkMode: 'class',
|
135 |
theme: {
|
136 |
extend: {
|
137 |
+
colors: { /* ... */ }, borderRadius: { /* ... */ }, inset: { /* ... */ },
|
|
|
|
|
138 |
keyframes: {
|
139 |
'popover-drop-in': {
|
140 |
+
'0%': { opacity: '0', transform: 'translateY(-30px) scale(0.95)' },
|
141 |
+
'70%': { opacity: '1', transform: 'translateY(5px) scale(1.02)' },
|
142 |
'100%': { opacity: '1', transform: 'translateY(0) scale(1)' },
|
143 |
},
|
144 |
'popover-lift-out': {
|
145 |
'0%': { opacity: '1', transform: 'translateY(0) scale(1)' },
|
146 |
+
'100%': { opacity: '0', transform: 'translateY(-30px) scale(0.95)' },
|
147 |
}
|
148 |
},
|
149 |
animation: {
|
150 |
+
'popover-open-top-center': 'popover-drop-in 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards',
|
151 |
+
'popover-close-top-center': 'popover-lift-out 0.3s ease-in forwards',
|
152 |
}
|
153 |
}
|
154 |
}
|
155 |
}
|
156 |
</script>
|
157 |
</head>
|
158 |
+
<body class="antialiased bg-slate-50">
|
159 |
|
160 |
<div class="w-full flex flex-col items-center justify-center min-h-[90dvh] md:min-h-screen">
|
161 |
<div class="max-w-3xl w-full flex flex-col items-center justify-center h-full relative">
|
162 |
+
<!-- Header - Button order: Notification (L), Back (R) -->
|
163 |
<div class="header-controls">
|
164 |
<div id="notification-trigger-container">
|
165 |
<button id="notification-button" aria-label="Notifications" class="header-button">
|
|
|
174 |
</div>
|
175 |
|
176 |
<div id="notification-popover-wrapper" class="notification-popover-wrapper">
|
177 |
+
<div id="notification-popover" class="popover-content"> <!-- initially-hidden removed, JS handles initial state -->
|
178 |
<div class="notification-popover-text-content">
|
179 |
مدلهای هوش مصنوعی میتوانند اشتباه کنند، صحت اطلاعات مهم را بررسی کنید و از وارد کردن اطلاعات حساس بپرهیزید.
|
180 |
</div>
|
181 |
</div>
|
182 |
</div>
|
183 |
|
184 |
+
<div class="w-full flex flex-col items-center justify-center h-[90dvh] bg-slate-50 top-0 left-0 relative">
|
185 |
<video id="video-feed" autoplay playsinline class="absolute top-0 left-0 w-full h-full object-cover scale-x-[-1] hidden"></video>
|
186 |
<div id="large-logo-container" class="hidden"></div>
|
187 |
|
188 |
<div id="footer-controls" class="footer-controls layout-default">
|
189 |
+
<!-- Camera Button Wrapper (Now on the Left in RTL) -->
|
190 |
+
<div class="control-button-wrapper">
|
191 |
+
<div id="cam-switch-icon" class="camera-switch-icon">
|
192 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
193 |
+
<path d="M11 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5"/>
|
194 |
+
<path d="M13 5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-5"/>
|
195 |
+
<line x1="12" x2="12" y1="1" y2="23"/>
|
196 |
+
<polyline points="8 13 12 17 16 13"/>
|
197 |
+
<polyline points="16 11 12 7 8 11"/>
|
198 |
+
</svg>
|
199 |
</div>
|
200 |
+
<div id="cam-button" class="control-button cam-button-color"></div>
|
201 |
</div>
|
202 |
|
203 |
<div id="small-logo-container" class="hidden"></div>
|
204 |
|
205 |
+
<!-- Mic Button (Now on the Right in RTL) -->
|
206 |
+
<div id="mic-button" class="control-button mic-button-color"></div>
|
|
|
207 |
</div>
|
208 |
</div>
|
209 |
</div>
|
210 |
</div>
|
211 |
|
212 |
+
<!-- SVG Icon Definitions -->
|
213 |
<div style="display: none;">
|
214 |
+
<svg id="svg-pauseIcon">...</svg><svg id="svg-microphoneIcon">...</svg><svg id="svg-cameraIcon">...</svg><svg id="svg-stopCamIcon">...</svg><svg id="svg-humanIcon">...</svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
</div>
|
216 |
|
217 |
<script>
|
218 |
const videoFeed = document.getElementById('video-feed');
|
219 |
const largeLogoContainer = document.getElementById('large-logo-container');
|
220 |
const smallLogoContainer = document.getElementById('small-logo-container');
|
221 |
+
const micButton = document.getElementById('mic-button'); // Right
|
222 |
+
const camButton = document.getElementById('cam-button'); // Left
|
223 |
+
const camSwitchIcon = document.getElementById('cam-switch-icon');
|
224 |
const footerControls = document.getElementById('footer-controls');
|
225 |
+
const notificationButton = document.getElementById('notification-button'); // Left header
|
226 |
const notificationPopover = document.getElementById('notification-popover');
|
227 |
|
228 |
const pauseIconSVG = document.getElementById('svg-pauseIcon').cloneNode(true);
|
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) { /* ... same as before ... */ } // Assuming AI icon isn't used in these states
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
|
239 |
function updateUI() {
|
240 |
videoFeed.classList.toggle('hidden', !isCamActive);
|
241 |
+
largeLogoContainer.classList.toggle('hidden', !(!isCamActive && isMicActive));
|
242 |
+
largeLogoContainer.classList.toggle('flex', !isCamActive && isMicActive);
|
243 |
+
if(!isCamActive && isMicActive) largeLogoContainer.innerHTML = createLogoHTML(false, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
|
245 |
+
smallLogoContainer.classList.toggle('hidden', !isCamActive);
|
246 |
+
smallLogoContainer.classList.toggle('flex', isCamActive);
|
247 |
+
if(isCamActive) smallLogoContainer.innerHTML = createLogoHTML(true, true);
|
248 |
+
|
249 |
+
footerControls.classList.toggle('layout-default', !isCamActive);
|
250 |
+
footerControls.classList.toggle('layout-with-small-logo', isCamActive);
|
251 |
+
|
252 |
+
camSwitchIcon.classList.toggle('visible', isCamActive);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
|
254 |
camButton.innerHTML = '';
|
255 |
camButton.appendChild(isCamActive ? stopCamIconSVG.cloneNode(true) : cameraIconSVG.cloneNode(true));
|
|
|
256 |
micButton.innerHTML = '';
|
257 |
micButton.appendChild(isMicActive ? pauseIconSVG.cloneNode(true) : microphoneIconSVG.cloneNode(true));
|
258 |
|
259 |
+
// Notification Popover
|
|
|
|
|
|
|
|
|
260 |
if (isNotificationOpen) {
|
261 |
+
notificationPopover.style.display = 'block'; // Make it visible before animation
|
262 |
+
requestAnimationFrame(() => { // Ensure display:block is processed
|
263 |
+
notificationPopover.classList.remove('animate-popover-close-top-center');
|
264 |
+
notificationPopover.classList.add('open', 'animate-popover-open-top-center');
|
265 |
+
});
|
266 |
} else {
|
267 |
+
if (notificationPopover.classList.contains('open')) {
|
268 |
+
notificationPopover.classList.remove('animate-popover-open-top-center');
|
269 |
+
notificationPopover.classList.add('animate-popover-close-top-center');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
setTimeout(() => {
|
271 |
+
if (!isNotificationOpen) {
|
272 |
+
notificationPopover.classList.remove('open');
|
273 |
+
notificationPopover.style.display = 'none'; // Hide after animation
|
274 |
+
}
|
275 |
+
}, 300); // Match close animation duration (0.3s)
|
276 |
} else {
|
277 |
+
notificationPopover.style.display = 'none'; // Ensure it's hidden if never opened
|
278 |
+
notificationPopover.classList.remove('open');
|
279 |
}
|
280 |
}
|
281 |
}
|
|
|
287 |
});
|
288 |
|
289 |
document.addEventListener('click', (event) => {
|
290 |
+
if (isNotificationOpen && !notificationPopover.contains(event.target) && event.target !== notificationButton) {
|
|
|
291 |
isNotificationOpen = false;
|
292 |
updateUI();
|
293 |
}
|
|
|
295 |
|
296 |
camButton.addEventListener('click', () => { isCamActive = !isCamActive; updateUI(); });
|
297 |
micButton.addEventListener('click', () => { isMicActive = !isMicActive; updateUI(); });
|
298 |
+
camSwitchIcon.addEventListener('click', (e) => {
|
299 |
+
e.stopPropagation(); alert('Camera switch clicked!');
|
|
|
|
|
300 |
});
|
301 |
|
302 |
+
// Initial call to set up the UI correctly, ensuring popover is hidden.
|
303 |
+
notificationPopover.style.opacity = '0';
|
304 |
+
notificationPopover.style.transform = 'translateY(-30px) scale(0.95)';
|
305 |
+
notificationPopover.style.visibility = 'hidden';
|
306 |
+
notificationPopover.style.display = 'none'; // Start fully hidden
|
307 |
+
updateUI();
|
|
|
|
|
308 |
</script>
|
309 |
</body>
|
310 |
</html>
|