Compare commits

...

2 commits

2 changed files with 9 additions and 21 deletions

View file

@ -46,20 +46,12 @@ const Umi = { UI: {} };
lo.setMessage('Loading environment...'); lo.setMessage('Loading environment...');
try { try {
window.futami = await FutamiCommon.load(); window.futami = await FutamiCommon.load();
localStorage.setItem('mami:common', JSON.stringify(window.futami));
} catch(ex) { } catch(ex) {
try { console.error(ex);
const cached = JSON.parse(localStorage.getItem('mami:common')); lo.setIcon('cross');
if(cached === null) lo.setHeader('Failed!');
throw 'Cached data is null.'; lo.setMessage('Failed to load common settings!');
window.futami = new FutamiCommon(cached); return;
} catch(ex) {
console.error(ex);
lo.setIcon('cross');
lo.setHeader('Failed!');
lo.setMessage('Failed to load common settings!');
return;
}
} }

View file

@ -1,4 +1,5 @@
#include animate.js #include animate.js
#include rng.js
const MamiYouAreAnIdiot = function() { const MamiYouAreAnIdiot = function() {
const html = <div class="youare"> const html = <div class="youare">
@ -15,19 +16,14 @@ const MamiYouAreAnIdiot = function() {
</div> </div>
</div>; </div>;
const rng = new MamiRNG;
let soundSrc; let soundSrc;
const pub = { const pub = {
getElement: () => html, getElement: () => html,
onViewPush: async () => { onViewPush: async () => {
const soundMgr = mami.getSound();
if(soundMgr === undefined || soundMgr === null)
return;
try { try {
const sources = mami.getSoundLibrary().getSources('misc:youare'); soundSrc = await mami.getSoundLibrary().loadSource('misc:youare');
soundSrc = soundMgr.loadSource(sources);
soundSrc.setMuted(true); soundSrc.setMuted(true);
soundSrc.setLoop(true, 0.21, 5); soundSrc.setLoop(true, 0.21, 5);
soundSrc.play(); soundSrc.play();
@ -50,7 +46,7 @@ const MamiYouAreAnIdiot = function() {
}, },
pushOn: async views => views.push(pub, ctx => MamiAnimate({ pushOn: async views => views.push(pub, ctx => MamiAnimate({
async: true, async: true,
duration: 1500, duration: rng.next(1500, 15001),
easing: 'outBounce', easing: 'outBounce',
start: () => ctx.toElem.style.top = '-100%', start: () => ctx.toElem.style.top = '-100%',
update: t => ctx.toElem.style.top = `${-100 + (t * 100)}%`, update: t => ctx.toElem.style.top = `${-100 + (t * 100)}%`,