Skip to content

Commit bd262a8

Browse files
committed
add a fade-in fade-out logo
1 parent 2346464 commit bd262a8

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

client/html/index.tmpl

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@
3636
opacity: .04;
3737
}
3838

39+
#landing-logo {
40+
position: fixed;
41+
top: 0;
42+
left: 0;
43+
width: 100%;
44+
height: 100%;
45+
pointer-events: none;
46+
background: url("resources/images/logo-1.svg") no-repeat center;
47+
z-index: 9;
48+
opacity: .01;
49+
}
50+
3951
.brandLink {
4052
text-decoration: none;
4153
color: inherit;
@@ -45,6 +57,7 @@
4557
</head>
4658
<body>
4759
<div id="watermark-valoper"></div>
60+
<div id="landing-logo" class="d-none"></div>
4861
<div id="main" class="container my-3">
4962
<h3>{[{ .description }]}</h3>
5063
{[{ if .logo }]}
@@ -213,5 +226,32 @@ s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/{[{ .gener
213226
{[{ end }]}
214227
</footer>
215228
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
229+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
230+
<script type="text/javascript">
231+
let opacity = 1;
232+
let inc = true;
233+
$(document).ready(function() {
234+
const landingLogo = $('#landing-logo');
235+
if (landingLogo) {
236+
landingLogo.removeClass('d-none');
237+
const intervalLogo = setInterval(() => {
238+
if (inc) {
239+
opacity += 1;
240+
if (opacity >= 100) {
241+
inc = false;
242+
}
243+
} else {
244+
opacity -= 2;
245+
if (opacity < 4) {
246+
landingLogo.remove();
247+
clearInterval(intervalLogo);
248+
return
249+
}
250+
}
251+
landingLogo.css('opacity', opacity/100);
252+
}, 10);
253+
}
254+
})
255+
</script>
216256
</body>
217257
</html>

client/statik/statik.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)