Experimenting with service workers

This commit is contained in:
Pieter Vander Vennet 2022-05-13 01:20:08 +02:00
parent acd1cdb7c1
commit e5908cf49b
8 changed files with 141 additions and 19 deletions

29
test.ts
View file

@ -1,19 +1,14 @@
import {SelectOneNearbyImage} from "./UI/Popup/NearbyImages";
import Minimap from "./UI/Base/Minimap";
import MinimapImplementation from "./UI/Base/MinimapImplementation";
import {VariableUiElement} from "./UI/Base/VariableUIElement";
import Loc from "./Models/Loc";
import {UIEventSource} from "./Logic/UIEventSource";
import {FixedUiElement} from "./UI/Base/FixedUiElement";
import Img from "./UI/Base/Img";
import { Utils } from "./Utils";
MinimapImplementation.initialize()
const map = Minimap.createMiniMap({
location: new UIEventSource<Loc>({
lon: 3.22457,
lat: 51.20876,
zoom: 18
new FixedUiElement("Hi").AttachTo("maindiv")
window.setTimeout(() => {
new FixedUiElement("Loading...").AttachTo("maindiv")
// new Img("http://4.bp.blogspot.com/-_vTDmo_fSTw/T3YTV0AfGiI/AAAAAAAAAX4/Zjh2HaoU5Zo/s1600/beautiful%2Bkitten.jpg").AttachTo("maindiv")
Utils.download("http://127.0.0.1:1234/somedata").then(data => {
console.log("Got ", data)
return new FixedUiElement(data).AttachTo("extradiv");
})
})
map.AttachTo("extradiv")
map.SetStyle("height: 500px")
new VariableUiElement(map.location.map( loc => new SelectOneNearbyImage( {...loc, radius: 50}))).AttachTo("maindiv")
}, 1000)