Compare commits

..

No commits in common. "bc6532cfc5f0e32bf856d49c67774ab634fd764b" and "a862eca354d8bede490ef2fab018205681b503a5" have entirely different histories.

2 changed files with 21 additions and 9 deletions

View file

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

View file

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