Skip to content

Commit

Permalink
Make footer stick to bottom of window
Browse files Browse the repository at this point in the history
Using this method:
https://css-tricks.com/a-clever-sticky-footer-technique/

Also:

* Add v-cloak to avoid flashing unrendered template
* Move scripts to top with defer attr to improve performance
  • Loading branch information
Dan Hersam committed Nov 18, 2021
1 parent 7e21734 commit d5daba5
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
<title>TOTP Generator</title>
<link rel="stylesheet" href="css/bulma-0.9.0.min.css">
<style>
[v-cloak] {
display: none;
}

html, body {
height: 100%;
}

body > footer {
position: sticky;
top: 100vh;
}

@media screen and (min-width: 1068px) {
.container {
max-width: 600px;
Expand All @@ -16,7 +29,12 @@
</head>
<body>

<section id="app" class="section">
<script defer src="js/vue-2.4.0.min.js"></script>
<script defer src="js/otpauth-3.1.3.min.js"></script>
<script defer src="js/clipboard-2.0.6.min.js"></script>
<script defer src="js/app.js?v=1.0"></script>

<section id="app" class="section" v-cloak>

<div class="container">

Expand Down Expand Up @@ -77,10 +95,5 @@ <h1 class="title">TOTP Token Generator</h1>
</div>
</footer>

<script src="js/vue-2.4.0.min.js"></script>
<script src="js/otpauth-3.1.3.min.js"></script>
<script src="js/clipboard-2.0.6.min.js"></script>
<script src="js/app.js?v=1.0"></script>

</body>
</html>

0 comments on commit d5daba5

Please sign in to comment.