Skip to content

Commit ec3e1a8

Browse files
Tidied up default install alert
1 parent 3cdd855 commit ec3e1a8

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

Blazor.PWA.MSBuild.Tasks/Templates/ServiceWorker/sw_register.template.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,34 @@ function showAddToHomeScreen() {
4141

4242
pwaInstallPrompt.id = 'pwa-install-prompt';
4343
pwaInstallPrompt.style.position = 'absolute';
44-
pwaInstallPrompt.style.bottom = '0';
44+
pwaInstallPrompt.style.bottom = '1rem';
45+
pwaInstallPrompt.style.left = '1rem';
46+
pwaInstallPrompt.style.right = '1rem';
47+
pwaInstallPrompt.style.padding = '0.3rem';
4548
pwaInstallPrompt.style.display = 'flex';
46-
pwaInstallPrompt.style.width = '100vw';
47-
pwaInstallPrompt.style.backgroundColor='darkslategrey';
48-
pwaInstallPrompt.style.color='white';
49-
pwaInstallPrompt.style.fontSize='2rem';
49+
pwaInstallPrompt.style.backgroundColor = 'lightslategray';
50+
pwaInstallPrompt.style.color = 'white';
51+
pwaInstallPrompt.style.fontFamily = 'sans-serif';
52+
pwaInstallPrompt.style.fontSize = '1.2rem';
53+
pwaInstallPrompt.style.borderRadius = '4px';
5054

51-
pwaInstallButton.style.marginLeft='auto';
52-
pwaInstallButton.style.width='4em';
53-
pwaInstallButton.style.backgroundColor='green';
54-
pwaInstallButton.style.color='white';
55+
pwaInstallButton.style.marginLeft = 'auto';
56+
pwaInstallButton.style.width = '4em';
57+
pwaInstallButton.style.backgroundColor = '#00796B';
58+
pwaInstallButton.style.color = 'white';
59+
pwaInstallButton.style.border = 'none';
60+
pwaInstallButton.style.borderRadius = '25px';
5561

56-
pwaCancelButton.style.marginLeft='0.3rem';
57-
pwaCancelButton.style.backgroundColor='darkslategray';
58-
pwaCancelButton.style.color='white';
62+
pwaCancelButton.style.marginLeft = '0.3rem';
63+
pwaCancelButton.style.width = '4em';
64+
pwaCancelButton.style.backgroundColor = '#9d0d0d';
65+
pwaCancelButton.style.color = 'white';
66+
pwaCancelButton.style.border = 'none';
67+
pwaCancelButton.style.borderRadius = '25px';
5968

60-
pwaInstallPrompt.innerText = 'Add to your homescreen!';
61-
pwaInstallButton.innerText = 'OK';
62-
pwaCancelButton.innerText = 'Ignore';
69+
pwaInstallPrompt.innerText = 'Add to your homescreen?';
70+
pwaInstallButton.innerText = 'ok';
71+
pwaCancelButton.innerText = 'no';
6372

6473
pwaInstallPrompt.appendChild(pwaInstallButton);
6574
pwaInstallPrompt.appendChild(pwaCancelButton);

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
- Added new **Property** **`ServiceWorkerUpdateAlertText`** - used to change the default text in the "Update available alert".
44
- Added new **Property** **`ServiceWorkerRegisterUpdateNotificationTemplate`** - The name of the template file for the "update available" event.
55
- Moved the "Updated available alert" to it's own template so we can have alternates
6-
6+
- Tidied up default install alert
7+
78
#### 08/08/2019 Initial Release

0 commit comments

Comments
 (0)