Update index.html
Browse files- index.html +237 -110
index.html
CHANGED
@@ -3,9 +3,10 @@
|
|
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 *));
|
10 |
@theme inline {
|
11 |
--color-background: var(--background);
|
@@ -14,11 +15,10 @@
|
|
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 |
}
|
@@ -28,53 +28,95 @@
|
|
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;
|
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 |
-
|
52 |
-
|
53 |
-
|
|
|
54 |
}
|
|
|
55 |
.popover-content.open {
|
56 |
-
opacity: 1;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
|
|
|
64 |
/* Header controls */
|
65 |
.header-controls {
|
66 |
-
display: flex;
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
-
.header-button
|
|
|
|
|
|
|
|
|
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,44 +131,72 @@
|
|
89 |
.footer-controls.layout-default { justify-content: space-between; }
|
90 |
.footer-controls.layout-with-small-logo { justify-content: space-around; }
|
91 |
|
92 |
-
.control-button
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
95 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
position: absolute;
|
97 |
-
bottom: calc(100% +
|
98 |
left: 50%;
|
99 |
-
transform: translateX(-50%)
|
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-
|
112 |
opacity: 1;
|
113 |
-
transform:
|
114 |
pointer-events: auto;
|
115 |
}
|
116 |
-
.camera-
|
117 |
-
width:
|
118 |
-
height:
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
box-shadow: 0
|
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,16 +204,18 @@
|
|
134 |
darkMode: 'class',
|
135 |
theme: {
|
136 |
extend: {
|
137 |
-
colors: { /* ...
|
|
|
|
|
138 |
keyframes: {
|
139 |
'popover-drop-in': {
|
140 |
-
'0%': { opacity: '0', transform: 'translateY(-
|
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(-
|
147 |
}
|
148 |
},
|
149 |
animation: {
|
@@ -155,75 +227,90 @@
|
|
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
|
163 |
<div class="header-controls">
|
164 |
-
|
|
|
165 |
<button id="notification-button" aria-label="Notifications" class="header-button">
|
166 |
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
|
167 |
</button>
|
168 |
</div>
|
169 |
-
|
|
|
170 |
<div class="header-button" onclick="alert('Back clicked')">
|
171 |
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"></path></svg>
|
172 |
</div>
|
173 |
</div>
|
174 |
</div>
|
175 |
|
|
|
176 |
<div id="notification-popover-wrapper" class="notification-popover-wrapper">
|
177 |
-
<div id="notification-popover" class="popover-content">
|
178 |
<div class="notification-popover-text-content">
|
179 |
مدلهای هوش مصنوعی میتوانند اشتباه کنند، صحت اطلاعات مهم را بررسی کنید و از وارد کردن اطلاعات حساس بپرهیزید.
|
180 |
</div>
|
181 |
</div>
|
182 |
</div>
|
183 |
|
184 |
-
|
|
|
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 |
-
<!--
|
190 |
-
<div
|
191 |
-
<div id="cam-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
<
|
197 |
-
|
198 |
-
|
|
|
|
|
|
|
|
|
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
|
206 |
-
<div id="mic-button" class="control-button mic-button-color"
|
|
|
|
|
207 |
</div>
|
208 |
</div>
|
209 |
</div>
|
210 |
</div>
|
211 |
|
212 |
-
<!-- SVG Icon Definitions -->
|
213 |
<div style="display: none;">
|
214 |
-
<svg id="svg-pauseIcon"
|
|
|
|
|
|
|
|
|
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');
|
222 |
-
const camButton = document.getElementById('cam-button');
|
223 |
-
const camSwitchIcon = document.getElementById('cam-switch-icon');
|
224 |
const footerControls = document.getElementById('footer-controls');
|
225 |
-
const notificationButton = document.getElementById('notification-button');
|
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);
|
@@ -234,48 +321,86 @@
|
|
234 |
let isCamActive = false;
|
235 |
let isNotificationOpen = false;
|
236 |
|
237 |
-
function createLogoHTML(isMini, isHumanActive) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
|
239 |
function updateUI() {
|
240 |
videoFeed.classList.toggle('hidden', !isCamActive);
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
footerControls.classList.toggle('layout-with-small-logo', isCamActive);
|
251 |
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
262 |
-
|
263 |
-
|
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 |
-
|
278 |
-
|
|
|
|
|
279 |
}
|
280 |
}
|
281 |
}
|
@@ -287,7 +412,8 @@
|
|
287 |
});
|
288 |
|
289 |
document.addEventListener('click', (event) => {
|
290 |
-
|
|
|
291 |
isNotificationOpen = false;
|
292 |
updateUI();
|
293 |
}
|
@@ -295,16 +421,17 @@
|
|
295 |
|
296 |
camButton.addEventListener('click', () => { isCamActive = !isCamActive; updateUI(); });
|
297 |
micButton.addEventListener('click', () => { isMicActive = !isMicActive; updateUI(); });
|
298 |
-
|
299 |
-
|
|
|
|
|
300 |
});
|
301 |
|
302 |
-
// Initial
|
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>
|
|
|
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 |
+
/* ... (CSS variables and base styles from previous correct version) ... */
|
10 |
@custom-variant dark (&:is(.dark *));
|
11 |
@theme inline {
|
12 |
--color-background: var(--background);
|
|
|
15 |
--popover: oklch(1 0 0);
|
16 |
--popover-foreground: oklch(0.145 0 0);
|
17 |
--border: oklch(0.922 0 0);
|
|
|
|
|
18 |
}
|
19 |
:root {
|
20 |
+
--radius: 0.625rem; /* 10px */
|
21 |
+
--radius-md: 0.5rem; /* 8px, for consistency if used elsewhere */
|
22 |
--background: oklch(1 0 0);
|
23 |
--foreground: oklch(0.145 0 0);
|
24 |
}
|
|
|
28 |
--popover: oklch(0.205 0 0);
|
29 |
--popover-foreground: oklch(0.985 0 0);
|
30 |
--border: oklch(1 0 0 / 10%);
|
|
|
|
|
31 |
}
|
32 |
@layer base {
|
33 |
* { @apply border-border outline-ring/50; }
|
34 |
+
body { @apply bg-background text-foreground; overflow-x: hidden; }
|
35 |
}
|
36 |
|
37 |
+
/* Notification Popover Wrapper & Content */
|
38 |
.notification-popover-wrapper {
|
39 |
+
position: fixed;
|
40 |
+
top: 1rem; /* Distance from top */
|
41 |
+
left: 50%;
|
42 |
+
transform: translateX(-50%);
|
43 |
+
z-index: 100; /* Ensure it's above other elements */
|
44 |
+
width: calc(100% - 2rem); /* Some padding from screen edges */
|
45 |
+
max-width: 28rem; /* max-w-md or similar */
|
46 |
+
display: flex;
|
47 |
+
justify-content: center;
|
48 |
+
pointer-events: none; /* Wrapper itself doesn't catch events */
|
49 |
}
|
50 |
+
|
51 |
.popover-content {
|
52 |
+
width: 100%;
|
53 |
+
border-radius: var(--radius-md, 0.5rem);
|
54 |
+
border-width: 1px; /* Border for the popover container */
|
55 |
+
border-color: var(--border);
|
56 |
+
background-color: var(--popover);
|
57 |
color: var(--popover-foreground);
|
58 |
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
59 |
+
outline: none;
|
60 |
+
transition: opacity 0.3s ease-out, transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
|
61 |
+
opacity: 0;
|
62 |
+
transform: translateY(-100%) scale(0.9); /* Start off-screen top and slightly scaled down */
|
63 |
+
pointer-events: none; /* Content not interactive until 'open' */
|
64 |
}
|
65 |
+
|
66 |
.popover-content.open {
|
67 |
+
opacity: 1;
|
68 |
+
transform: translateY(0) scale(1);
|
69 |
+
pointer-events: auto; /* Content interactive when 'open' */
|
70 |
}
|
71 |
+
/* Text content within the popover */
|
72 |
.notification-popover-text-content {
|
73 |
+
background-color: #eff6ff; /* bg-blue-50 - might need dark mode variant if popover bg isn't enough contrast */
|
74 |
font-size: 0.875rem; line-height: 1.5rem; direction: rtl;
|
75 |
+
padding: 1rem;
|
76 |
+
border-radius: var(--radius-md, 0.5rem);
|
77 |
+
/* For dark mode, text color in notification should be dark on light blue */
|
78 |
+
color: oklch(0.145 0 0); /* Ensuring text readability on light blue bg */
|
79 |
+
}
|
80 |
+
.dark .notification-popover-text-content {
|
81 |
+
background-color: oklch(0.25 0.05 230); /* Darker blue for dark mode */
|
82 |
+
color: oklch(0.95 0.01 230); /* Lighter text for dark mode */
|
83 |
}
|
84 |
|
85 |
+
|
86 |
/* Header controls */
|
87 |
.header-controls {
|
88 |
+
display: flex;
|
89 |
+
padding: 1rem;
|
90 |
+
justify-content: space-between;
|
91 |
+
align-items: center;
|
92 |
+
width: 100%;
|
93 |
+
position: absolute;
|
94 |
+
top: 0;
|
95 |
+
left: 0;
|
96 |
+
z-index: 10;
|
97 |
}
|
98 |
+
|
99 |
+
/* Common style for header buttons */
|
100 |
.header-button {
|
101 |
display: flex; align-items: center; justify-content: center;
|
102 |
padding: 0.5rem; border-radius: var(--radius-lg, 0.625rem);
|
103 |
background-color: #e5e7eb; /* bg-gray-200 */
|
104 |
cursor: pointer;
|
105 |
+
transition: background-color 0.2s;
|
106 |
+
}
|
107 |
+
.header-button:hover {
|
108 |
+
background-color: #d1d5db; /* bg-gray-300 */
|
109 |
+
}
|
110 |
+
.header-button svg { opacity: 0.7; stroke: #374151 /* gray-700 */; }
|
111 |
+
|
112 |
+
.dark .header-button {
|
113 |
+
background-color: oklch(0.28 0 0); /* Darker gray for dark mode */
|
114 |
}
|
115 |
+
.dark .header-button:hover {
|
116 |
+
background-color: oklch(0.35 0 0);
|
117 |
+
}
|
118 |
+
.dark .header-button svg { opacity: 0.8; stroke: oklch(0.85 0 0); }
|
119 |
+
|
120 |
|
121 |
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
|
122 |
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
|
|
|
131 |
.footer-controls.layout-default { justify-content: space-between; }
|
132 |
.footer-controls.layout-with-small-logo { justify-content: space-around; }
|
133 |
|
134 |
+
.control-button {
|
135 |
+
height: 80px; width: 80px; border-radius: 9999px;
|
136 |
+
padding: 0; display: flex; align-items: center; justify-content: center;
|
137 |
+
border-width: 1px;
|
138 |
+
border-color: var(--border); /* Use themed border */
|
139 |
+
box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
|
140 |
+
cursor: pointer;
|
141 |
+
transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
|
142 |
+
}
|
143 |
+
.control-button:hover {
|
144 |
+
transform: scale(1.05);
|
145 |
+
box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
|
146 |
}
|
147 |
+
.cam-button-color { background-color: #E0ECFF; } /* Now left */
|
148 |
+
.mic-button-color { background-color: #fecdd3; } /* Now right */
|
149 |
+
.dark .cam-button-color { background-color: #223355; } /* Darker blue */
|
150 |
+
.dark .mic-button-color { background-color: #5C2129; } /* Darker red */
|
151 |
+
|
152 |
+
|
153 |
+
/* Switch Camera Button Styles */
|
154 |
+
.switch-camera-button-container {
|
155 |
position: absolute;
|
156 |
+
bottom: calc(100% + 0.75rem); /* 12px above the cam button */
|
157 |
left: 50%;
|
158 |
+
/* transform: translateX(-50%); Will be handled by inner button for animation orgin */
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
z-index: 5;
|
|
|
160 |
opacity: 0;
|
161 |
+
transform: translateY(15px) scale(0.7); /* Start from below and scaled down */
|
162 |
pointer-events: none;
|
163 |
+
transition: opacity 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55), transform 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
|
164 |
}
|
165 |
+
.switch-camera-button-container.visible {
|
166 |
opacity: 1;
|
167 |
+
transform: translateY(0) scale(1);
|
168 |
pointer-events: auto;
|
169 |
}
|
170 |
+
.switch-camera-button-content {
|
171 |
+
width: 52px;
|
172 |
+
height: 52px;
|
173 |
+
background-color: var(--background);
|
174 |
+
border: 1px solid var(--border);
|
175 |
+
border-radius: 9999px;
|
176 |
+
display: flex;
|
177 |
+
align-items: center;
|
178 |
+
justify-content: center;
|
179 |
+
box-shadow: 0 6px 12px rgba(0,0,0,0.15), 0 3px 5px rgba(0,0,0,0.1);
|
180 |
cursor: pointer;
|
181 |
+
transform-origin: center; /* For hover animation */
|
182 |
+
transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
|
183 |
+
}
|
184 |
+
.switch-camera-button-content:hover {
|
185 |
+
transform: scale(1.15) rotate(-5deg); /* Slight scale and rotate on hover */
|
186 |
+
box-shadow: 0 8px 18px rgba(0,0,0,0.2), 0 4px 7px rgba(0,0,0,0.15);
|
187 |
+
}
|
188 |
+
.switch-camera-button-content:active {
|
189 |
+
transform: scale(1.05) rotate(0deg); /* Press down effect */
|
190 |
+
}
|
191 |
+
.switch-camera-button-content svg {
|
192 |
+
width: 26px;
|
193 |
+
height: 26px;
|
194 |
+
stroke: var(--foreground);
|
195 |
+
transition: transform 0.3s ease-in-out;
|
196 |
+
}
|
197 |
+
.switch-camera-button-content:hover svg {
|
198 |
+
transform: rotate(360deg); /* Spin icon on hover */
|
199 |
}
|
|
|
|
|
200 |
|
201 |
</style>
|
202 |
<script>
|
|
|
204 |
darkMode: 'class',
|
205 |
theme: {
|
206 |
extend: {
|
207 |
+
colors: { /* ... (same as before) ... */ },
|
208 |
+
borderRadius: { /* ... (same as before) ... */ },
|
209 |
+
inset: { /* ... (same as before) ... */ },
|
210 |
keyframes: {
|
211 |
'popover-drop-in': {
|
212 |
+
'0%': { opacity: '0', transform: 'translateY(-100%) scale(0.9)' },
|
213 |
+
'70%': { opacity: '1', transform: 'translateY(5px) scale(1.02)' }, /* Slight overshoot */
|
214 |
'100%': { opacity: '1', transform: 'translateY(0) scale(1)' },
|
215 |
},
|
216 |
'popover-lift-out': {
|
217 |
'0%': { opacity: '1', transform: 'translateY(0) scale(1)' },
|
218 |
+
'100%': { opacity: '0', transform: 'translateY(-100%) scale(0.9)' },
|
219 |
}
|
220 |
},
|
221 |
animation: {
|
|
|
227 |
}
|
228 |
</script>
|
229 |
</head>
|
230 |
+
<body class="antialiased"> <!-- Removed bg-slate-50, using CSS vars now -->
|
231 |
|
232 |
<div class="w-full flex flex-col items-center justify-center min-h-[90dvh] md:min-h-screen">
|
233 |
<div class="max-w-3xl w-full flex flex-col items-center justify-center h-full relative">
|
234 |
+
<!-- Header - Button order reversed -->
|
235 |
<div class="header-controls">
|
236 |
+
<!-- Notification Button (Now on the Left) -->
|
237 |
+
<div id="notification-trigger-container" class="notification-trigger-container">
|
238 |
<button id="notification-button" aria-label="Notifications" class="header-button">
|
239 |
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
|
240 |
</button>
|
241 |
</div>
|
242 |
+
<!-- Back Button (Now on the Right) -->
|
243 |
+
<div class="back-button-container">
|
244 |
<div class="header-button" onclick="alert('Back clicked')">
|
245 |
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"></path></svg>
|
246 |
</div>
|
247 |
</div>
|
248 |
</div>
|
249 |
|
250 |
+
<!-- Notification Popover Wrapper (Centered at the top) -->
|
251 |
<div id="notification-popover-wrapper" class="notification-popover-wrapper">
|
252 |
+
<div id="notification-popover" class="popover-content">
|
253 |
<div class="notification-popover-text-content">
|
254 |
مدلهای هوش مصنوعی میتوانند اشتباه کنند، صحت اطلاعات مهم را بررسی کنید و از وارد کردن اطلاعات حساس بپرهیزید.
|
255 |
</div>
|
256 |
</div>
|
257 |
</div>
|
258 |
|
259 |
+
<!-- MediaToggle Area -->
|
260 |
+
<div class="w-full flex flex-col items-center justify-center h-[90dvh] bg-background top-0 left-0 relative">
|
261 |
<video id="video-feed" autoplay playsinline class="absolute top-0 left-0 w-full h-full object-cover scale-x-[-1] hidden"></video>
|
262 |
<div id="large-logo-container" class="hidden"></div>
|
263 |
|
264 |
+
<!-- Footer Controls - Order Changed -->
|
265 |
<div id="footer-controls" class="footer-controls layout-default">
|
266 |
+
<!-- Cam Button Wrapper (Now on the Left) -->
|
267 |
+
<div id="cam-button-wrapper" class="relative flex justify-center"> <!-- Added flex justify-center for switch button alignment -->
|
268 |
+
<div id="cam-button" class="control-button cam-button-color">
|
269 |
+
<!-- Cam icon will be injected here by JS -->
|
270 |
+
</div>
|
271 |
+
<div id="switch-camera-button-container" class="switch-camera-button-container">
|
272 |
+
<button id="switch-camera-button" aria-label="Switch Camera" class="switch-camera-button-content">
|
273 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
274 |
+
<path d="M21.5 2v6h-6"></path>
|
275 |
+
<path d="M2.5 22V16h6"></path>
|
276 |
+
<path d="M22 11.5A10 10 0 0 0 3.5 12.5"></path>
|
277 |
+
<path d="M2 12.5a10 10 0 0 0 18.5-1"></path>
|
278 |
+
</svg>
|
279 |
+
</button>
|
280 |
</div>
|
|
|
281 |
</div>
|
282 |
|
283 |
<div id="small-logo-container" class="hidden"></div>
|
284 |
|
285 |
+
<!-- Mic Button (Now on the Right) -->
|
286 |
+
<div id="mic-button" class="control-button mic-button-color">
|
287 |
+
<!-- Mic icon will be injected here by JS -->
|
288 |
+
</div>
|
289 |
</div>
|
290 |
</div>
|
291 |
</div>
|
292 |
</div>
|
293 |
|
294 |
+
<!-- SVG Icon Definitions (same as previous) -->
|
295 |
<div style="display: none;">
|
296 |
+
<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>
|
297 |
+
<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>
|
298 |
+
<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>
|
299 |
+
<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>
|
300 |
+
<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>
|
301 |
</div>
|
302 |
|
303 |
<script>
|
304 |
const videoFeed = document.getElementById('video-feed');
|
305 |
const largeLogoContainer = document.getElementById('large-logo-container');
|
306 |
const smallLogoContainer = document.getElementById('small-logo-container');
|
307 |
+
const micButton = document.getElementById('mic-button');
|
308 |
+
const camButton = document.getElementById('cam-button');
|
|
|
309 |
const footerControls = document.getElementById('footer-controls');
|
310 |
+
const notificationButton = document.getElementById('notification-button');
|
311 |
const notificationPopover = document.getElementById('notification-popover');
|
312 |
+
const switchCameraButtonContainer = document.getElementById('switch-camera-button-container');
|
313 |
+
const switchCameraButton = document.getElementById('switch-camera-button');
|
314 |
|
315 |
const pauseIconSVG = document.getElementById('svg-pauseIcon').cloneNode(true);
|
316 |
const microphoneIconSVG = document.getElementById('svg-microphoneIcon').cloneNode(true);
|
|
|
321 |
let isCamActive = false;
|
322 |
let isNotificationOpen = false;
|
323 |
|
324 |
+
function createLogoHTML(isMini, isHumanActive, isAiActive) {
|
325 |
+
if (!isHumanActive && !isAiActive) return '';
|
326 |
+
const size = isMini ? 80 : 200;
|
327 |
+
const iconSize = isMini ? 35 : 70;
|
328 |
+
const insetBase = isMini ? { ping: 10, outer: 0, mid: 5, inner: 12, icon: 22 }
|
329 |
+
: { ping: 40, outer: 0, mid: 20, inner: 50, icon: 65 };
|
330 |
+
const bgColorBase = isHumanActive ? 'blue' : (isAiActive ? 'green' : 'gray');
|
331 |
+
const iconNode = isHumanActive ? document.getElementById('svg-humanIcon') : (isAiActive ? document.getElementById('svg-humanIcon') /* Placeholder */ : null);
|
332 |
+
if (!iconNode) return '';
|
333 |
+
const iconSVG = iconNode.cloneNode(true);
|
334 |
+
iconSVG.setAttribute('width', iconSize);
|
335 |
+
iconSVG.setAttribute('height', iconSize);
|
336 |
+
|
337 |
+
return `
|
338 |
+
<div class="hidden bg-green-200 bg-green-300 bg-green-400 bg-blue-200 bg-blue-300 bg-blue-400"></div>
|
339 |
+
<div class="relative" style="width: ${size}px; height: ${size}px;">
|
340 |
+
<div class="absolute rounded-full opacity-50 animate-ping bg-${bgColorBase}-200" style="inset: ${insetBase.ping}px;"></div>
|
341 |
+
<div class="absolute inset-0 rounded-full opacity-50 bg-${bgColorBase}-200"></div>
|
342 |
+
<div class="absolute rounded-full opacity-50 bg-${bgColorBase}-300" style="inset: ${insetBase.mid}px;"></div>
|
343 |
+
<div class="absolute inset-[50px] rounded-full opacity-50 bg-${bgColorBase}-400" style="inset: ${insetBase.inner}px;"></div>
|
344 |
+
<div class="z-10 absolute" style="inset: ${insetBase.icon}px;">
|
345 |
+
${iconSVG.outerHTML}
|
346 |
+
</div>
|
347 |
+
</div>`;
|
348 |
+
}
|
349 |
|
350 |
function updateUI() {
|
351 |
videoFeed.classList.toggle('hidden', !isCamActive);
|
352 |
+
if (!isCamActive && isMicActive) {
|
353 |
+
largeLogoContainer.innerHTML = createLogoHTML(false, true, false);
|
354 |
+
largeLogoContainer.classList.remove('hidden');
|
355 |
+
largeLogoContainer.classList.add('flex');
|
356 |
+
} else {
|
357 |
+
largeLogoContainer.innerHTML = '';
|
358 |
+
largeLogoContainer.classList.add('hidden');
|
359 |
+
largeLogoContainer.classList.remove('flex');
|
360 |
+
}
|
|
|
361 |
|
362 |
+
if (isCamActive) {
|
363 |
+
smallLogoContainer.innerHTML = createLogoHTML(true, true, false);
|
364 |
+
smallLogoContainer.classList.remove('hidden');
|
365 |
+
smallLogoContainer.classList.add('flex');
|
366 |
+
footerControls.classList.remove('layout-default');
|
367 |
+
footerControls.classList.add('layout-with-small-logo');
|
368 |
+
switchCameraButtonContainer.classList.add('visible');
|
369 |
+
} else {
|
370 |
+
smallLogoContainer.innerHTML = '';
|
371 |
+
smallLogoContainer.classList.add('hidden');
|
372 |
+
smallLogoContainer.classList.remove('flex');
|
373 |
+
footerControls.classList.remove('layout-with-small-logo');
|
374 |
+
footerControls.classList.add('layout-default');
|
375 |
+
switchCameraButtonContainer.classList.remove('visible');
|
376 |
+
}
|
377 |
|
378 |
+
// Footer buttons icons (Order is now Cam on left, Mic on Right)
|
379 |
camButton.innerHTML = '';
|
380 |
camButton.appendChild(isCamActive ? stopCamIconSVG.cloneNode(true) : cameraIconSVG.cloneNode(true));
|
381 |
+
|
382 |
micButton.innerHTML = '';
|
383 |
micButton.appendChild(isMicActive ? pauseIconSVG.cloneNode(true) : microphoneIconSVG.cloneNode(true));
|
384 |
|
385 |
+
// Notification Popover Animation
|
386 |
if (isNotificationOpen) {
|
387 |
+
notificationPopover.classList.remove('animate-popover-close-top-center');
|
388 |
+
notificationPopover.classList.add('open');
|
389 |
+
notificationPopover.classList.add('animate-popover-open-top-center');
|
|
|
|
|
390 |
} else {
|
391 |
if (notificationPopover.classList.contains('open')) {
|
392 |
notificationPopover.classList.remove('animate-popover-open-top-center');
|
393 |
notificationPopover.classList.add('animate-popover-close-top-center');
|
394 |
setTimeout(() => {
|
395 |
+
if (!isNotificationOpen) { // Check state again before removing
|
396 |
notificationPopover.classList.remove('open');
|
|
|
397 |
}
|
398 |
}, 300); // Match close animation duration (0.3s)
|
399 |
} else {
|
400 |
+
// Ensure it's properly hidden if it was never open or animation was interrupted
|
401 |
+
notificationPopover.classList.remove('open');
|
402 |
+
notificationPopover.classList.remove('animate-popover-open-top-center');
|
403 |
+
notificationPopover.classList.remove('animate-popover-close-top-center');
|
404 |
}
|
405 |
}
|
406 |
}
|
|
|
412 |
});
|
413 |
|
414 |
document.addEventListener('click', (event) => {
|
415 |
+
const popoverWrapper = document.getElementById('notification-popover-wrapper');
|
416 |
+
if (isNotificationOpen && !popoverWrapper.contains(event.target) && !notificationButton.contains(event.target)) {
|
417 |
isNotificationOpen = false;
|
418 |
updateUI();
|
419 |
}
|
|
|
421 |
|
422 |
camButton.addEventListener('click', () => { isCamActive = !isCamActive; updateUI(); });
|
423 |
micButton.addEventListener('click', () => { isMicActive = !isMicActive; updateUI(); });
|
424 |
+
|
425 |
+
switchCameraButton.addEventListener('click', () => {
|
426 |
+
alert('دکمه تعویض دوربین کلیک شد!');
|
427 |
+
// Future: Implement actual camera switching logic
|
428 |
});
|
429 |
|
430 |
+
// Initial UI setup
|
|
|
|
|
|
|
|
|
431 |
updateUI();
|
432 |
+
|
433 |
+
// Dark mode toggle for testing (optional)
|
434 |
+
// document.documentElement.classList.add('dark'); // Uncomment to test dark mode
|
435 |
</script>
|
436 |
</body>
|
437 |
</html>
|