X-Git-Url: https://git.yukkurigames.com/?p=labelle.git;a=blobdiff_plain;f=acnl-outfit.js;fp=acnl-outfit.js;h=45849d12f6b92e4d812222a347bba1b3c7ff868a;hp=d9ef316eb6c98968adf9564564d768ce3b6247bd;hb=e78f6565e498059d215d56841afc1b1cd835d7fd;hpb=ccc9d9507d8cbf500755771f54e93df71693bae4 diff --git a/acnl-outfit.js b/acnl-outfit.js index d9ef316..45849d1 100644 --- a/acnl-outfit.js +++ b/acnl-outfit.js @@ -124,6 +124,15 @@ function litanize (names, link) { return names.join(names.length == 2 ? " " : ", "); } +function updateTime () { + var date = new Date(); + document.documentElement.className = "month" + date.getMonth() + document.body.className = "hour" + date.getHours(); + if (window.navigator.standalone) + document.body.className += " standalone"; +} +setInterval(updateTime, 20 * 60 * 1000); + function update () { var o = outfit(); var wearing = document.getElementById('wearing'); @@ -142,6 +151,21 @@ function update () { setTimeout(function () { buttons.className = "open"; }, 300); - - + updateTime(); } + +window.addEventListener("DOMContentLoaded", update); + +window.addEventListener('load', function () { + if (typeof FastClick !== "undefined") + FastClick.attach(document.body, { tapDelay: 50 }); + + if (applicationCache && applicationCache.status) { + applicationCache.update(); + applicationCache.addEventListener('updateready', function () { + if (applicationCache.status === applicationCache.UPDATEREADY) { + applicationCache.swapCache(); + } + }); + } +});