Skip to content

Commit

Permalink
Implement web install in pwa store app (#41)
Browse files Browse the repository at this point in the history
* Implement web install in pwa store app

* Remove extra whitespace
  • Loading branch information
amandabaker authored Sep 30, 2024
1 parent cf883d1 commit 68e1e6c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
19 changes: 19 additions & 0 deletions pwa-pwastore/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// All of the UI DOM elements we need.
const pwinterBtn = document.getElementById("installPwinter");
const pwampBtn = document.getElementById("installPwamp");
const bubbleBtn = document.getElementById("installBubble");

pwinterBtn.addEventListener("click", () => {
navigator.install("https://diek.us/pwinter/index.html?randomize=true",
"https://diek.us/pwinter/")
});

pwampBtn.addEventListener("click", () => {
navigator.install("https://microsoftedge.github.io/Demos/pwamp/",
"https://microsoftedge.github.io/Demos/pwamp/")
});

bubbleBtn.addEventListener("click", () => {
navigator.install("https://diek.us/bubble/index.html",
"https://diek.us/bubble/")
});
13 changes: 7 additions & 6 deletions pwa-pwastore/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="stylesheet" href="styles/pwastore-light.css" media="(prefers-color-scheme: light)"/>
<meta name="theme-color" content="#FFF5E0" media="(prefers-color-scheme: light)"/>
<meta name="theme-color" content="#3D3D3D" media="(prefers-color-scheme: dark)"/>

</head>
<body>
<div class="draggable"></div>
Expand All @@ -31,36 +31,37 @@
<img src="images/app-icons/pwinter.png" width="75" height="75" class="app_icon">
<h2>The PWinter</h2>
<p class="app_descrip">Custom PWA icon generator.</p>
<button class="btn_install">Install</button>
<button id="installPwinter" class="btn_install">Install</button>
</article>

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

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

</main>
<footer>
&copy; Microsoft Edge
</footer>

<template>
<article class="app_entry">
<img src="" width="75" height="75" class="app_icon">
<h2>Title</h2>
<p class="app_descrip">Equirectangular picture viewer.</p>
<button class="btn_install">Install</button>
</article>
</article>
</template>

<script type="module" src="app.js"></script>
</body>
</html>

0 comments on commit 68e1e6c

Please sign in to comment.