Skip to content

Commit 65ea3a1

Browse files
author
hoang.duong
committed
feat: support switch to iphone frame
1 parent 32b1082 commit 65ea3a1

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

preview/index.html

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
justify-content: flex-start;
4747
min-width: 220px;
4848
min-height: 430px;
49+
transition: border-radius 0.4s ease-in-out, border-color 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
4950
}
5051

5152
.phone-notch {
@@ -60,6 +61,29 @@
6061
transform: translateX(-50%);
6162
z-index: 10;
6263
border: 1px solid #222;
64+
cursor: pointer;
65+
/* Indicates it's clickable */
66+
/* Added transition for smooth switching */
67+
transition: all 0.4s ease-in-out;
68+
}
69+
70+
.phone-frame.is-iphone {
71+
border-radius: 48px;
72+
/* More rounded corners for iPhone */
73+
border-color: #38383a;
74+
/* iPhone's Pro dark gray titanium color */
75+
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 1px 0 #666 inset;
76+
}
77+
78+
.phone-frame.is-iphone .phone-notch {
79+
/* Transforms the notch into the Dynamic Island */
80+
width: 110px;
81+
height: 28px;
82+
border-radius: 20px;
83+
/* Pill shape */
84+
top: 14px;
85+
background: #000;
86+
border: none;
6387
}
6488

6589
.preview-bg {
@@ -186,11 +210,21 @@
186210
border-radius: 16px;
187211
}
188212

213+
.phone-frame.is-iphone {
214+
border-radius: 42px;
215+
}
216+
189217
.phone-notch {
190218
width: 14px;
191219
height: 14px;
192220
top: 8px;
193221
}
222+
223+
.phone-frame.is-iphone .phone-notch {
224+
width: 90px;
225+
height: 24px;
226+
top: 13px;
227+
}
194228
}
195229

196230
@media (max-width: 767.98px) {
@@ -277,7 +311,7 @@ <h3 class="mb-4">Cài đặt màn hình trường</h3>
277311
<!-- Right: Preview -->
278312
<div class="col-lg-7 col-md-6 d-flex align-items-center justify-content-center bg-light py-5 col-preview">
279313
<div class="phone-frame" id="phoneFrame">
280-
<div class="phone-notch"></div>
314+
<div class="phone-notch" id="phoneClickableNotch"></div>
281315
<img id="previewBg" class="preview-bg" style="display:none;">
282316
<div id="previewBgColor" class="preview-bg" style="z-index:1;"></div>
283317
<div class="preview-overlay">
@@ -415,6 +449,9 @@ <h3 class="mb-4">Cài đặt màn hình trường</h3>
415449
updateIconImage(iconImage.files[0]);
416450
updateLink();
417451
});
452+
phoneClickableNotch.addEventListener('click', function () {
453+
phoneFrame.classList.toggle('is-iphone');
454+
});
418455

419456
// Initial state
420457
updateSchoolName();

0 commit comments

Comments
 (0)