Spaces:
Running
Running
Update index.html
Browse files- index.html +25 -1
index.html
CHANGED
@@ -110,10 +110,11 @@
|
|
110 |
top: 1%;
|
111 |
right: 1%;
|
112 |
z-index: 15;
|
113 |
-
opacity: 0
|
114 |
width: 12%;
|
115 |
pointer-events: none;
|
116 |
transition: opacity 0.3s ease;
|
|
|
117 |
}
|
118 |
.watermark img {
|
119 |
width: 100%;
|
@@ -219,12 +220,35 @@
|
|
219 |
const sliderPosition = Math.max(0, Math.min(offsetX, rect.width));
|
220 |
slider.style.left = `${sliderPosition}px`;
|
221 |
video2.style.clipPath = `inset(0 ${rect.width - sliderPosition}px 0 0)`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
}
|
223 |
|
224 |
function updateClipPath() {
|
225 |
const rect = container.getBoundingClientRect();
|
226 |
const sliderPosition = parseFloat(window.getComputedStyle(slider).left);
|
227 |
video2.style.clipPath = `inset(0 ${rect.width - sliderPosition}px 0 0)`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
requestAnimationFrame(updateClipPath);
|
229 |
}
|
230 |
|
|
|
110 |
top: 1%;
|
111 |
right: 1%;
|
112 |
z-index: 15;
|
113 |
+
opacity: 0;
|
114 |
width: 12%;
|
115 |
pointer-events: none;
|
116 |
transition: opacity 0.3s ease;
|
117 |
+
clip-path: inset(0 0 0 0);
|
118 |
}
|
119 |
.watermark img {
|
120 |
width: 100%;
|
|
|
220 |
const sliderPosition = Math.max(0, Math.min(offsetX, rect.width));
|
221 |
slider.style.left = `${sliderPosition}px`;
|
222 |
video2.style.clipPath = `inset(0 ${rect.width - sliderPosition}px 0 0)`;
|
223 |
+
|
224 |
+
// Update watermark visibility - show when video1 area is visible
|
225 |
+
const watermark = document.querySelector('.watermark');
|
226 |
+
const watermarkRect = watermark.getBoundingClientRect();
|
227 |
+
const watermarkLeft = watermarkRect.left - container.getBoundingClientRect().left;
|
228 |
+
|
229 |
+
if (sliderPosition > watermarkLeft) {
|
230 |
+
watermark.style.opacity = '0';
|
231 |
+
} else {
|
232 |
+
watermark.style.opacity = '0.9';
|
233 |
+
}
|
234 |
}
|
235 |
|
236 |
function updateClipPath() {
|
237 |
const rect = container.getBoundingClientRect();
|
238 |
const sliderPosition = parseFloat(window.getComputedStyle(slider).left);
|
239 |
video2.style.clipPath = `inset(0 ${rect.width - sliderPosition}px 0 0)`;
|
240 |
+
|
241 |
+
// Update watermark visibility during animation
|
242 |
+
const watermark = document.querySelector('.watermark');
|
243 |
+
const watermarkRect = watermark.getBoundingClientRect();
|
244 |
+
const watermarkLeft = watermarkRect.left - rect.left;
|
245 |
+
|
246 |
+
if (sliderPosition > watermarkLeft) {
|
247 |
+
watermark.style.opacity = '0';
|
248 |
+
} else {
|
249 |
+
watermark.style.opacity = '0.9';
|
250 |
+
}
|
251 |
+
|
252 |
requestAnimationFrame(updateClipPath);
|
253 |
}
|
254 |
|