Skip to content

Commit d1efac9

Browse files
committed
Make demo more consistent, showcase install better
1 parent 70dfc6f commit d1efac9

10 files changed

Lines changed: 40 additions & 30 deletions

File tree

i18n/da-DK.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"search.placeholder": "Søg på nettet...",
66
"demo.weather.location": "Pladsholder",
77
"demo.weather.condition": "Solholder",
8+
"demo.install.title": "Installer udvidelse",
89
"demo.install": "Føj til {browser}",
910
"time.format.default": "%H:%M:%S",
1011
"time.format.default_12h": "%I:%M:%S %p",

i18n/en-GB.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"search.placeholder": "Search the web...",
88
"demo.weather.location": "Placeholder",
99
"demo.weather.condition": "Sunholder",
10+
"demo.install.title": "Install extension",
1011
"demo.install": "Add to {browser}",
1112
"time.format.default": "%H:%M:%S",
1213
"time.format.default_12h": "%I:%M:%S %p",

i18n/es-ES.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"search.placeholder": "Buscar en la web...",
88
"demo.weather.location": "Marcador de posición",
99
"demo.weather.condition": "Marcador de sol",
10+
"demo.install.title": "Instalar extensión",
1011
"demo.install": "Añadir a {browser}",
1112
"time.format.default": "%H:%M:%S",
1213
"time.format.default_12h": "%I:%M:%S %p",

i18n/fr-FR.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"search.placeholder": "Rechercher sur le web...",
66
"demo.weather.location": "Emplacement",
77
"demo.weather.condition": "Sunholder",
8+
"demo.install.title": "Installer l'extension",
89
"demo.install": "Ajouter à {browser}",
910
"time.format.default": "%H:%M:%S",
1011
"time.format.default_12h": "%I:%M:%S %p",

i18n/no-NB.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"search.placeholder": "Søk på nettet...",
88
"demo.weather.location": "Plassholder",
99
"demo.weather.condition": "Solholder",
10+
"demo.install.title": "Installer utvidelse",
1011
"demo.install": "Legg til i {browser}",
1112
"time.format.default": "%H:%M:%S",
1213
"time.format.default_12h": "%I:%M:%S %p",

i18n/pt-PT.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"search.placeholder": "Pesquisar na web...",
66
"demo.weather.location": "Localização",
77
"demo.weather.condition": "Sunholder",
8+
"demo.install.title": "Instalar extensão",
89
"demo.install": "Adicionar ao {browser}",
910
"time.format.default": "%H:%M:%S",
1011
"time.format.default_12h": "%I:%M:%S %p",

i18n/sv-SE.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"search.placeholder": "Sök på webben...",
66
"demo.weather.location": "Platshållare",
77
"demo.weather.condition": "Solhållare",
8+
"demo.install.title": "Installera tillägg",
89
"demo.install": "Lägg till i {browser}",
910
"time.format.default": "%H:%M:%S",
1011
"time.format.default_12h": "%I:%M:%S %p",

src/index.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,12 @@ <h2 class="section-title" data-translate="settings.nav.category.features"></h2>
226226
<!-- Demo Panel Toggle -->
227227
<button id="demo-panel-toggle" style="display: none;" aria-label="Demo settings"></button>
228228

229-
<!-- Demo: Install button -->
230-
<a id="install-button" target="_blank" style="display: none;">
231-
PLACEHOLDER
232-
</a>
229+
<!-- Demo: Install box -->
230+
<section id="install-box" style="display: none;">
231+
<span id="install-box-title"></span>
232+
<a id="install-button-chrome" target="_blank" href="https://chromewebstore.google.com/detail/npagigfpfilcemncemkphndcaigegcbk">PLACEHOLDER</a>
233+
<a id="install-button-firefox" target="_blank" href="https://addons.mozilla.org/addon/alexflipnote-homepage/">PLACEHOLDER</a>
234+
</section>
233235

234236
<!-- Scripts -->
235237
<script src="js/index.js"></script>

src/js/index.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -758,19 +758,10 @@ if (isExtension) {
758758

759759
// Add a nice install button
760760
function downloadButton(language=undefined) {
761-
let browser = "Chrome"
762-
let link = "https://chromewebstore.google.com/detail/npagigfpfilcemncemkphndcaigegcbk"
763-
764-
if (isFirefox) {
765-
browser = "Firefox"
766-
link = "https://addons.mozilla.org/addon/alexflipnote-homepage/"
767-
}
768-
769-
const addbutton = document.getElementById("install-button")
770-
addbutton.style.display = "block"
771-
addbutton.innerText = translate(language, "demo.install", {browser: browser})
772-
addbutton.href = link
773-
if (link === "#") addbutton.onclick = () => { return false }
761+
document.getElementById("install-box").style.display = "flex"
762+
document.getElementById("install-box-title").innerText = translate(language, "demo.install.title")
763+
document.getElementById("install-button-chrome").innerText = translate(language, "demo.install", {browser: "Chrome/Edge"})
764+
document.getElementById("install-button-firefox").innerText = translate(language, "demo.install", {browser: "Firefox"})
774765
}
775766

776767
downloadButton()

src/scss/components/demo.scss

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $gear-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' vi
4343
.demo-panel-close {
4444
background: transparent;
4545
border-radius: .5rem;
46-
color: var(--font-secondary);
46+
color: rgba(255, 255, 255, .75);
4747
cursor: pointer;
4848
font-size: 1.25rem;
4949
line-height: 1;
@@ -55,7 +55,7 @@ $gear-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' vi
5555

5656
&:hover {
5757
background-color: rgba(255, 255, 255, .08);
58-
color: var(--font-primary);
58+
color: #fff;
5959
}
6060
}
6161

@@ -117,22 +117,32 @@ $gear-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' vi
117117
&.panel-open { opacity: 0; pointer-events: none; }
118118
}
119119

120-
#install-button {
120+
#install-box {
121121
backdrop-filter: var(--blur-amount-ui);
122122
background-color: var(--blur-background);
123-
border-radius: .5rem;
123+
border-radius: 1rem;
124124
bottom: 1.5rem;
125-
color: var(--font-primary);
126-
cursor: pointer;
125+
color: #fff;
126+
flex-direction: column;
127+
gap: .35rem;
127128
left: 1.5rem;
128-
padding: .5rem 1rem;
129+
padding: .6rem 1.2rem;
129130
position: fixed;
130-
text-decoration: none;
131-
transition: background-color .3s ease, transform .3s ease, color .3s ease, box-shadow .3s ease;
132131

133-
&:hover {
134-
background-color: rgba(#2ecc71, .8);
135-
box-shadow: var(--box-shadow);
136-
transform: translateY(-.25rem);
132+
#install-box-title {
133+
font-size: .7rem;
134+
font-weight: bold;
135+
letter-spacing: .1em;
136+
opacity: .5;
137+
text-transform: uppercase;
138+
}
139+
140+
a {
141+
color: #fff;
142+
font-size: .9rem;
143+
text-decoration: none;
144+
transition: color .2s ease;
145+
146+
&:hover { color: rgba(#2ecc71, 1); }
137147
}
138148
}

0 commit comments

Comments
 (0)