Skip to content

Commit 68e1e6c

Browse files
authored
Implement web install in pwa store app (#41)
* Implement web install in pwa store app * Remove extra whitespace
1 parent cf883d1 commit 68e1e6c

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

pwa-pwastore/app.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// All of the UI DOM elements we need.
2+
const pwinterBtn = document.getElementById("installPwinter");
3+
const pwampBtn = document.getElementById("installPwamp");
4+
const bubbleBtn = document.getElementById("installBubble");
5+
6+
pwinterBtn.addEventListener("click", () => {
7+
navigator.install("https://diek.us/pwinter/index.html?randomize=true",
8+
"https://diek.us/pwinter/")
9+
});
10+
11+
pwampBtn.addEventListener("click", () => {
12+
navigator.install("https://microsoftedge.github.io/Demos/pwamp/",
13+
"https://microsoftedge.github.io/Demos/pwamp/")
14+
});
15+
16+
bubbleBtn.addEventListener("click", () => {
17+
navigator.install("https://diek.us/bubble/index.html",
18+
"https://diek.us/bubble/")
19+
});

pwa-pwastore/index.html

+7-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="stylesheet" href="styles/pwastore-light.css" media="(prefers-color-scheme: light)"/>
1414
<meta name="theme-color" content="#FFF5E0" media="(prefers-color-scheme: light)"/>
1515
<meta name="theme-color" content="#3D3D3D" media="(prefers-color-scheme: dark)"/>
16-
16+
1717
</head>
1818
<body>
1919
<div class="draggable"></div>
@@ -31,36 +31,37 @@
3131
<img src="images/app-icons/pwinter.png" width="75" height="75" class="app_icon">
3232
<h2>The PWinter</h2>
3333
<p class="app_descrip">Custom PWA icon generator.</p>
34-
<button class="btn_install">Install</button>
34+
<button id="installPwinter" class="btn_install">Install</button>
3535
</article>
3636

3737
<article class="app_entry">
3838
<img src="images/app-icons/pwamp.png" width="75" height="75" class="app_icon">
3939
<h2>PWAmp</h2>
4040
<p class="app_descrip">Music player, but make it progressive.</p>
41-
<button class="btn_install">Install</button>
41+
<button id="installPwamp" class="btn_install">Install</button>
4242
</article>
4343

4444
<article class="app_entry">
4545
<img src="images/app-icons/bubble.png" width="75" height="75" class="app_icon">
4646
<h2>Bubble</h2>
4747
<p class="app_descrip">Equirectangular picture viewer.</p>
48-
<button class="btn_install">Install</button>
48+
<button id="installBubble" class="btn_install">Install</button>
4949
</article>
5050

5151
</main>
5252
<footer>
5353
&copy; Microsoft Edge
5454
</footer>
55-
55+
5656
<template>
5757
<article class="app_entry">
5858
<img src="" width="75" height="75" class="app_icon">
5959
<h2>Title</h2>
6060
<p class="app_descrip">Equirectangular picture viewer.</p>
6161
<button class="btn_install">Install</button>
62-
</article>
62+
</article>
6363
</template>
6464

65+
<script type="module" src="app.js"></script>
6566
</body>
6667
</html>

0 commit comments

Comments
 (0)