From def0581d6d99fd2d5310dc12e017568ce25cfcab Mon Sep 17 00:00:00 2001 From: guava Date: Sun, 29 Jan 2017 23:27:40 +0100 Subject: [PATCH] update keks loading screen example --- resources/[test]/keks/__resource.lua | 4 ++ resources/[test]/keks/index.html | 70 +++++++++++++++++++++------- resources/[test]/keks/keks.css | 6 ++- 3 files changed, 62 insertions(+), 18 deletions(-) diff --git a/resources/[test]/keks/__resource.lua b/resources/[test]/keks/__resource.lua index 759f67b..4a87fbe 100644 --- a/resources/[test]/keks/__resource.lua +++ b/resources/[test]/keks/__resource.lua @@ -4,3 +4,7 @@ files { 'bankgothic.ttf', 'loadscreen.jpg' } + +loadscreen 'index.html' + +resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5' \ No newline at end of file diff --git a/resources/[test]/keks/index.html b/resources/[test]/keks/index.html index 1a667ac..2ffba40 100644 --- a/resources/[test]/keks/index.html +++ b/resources/[test]/keks/index.html @@ -6,13 +6,14 @@

Free Mode

-

Algonquin

+

Not Algonquin

Intel

+

-

The Statue of Happiness has a heart. Have one too!

+

The Statue of Happiness has no heart. You do.

@@ -20,22 +21,57 @@
- +const handlers = { + startInitFunctionOrder(data) + { + count = data.count; + + document.querySelector('.letni h3').innerHTML += emoji[data.type][data.order - 1] || ''; + }, + + initFunctionInvoking(data) + { + document.querySelector('.thingy').style.left = '0%'; + document.querySelector('.thingy').style.width = ((data.idx / count) * 100) + '%'; + }, + + startDataFileEntries(data) + { + count = data.count; + + document.querySelector('.letni h3').innerHTML += "\u{1f358}"; + }, + + performMapLoadFunction(data) + { + ++thisCount; + + document.querySelector('.thingy').style.left = '0%'; + document.querySelector('.thingy').style.width = ((thisCount / count) * 100) + '%'; + }, + + onLogLine(data) + { + document.querySelector('.letni p').innerHTML = data.message + "..!"; + } +}; + +window.addEventListener('message', function(e) +{ + (handlers[e.data.eventName] || function() {})(e.data); +}); + diff --git a/resources/[test]/keks/keks.css b/resources/[test]/keks/keks.css index 286e27e..0026bc9 100644 --- a/resources/[test]/keks/keks.css +++ b/resources/[test]/keks/keks.css @@ -80,7 +80,7 @@ h1:before, h2:before { margin-top: 0px; } -.letni h2 +.letni h2, .letni h3 { font-family: BankGothic; @@ -89,6 +89,8 @@ h1:before, h2:before { font-size: 50px; margin: 0px; + + display: inline-block; } .top @@ -134,6 +136,8 @@ h1:before, h2:before { overflow: hidden; position: relative; + + display: block; } .thingy