Compare commits
2 commits
a862eca354
...
bc6532cfc5
Author | SHA1 | Date | |
---|---|---|---|
bc6532cfc5 | |||
00ddabe46a |
2 changed files with 9 additions and 21 deletions
|
@ -46,13 +46,6 @@ const Umi = { UI: {} };
|
|||
lo.setMessage('Loading environment...');
|
||||
try {
|
||||
window.futami = await FutamiCommon.load();
|
||||
localStorage.setItem('mami:common', JSON.stringify(window.futami));
|
||||
} catch(ex) {
|
||||
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');
|
||||
|
@ -60,7 +53,6 @@ const Umi = { UI: {} };
|
|||
lo.setMessage('Failed to load common settings!');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lo.setMessage('Fetching credentials...');
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include animate.js
|
||||
#include rng.js
|
||||
|
||||
const MamiYouAreAnIdiot = function() {
|
||||
const html = <div class="youare">
|
||||
|
@ -15,19 +16,14 @@ 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 {
|
||||
const sources = mami.getSoundLibrary().getSources('misc:youare');
|
||||
|
||||
soundSrc = soundMgr.loadSource(sources);
|
||||
soundSrc = await mami.getSoundLibrary().loadSource('misc:youare');
|
||||
soundSrc.setMuted(true);
|
||||
soundSrc.setLoop(true, 0.21, 5);
|
||||
soundSrc.play();
|
||||
|
@ -50,7 +46,7 @@ const MamiYouAreAnIdiot = function() {
|
|||
},
|
||||
pushOn: async views => views.push(pub, ctx => MamiAnimate({
|
||||
async: true,
|
||||
duration: 1500,
|
||||
duration: rng.next(1500, 15001),
|
||||
easing: 'outBounce',
|
||||
start: () => ctx.toElem.style.top = '-100%',
|
||||
update: t => ctx.toElem.style.top = `${-100 + (t * 100)}%`,
|
||||
|
|
Loading…
Reference in a new issue