Skip to content

Commit 50d948f

Browse files
committed
update
1 parent 42d0a0a commit 50d948f

2 files changed

Lines changed: 52 additions & 63 deletions

File tree

js/site.js

Lines changed: 9 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,68 @@
11
// Showreel slider
2-
32
(function() {
4-
53
const container = document.getElementById('showreel');
6-
74
if (!container) return;
85

9-
106
const slides = Array.from(container.querySelectorAll('.slide'));
11-
127
if (slides.length === 0) return;
138

14-
159
let currentIndex = 0;
1610

17-
18-
// إظهار أول شريحة فوراً
19-
11+
// إظهار أول شريحة فوراً
2012
slides[0].classList.add('active');
2113

22-
23-
// تشغيل أول فيديو لو موجود
24-
14+
// تشغيل أول فيديو لو موجود
2515
const firstVideo = slides[0].querySelector('video');
26-
2716
if (firstVideo) {
28-
2917
firstVideo.play().catch(() => {});
30-
3118
}
3219

33-
3420
function showSlide(index) {
35-
3621
slides.forEach((s, i) => {
37-
3822
s.classList.toggle('active', i === index);
39-
4023
const video = s.querySelector('video');
4124

42-
4325
if (video) {
44-
4526
if (i === index) {
46-
47-
// تشغيل الفيديو للشريحة النشطة فقط
48-
27+
// تشغيل الفيديو للشريحة النشطة فقط
4928
video.currentTime = 0;
50-
5129
video.play().catch(() => {});
52-
5330
} else {
54-
55-
// إيقاف الفيديوهات في الشرائح المخفية لتوفير الأداء
56-
31+
// إيقاف الفيديوهات في الشرائح المخفية لتوفير الأداء
5732
video.pause();
58-
5933
}
60-
6134
}
62-
6335
});
64-
6536
}
6637

67-
6838
function nextSlide() {
69-
7039
currentIndex = (currentIndex + 1) % slides.length;
71-
7240
showSlide(currentIndex);
73-
7441
}
7542

76-
77-
// تغيير الشريحة كل 5 ثواني
78-
43+
// تغيير الشريحة كل 5 ثواني
7944
setInterval(nextSlide, 5000);
80-
8145
})();
8246

83-
8447
// Facade Pattern for Vimeo videos
85-
8648
document.addEventListener("DOMContentLoaded", function () {
87-
8849
const videoWrappers = document.querySelectorAll(".video-wrapper");
8950

90-
9151
videoWrappers.forEach((wrapper) => {
92-
9352
const playButton = wrapper.querySelector(".facade-play-btn");
94-
9553
const iframe = wrapper.querySelector("iframe");
9654

97-
9855
if (playButton) {
99-
10056
playButton.addEventListener("click", function () {
101-
102-
playButton.style.display = "none"; // إخفاء الزر
57+
playButton.style.display = "none"; // Hide the play button
58+
wrapper.classList.add("is-playing"); // Add the playing class for visual effects
10359

10460
if (iframe) {
105-
106-
iframe.src = iframe.dataset.src; // تعيين src للإطار
107-
61+
iframe.src = iframe.dataset.src; // Set the iframe source
10862
}
10963

11064
wrapper.style.cursor = "default";
111-
11265
});
113-
11466
}
115-
11667
});
117-
118-
})
68+
});

projects/short-film-projects.njk

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ title: Short Film Projects
1212
<h3 class="w3-text-light-grey" style="margin:18px 0 8px;">{{ p.data.title }}</h3>
1313

1414
{% if p.data.vimeoId %}
15-
<div class="video-wrapper" style="aspect-ratio: 16 / 9; width: 100%; background-image: url('https://vumbnail.com/{{ p.data.vimeoId }}.jpg'); background-size: cover; background-position: center; cursor: pointer; position: relative;">
15+
<div class="video-wrapper" style="background-image: url('https://vumbnail.com/{{ p.data.vimeoId }}.jpg');">
1616

17-
<!-- زر التشغيل بالتصميم الزجاجي الجديد -->
17+
<!-- زر التشغيل بالتصميم الزجاجي والموجة الزجزاجية -->
1818
<button class="facade-play-btn" type="button" aria-label="Play video">
1919
<svg viewBox="0 0 24 24" width="30" height="30" aria-hidden="true">
2020
<path d="M8 5.2v13.6L19 12z" fill="currentColor"/>
@@ -44,7 +44,29 @@ title: Short Film Projects
4444
</div>
4545

4646
<style>
47-
/* التصميم الزجاجي والموجة الزجزاجية (Glassmorphism & Zigzag Wave) */
47+
/* Video Wrapper Styling with Curved Edges & Isolation */
48+
.video-wrapper {
49+
position: relative;
50+
width: 100%;
51+
aspect-ratio: 16 / 9;
52+
background-size: cover;
53+
background-position: center;
54+
cursor: pointer;
55+
border-radius: 16px;
56+
overflow: hidden;
57+
isolation: isolate;
58+
}
59+
60+
.video-wrapper iframe {
61+
position: absolute;
62+
top: 0;
63+
left: 0;
64+
width: 100%;
65+
height: 100%;
66+
border: 0;
67+
}
68+
69+
/* Glassmorphism Play Button */
4870
.facade-play-btn {
4971
position: absolute;
5072
top: 50%;
@@ -71,7 +93,7 @@ title: Short Film Projects
7193
transform: translate(-50%, -50%) scale(1.08);
7294
}
7395
74-
/* تأثير الموجة الكلاسيكية خلف الزر */
96+
/* Classic Zigzag Wave Animation */
7597
.facade-play-btn::before {
7698
content: '';
7799
position: absolute;
@@ -105,4 +127,21 @@ title: Short Film Projects
105127
.facade-play-btn svg {
106128
fill: currentColor;
107129
}
130+
131+
/* Cinematic Ambient Glow & Poster Removal on Play */
132+
.video-wrapper.is-playing {
133+
background-image: none !important;
134+
}
135+
136+
.video-wrapper.is-playing::before {
137+
content: '';
138+
position: absolute;
139+
inset: -10px;
140+
background: radial-gradient(closest-side, oklch(1 0 0 / 0.2), transparent);
141+
filter: blur(25px);
142+
z-index: -1;
143+
opacity: 0.6;
144+
pointer-events: none;
145+
transition: opacity 0.3s ease;
146+
}
108147
</style>

0 commit comments

Comments
 (0)