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

44 lines
1.2 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-14 18:35:32 -04:00
if (!$.browser.mobile) {
if (!page.classList.contains('itemDetailPage')) {
Backdrops.setBackdropUrl(page, 'themes/halloween/bg.jpg');
}
2015-10-14 13:52:49 -04:00
2015-10-14 18:35:32 -04:00
if (lastSound == 0) {
2015-10-16 14:55:35 -04:00
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/monsterparadefade.mp3', .1);
2015-10-14 18:35:32 -04:00
} else if ((new Date().getTime() - lastSound) > 30000) {
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/howl.wav');
}
2015-10-14 13:52:49 -04:00
}
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
})();