Skip to content

Commit ecab7fd

Browse files
committed
Made the landing page elements disappear if unused by Kalitsune
dscalzi#350
1 parent 6f919f4 commit ecab7fd

File tree

3 files changed

+79
-63
lines changed

3 files changed

+79
-63
lines changed

app/assets/js/scripts/landing.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,10 @@ async function loadNews(){
959959
const distroData = await DistroAPI.getDistribution()
960960
if(!distroData.rawDistribution.rss) {
961961
loggerLanding.debug('No RSS feed provided.')
962+
963+
// remove the news button
964+
await $('#newsButton').fadeOut(250).promise()
965+
962966
return null
963967
}
964968

app/assets/lang/_custom.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ title = "PokéHorizon Launcher"
55

66
[ejs.landing]
77
mediaGitHubURL = "https://github.com/dscalzi/HeliosLauncher"
8-
mediaXURL = "#"
9-
mediaInstagramURL = "#"
10-
mediaYouTubeURL = "#"
8+
mediaXURL = ""
9+
mediaInstagramURL = ""
10+
mediaYouTubeURL = ""
1111
mediaDiscordURL = "https://discord.gg/zNWUXdt"
1212

1313
[ejs.settings]

app/landing.ejs

Lines changed: 72 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -27,66 +27,78 @@
2727
</button>
2828
</div>
2929
</div>
30-
<div class="mediaDivider"></div>
31-
<div id="externalMedia">
32-
<div class="mediaContainer">
33-
<a href="<%- lang('landing.mediaGitHubURL') %>" class="mediaURL" id="linkURL">
34-
<svg id="linkSVG" class="mediaSVG" viewBox="35.34 34.3575 70.68 68.71500">
35-
<g>
36-
<path d="M75.37,65.51a3.85,3.85,0,0,0-1.73.42,8.22,8.22,0,0,1,.94,3.76A8.36,8.36,0,0,1,66.23,78H46.37a8.35,8.35,0,1,1,0-16.7h9.18a21.51,21.51,0,0,1,6.65-8.72H46.37a17.07,17.07,0,1,0,0,34.15H66.23A17,17,0,0,0,82.77,65.51Z"/>
37-
<path d="M66,73.88a3.85,3.85,0,0,0,1.73-.42,8.22,8.22,0,0,1-.94-3.76,8.36,8.36,0,0,1,8.35-8.35H95A8.35,8.35,0,1,1,95,78H85.8a21.51,21.51,0,0,1-6.65,8.72H95a17.07,17.07,0,0,0,0-34.15H75.13A17,17,0,0,0,58.59,73.88Z"/>
38-
</g>
39-
</svg>
40-
</a>
41-
</div>
42-
<div class="mediaContainer">
43-
<a href="<%- lang('landing.mediaXURL') %>" class="mediaURL" id="xURL">
44-
<svg id="xSVG" class="mediaSVG" viewBox="0 0 275 275">
45-
<g>
46-
<path d="m236 0h46l-101 115 118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123-113-148h94.9l65.5 86.6zm-16.1 244h25.5l-165-218h-27.4z"/>
47-
</g>
48-
</svg>
49-
</a>
50-
</div>
51-
<div class="mediaContainer">
52-
<a href="<%- lang('landing.mediaInstagramURL') %>" class="mediaURL" id="instagramURL">
53-
<svg id="instagramSVG" class="mediaSVG" viewBox="0 0 5040 5040">
54-
<defs>
55-
<radialGradient id="instaFill" cx="30%" cy="107%" r="150%">
56-
<stop offset="0%" stop-color="#fdf497"/>
57-
<stop offset="5%" stop-color="#fdf497"/>
58-
<stop offset="45%" stop-color="#fd5949"/>
59-
<stop offset="60%" stop-color="#d6249f"/>
60-
<stop offset="90%" stop-color="#285AEB"/>
61-
</radialGradient>
62-
</defs>
63-
<g>
64-
<path d="M1390 5024 c-163 -9 -239 -19 -315 -38 -281 -70 -477 -177 -660 -361 -184 -184 -292 -380 -361 -660 -43 -171 -53 -456 -53 -1445 0 -989 10 -1274 53 -1445 69 -280 177 -476 361 -660 184 -184 380 -292 660 -361 171 -43 456 -53 1445 -53 989 0 1274 10 1445 53 280 69 476 177 660 361 184 184 292 380 361 660 43 171 53 456 53 1445 0 989 -10 1274 -53 1445 -69 280 -177 476 -361 660 -184 184 -380 292 -660 361 -174 44 -454 53 -1470 52 -599 0 -960 -5 -1105 -14z m2230 -473 c58 -6 141 -18 185 -27 397 -78 638 -318 719 -714 37 -183 41 -309 41 -1290 0 -981 -4 -1107 -41 -1290 -81 -395 -319 -633 -714 -714 -183 -37 -309 -41 -1290 -41 -981 0 -1107 4 -1290 41 -397 81 -636 322 -714 719 -33 166 -38 296 -43 1100 -5 796 3 1203 27 1380 67 489 338 758 830 825 47 7 162 15 255 20 250 12 1907 4 2035 -9z"/>
65-
<path d="M2355 3819 c-307 -42 -561 -172 -780 -400 -244 -253 -359 -543 -359 -899 0 -361 116 -648 367 -907 262 -269 563 -397 937 -397 374 0 675 128 937 397 251 259 367 546 367 907 0 361 -116 648 -367 907 -197 203 -422 326 -690 378 -101 20 -317 27 -412 14z m400 -509 c275 -88 470 -284 557 -560 20 -65 23 -95 23 -230 0 -135 -3 -165 -23 -230 -88 -278 -284 -474 -562 -562 -65 -20 -95 -23 -230 -23 -135 0 -165 3 -230 23 -278 88 -474 284 -562 562 -20 65 -23 95 -23 230 0 135 3 165 23 230 73 230 219 403 427 507 134 67 212 83 390 79 111 -3 155 -8 210 -26z"/>
66-
<path d="M3750 1473 c-29 -11 -66 -38 -106 -77 -70 -71 -94 -126 -94 -221 0 -95 24 -150 94 -221 72 -71 126 -94 225 -94 168 0 311 143 311 311 0 99 -23 154 -94 225 -43 42 -76 66 -110 77 -61 21 -166 21 -226 0z"/>
67-
</g>
68-
</svg>
69-
</a>
30+
<% if (lang('landing.mediaGitHubURL') + lang('landing.mediaXURL') + lang('landing.mediaInstagramURL') + lang('landing.mediaYouTubeURL') + lang('landing.mediaDiscordURL') !== "") { %>
31+
<div class="mediaDivider"></div>
32+
<div id="externalMedia">
33+
<% if (lang('landing.mediaGitHubURL') !== "") { %>
34+
<div class="mediaContainer">
35+
<a href="<%- lang('landing.mediaGitHubURL') %>" class="mediaURL" id="linkURL">
36+
<svg id="linkSVG" class="mediaSVG" viewBox="35.34 34.3575 70.68 68.71500">
37+
<g>
38+
<path d="M75.37,65.51a3.85,3.85,0,0,0-1.73.42,8.22,8.22,0,0,1,.94,3.76A8.36,8.36,0,0,1,66.23,78H46.37a8.35,8.35,0,1,1,0-16.7h9.18a21.51,21.51,0,0,1,6.65-8.72H46.37a17.07,17.07,0,1,0,0,34.15H66.23A17,17,0,0,0,82.77,65.51Z"/>
39+
<path d="M66,73.88a3.85,3.85,0,0,0,1.73-.42,8.22,8.22,0,0,1-.94-3.76,8.36,8.36,0,0,1,8.35-8.35H95A8.35,8.35,0,1,1,95,78H85.8a21.51,21.51,0,0,1-6.65,8.72H95a17.07,17.07,0,0,0,0-34.15H75.13A17,17,0,0,0,58.59,73.88Z"/>
40+
</g>
41+
</svg>
42+
</a>
43+
</div>
44+
<% } %>
45+
<% if (lang('landing.mediaXURL') !== "") { %>
46+
<div class="mediaContainer">
47+
<a href="<%- lang('landing.mediaXURL') %>" class="mediaURL" id="xURL">
48+
<svg id="xSVG" class="mediaSVG" viewBox="0 0 275 275" preserveAspectRatio="xMidYMid meet">
49+
<g>
50+
<path d="m236 0h46l-101 115 118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123-113-148h94.9l65.5 86.6zm-16.1 244h25.5l-165-218h-27.4z"/>
51+
</g>
52+
</svg>
53+
</a>
54+
</div>
55+
<% } %>
56+
<% if (lang('landing.mediaInstagramURL') !== "") { %>
57+
<div class="mediaContainer">
58+
<a href="<%- lang('landing.mediaInstagramURL') %>" class="mediaURL" id="instagramURL">
59+
<svg id="instagramSVG" class="mediaSVG" viewBox="0 0 5040 5040">
60+
<defs>
61+
<radialGradient id="instaFill" cx="30%" cy="107%" r="150%">
62+
<stop offset="0%" stop-color="#fdf497"/>
63+
<stop offset="5%" stop-color="#fdf497"/>
64+
<stop offset="45%" stop-color="#fd5949"/>
65+
<stop offset="60%" stop-color="#d6249f"/>
66+
<stop offset="90%" stop-color="#285AEB"/>
67+
</radialGradient>
68+
</defs>
69+
<g>
70+
<path d="M1390 5024 c-163 -9 -239 -19 -315 -38 -281 -70 -477 -177 -660 -361 -184 -184 -292 -380 -361 -660 -43 -171 -53 -456 -53 -1445 0 -989 10 -1274 53 -1445 69 -280 177 -476 361 -660 184 -184 380 -292 660 -361 171 -43 456 -53 1445 -53 989 0 1274 10 1445 53 280 69 476 177 660 361 184 184 292 380 361 660 43 171 53 456 53 1445 0 989 -10 1274 -53 1445 -69 280 -177 476 -361 660 -184 184 -380 292 -660 361 -174 44 -454 53 -1470 52 -599 0 -960 -5 -1105 -14z m2230 -473 c58 -6 141 -18 185 -27 397 -78 638 -318 719 -714 37 -183 41 -309 41 -1290 0 -981 -4 -1107 -41 -1290 -81 -395 -319 -633 -714 -714 -183 -37 -309 -41 -1290 -41 -981 0 -1107 4 -1290 41 -397 81 -636 322 -714 719 -33 166 -38 296 -43 1100 -5 796 3 1203 27 1380 67 489 338 758 830 825 47 7 162 15 255 20 250 12 1907 4 2035 -9z"/>
71+
<path d="M2355 3819 c-307 -42 -561 -172 -780 -400 -244 -253 -359 -543 -359 -899 0 -361 116 -648 367 -907 262 -269 563 -397 937 -397 374 0 675 128 937 397 251 259 367 546 367 907 0 361 -116 648 -367 907 -197 203 -422 326 -690 378 -101 20 -317 27 -412 14z m400 -509 c275 -88 470 -284 557 -560 20 -65 23 -95 23 -230 0 -135 -3 -165 -23 -230 -88 -278 -284 -474 -562 -562 -65 -20 -95 -23 -230 -23 -135 0 -165 3 -230 23 -278 88 -474 284 -562 562 -20 65 -23 95 -23 230 0 135 3 165 23 230 73 230 219 403 427 507 134 67 212 83 390 79 111 -3 155 -8 210 -26z"/>
72+
<path d="M3750 1473 c-29 -11 -66 -38 -106 -77 -70 -71 -94 -126 -94 -221 0 -95 24 -150 94 -221 72 -71 126 -94 225 -94 168 0 311 143 311 311 0 99 -23 154 -94 225 -43 42 -76 66 -110 77 -61 21 -166 21 -226 0z"/>
73+
</g>
74+
</svg>
75+
</a>
76+
</div>
77+
<% } %>
78+
<% if (lang('landing.mediaYouTubeURL') !== "") { %>
79+
<div class="mediaContainer">
80+
<a href="<%- lang('landing.mediaYouTubeURL') %>" class="mediaURL" id="youtubeURL">
81+
<svg id="youtubeSVG" class="mediaSVG" viewBox="35.34 34.3575 70.68 68.71500">
82+
<g>
83+
<path d="M84.8,69.52,65.88,79.76V59.27Zm23.65.59c0-5.14-.79-17.63-3.94-20.57S99,45.86,73.37,45.86s-28,.73-31.14,3.68S38.29,65,38.29,70.11s.79,17.63,3.94,20.57,5.52,3.68,31.14,3.68,28-.74,31.14-3.68,3.94-15.42,3.94-20.57"/>
84+
</g>
85+
</svg>
86+
</a>
87+
</div>
88+
<% } %>
89+
<% if (lang('landing.mediaDiscordURL') !== "") { %>
90+
<div class="mediaContainer">
91+
<a href="<%- lang('landing.mediaDiscordURL') %>" class="mediaURL" id="discordURL">
92+
<svg id="discordSVG" class="mediaSVG" viewBox="35.34 34.3575 70.68 68.71500">
93+
<g>
94+
<path d="M81.23,78.48a6.14,6.14,0,1,1,6.14-6.14,6.14,6.14,0,0,1-6.14,6.14M60,78.48a6.14,6.14,0,1,1,6.14-6.14A6.14,6.14,0,0,1,60,78.48M104.41,73c-.92-7.7-8.24-22.9-8.24-22.9A43,43,0,0,0,88,45.59a17.88,17.88,0,0,0-8.38-1.27l-.13,1.06a23.52,23.52,0,0,1,5.8,1.95,87.59,87.59,0,0,1,8.17,4.87s-10.32-5.63-22.27-5.63a51.32,51.32,0,0,0-23.2,5.63,87.84,87.84,0,0,1,8.17-4.87,23.57,23.57,0,0,1,5.8-1.95l-.13-1.06a17.88,17.88,0,0,0-8.38,1.27,42.84,42.84,0,0,0-8.21,4.56S37.87,65.35,37,73s-.37,11.54-.37,11.54,4.22,5.68,9.9,7.14,7.7,1.47,7.7,1.47l3.75-4.68a21.22,21.22,0,0,1-4.65-2A24.47,24.47,0,0,1,47.93,82S61.16,88.4,70.68,88.4c10,0,22.75-6.44,22.75-6.44a24.56,24.56,0,0,1-5.35,4.56,21.22,21.22,0,0,1-4.65,2l3.75,4.68s2,0,7.7-1.47,9.89-7.14,9.89-7.14.55-3.85-.37-11.54"/>
95+
</g>
96+
</svg>
97+
</a>
98+
</div>
99+
<% } %>
70100
</div>
71-
<div class="mediaContainer">
72-
<a href="<%- lang('landing.mediaYouTubeURL') %>" class="mediaURL" id="youtubeURL">
73-
<svg id="youtubeSVG" class="mediaSVG" viewBox="35.34 34.3575 70.68 68.71500">
74-
<g>
75-
<path d="M84.8,69.52,65.88,79.76V59.27Zm23.65.59c0-5.14-.79-17.63-3.94-20.57S99,45.86,73.37,45.86s-28,.73-31.14,3.68S38.29,65,38.29,70.11s.79,17.63,3.94,20.57,5.52,3.68,31.14,3.68,28-.74,31.14-3.68,3.94-15.42,3.94-20.57"/>
76-
</g>
77-
</svg>
78-
</a>
79-
</div>
80-
<div class="mediaContainer">
81-
<a href="<%- lang('landing.mediaDiscordURL') %>" class="mediaURL" id="discordURL">
82-
<svg id="discordSVG" class="mediaSVG" viewBox="35.34 34.3575 70.68 68.71500">
83-
<g>
84-
<path d="M81.23,78.48a6.14,6.14,0,1,1,6.14-6.14,6.14,6.14,0,0,1-6.14,6.14M60,78.48a6.14,6.14,0,1,1,6.14-6.14A6.14,6.14,0,0,1,60,78.48M104.41,73c-.92-7.7-8.24-22.9-8.24-22.9A43,43,0,0,0,88,45.59a17.88,17.88,0,0,0-8.38-1.27l-.13,1.06a23.52,23.52,0,0,1,5.8,1.95,87.59,87.59,0,0,1,8.17,4.87s-10.32-5.63-22.27-5.63a51.32,51.32,0,0,0-23.2,5.63,87.84,87.84,0,0,1,8.17-4.87,23.57,23.57,0,0,1,5.8-1.95l-.13-1.06a17.88,17.88,0,0,0-8.38,1.27,42.84,42.84,0,0,0-8.21,4.56S37.87,65.35,37,73s-.37,11.54-.37,11.54,4.22,5.68,9.9,7.14,7.7,1.47,7.7,1.47l3.75-4.68a21.22,21.22,0,0,1-4.65-2A24.47,24.47,0,0,1,47.93,82S61.16,88.4,70.68,88.4c10,0,22.75-6.44,22.75-6.44a24.56,24.56,0,0,1-5.35,4.56,21.22,21.22,0,0,1-4.65,2l3.75,4.68s2,0,7.7-1.47,9.89-7.14,9.89-7.14.55-3.85-.37-11.54"/>
85-
</g>
86-
</svg>
87-
</a>
88-
</div>
89-
</div>
101+
<% } %>
90102
</div>
91103
</div>
92104
</div>
@@ -217,4 +229,4 @@
217229
</div>
218230
</div>
219231
<script src="./assets/js/scripts/landing.js"></script>
220-
</div>
232+
</div>

0 commit comments

Comments
 (0)