Skip to content

Commit e5b7595

Browse files
committed
Update utils.js
1 parent d102a85 commit e5b7595

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

utils.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,22 @@ dialogCancel.addEventListener('click', () => {
215215
// hide dialog
216216
dialogWrapper.classList.remove('visible');
217217

218+
// if on mobile,
219+
// change status bar color
220+
if (isMobile) {
221+
222+
if (body.classList.contains('expanded')) {
223+
224+
document.querySelector('meta[name="theme-color"]').content = '#1a1c24';
225+
226+
} else {
227+
228+
document.querySelector('meta[name="theme-color"]').content = '#313744';
229+
230+
}
231+
232+
}
233+
218234
});
219235

220236
// add background click listener
@@ -223,6 +239,22 @@ dialogBackground.addEventListener('click', () => {
223239
// hide dialog
224240
dialogWrapper.classList.remove('visible');
225241

242+
// if on mobile,
243+
// change status bar color
244+
if (isMobile) {
245+
246+
if (body.classList.contains('expanded')) {
247+
248+
document.querySelector('meta[name="theme-color"]').content = '#1a1c24';
249+
250+
} else {
251+
252+
document.querySelector('meta[name="theme-color"]').content = '#313744';
253+
254+
}
255+
256+
}
257+
226258
});
227259

228260

0 commit comments

Comments
 (0)