1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/themes/halloween/theme.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

2015-10-13 02:31:20 -04:00
(function () {
Dashboard.importCss('themes/halloween/style.css');
2015-10-14 13:52:49 -04:00
var lastSound = 0;
2015-10-13 02:31:20 -04:00
function onPageShow() {
var page = this;
2015-10-13 22:41:46 -04:00
if (!$.browser.mobile && !page.classList.contains('itemDetailPage')) {
2015-10-13 02:31:20 -04:00
Backdrops.setBackdropUrl(page, 'themes/halloween/bg.jpg');
}
2015-10-14 13:52:49 -04:00
if (lastSound == 0) {
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/monsterparade.mp3', .2);
} else if ((new Date().getTime() - lastSound) > 30000) {
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/howl.wav');
}
2015-10-13 02:31:20 -04:00
}
pageClassOn('pageshow', "libraryPage", onPageShow);
if ($($.mobile.activePage)[0].classList.contains('libraryPage')) {
onPageShow.call($($.mobile.activePage)[0]);
}
2015-10-14 13:52:49 -04:00
function playSound(path, volume) {
require(['howler'], function (howler) {
var sound = new Howl({
urls: [path],
volume: volume || .3
});
sound.play();
lastSound = new Date().getTime();
});
}
2015-10-13 02:31:20 -04:00
})();