Skip to content

Commit

Permalink
💄 Improve footer HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed May 24, 2024
1 parent d259824 commit 75d2f5c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
9 changes: 3 additions & 6 deletions src/assets/cardfoldr.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@ footer {

footer span {
flex: 1;
text-align: center;
}

footer span.left {
footer span:first-child {
text-align: left;
}

footer span.center {
text-align: center;
}

footer span.right {
footer span:last-child {
text-align: right;
}

Expand Down
7 changes: 5 additions & 2 deletions src/assets/cardfoldr.js
Original file line number Diff line number Diff line change
Expand Up @@ -1055,8 +1055,11 @@ window.onload = async () => {
const versionInfo = await fetch("./version.json");
const versionData = await versionInfo.json();

const versionElement = document.getElementById("version");
versionElement.innerHTML = versionData.commit && versionData.build && versionData.date ? `Build #${versionData.build} of commit ${versionData.commit}` : "Local build";
const versionElement = document.createElement("span");
versionElement.innerHTML = versionData.commit && versionData.build && versionData.date ? `Build #${versionData.build} of commit ${versionData.commit.substring(0, 8)}` : "Local build";

const footerElement = document.getElementsByTagName("footer")[0];
footerElement.appendChild(versionElement);
} catch (e) {
console.error("Error loading version information", e);
}
Expand Down
5 changes: 2 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,8 @@ <h2>Result: Generated PDF</h2>
</main>

<footer>
<span id="author" class="left">Created with ❤️ by <a href="https://foosel.net">Gina "foosel" Häußge</a></span>
<span class="center"><a href="https://github.com/foosel/cardfoldr/issues/new/choose" target="_blank" rel="noopener noreferer">Problems? Suggestions?</a></span>
<span id="version" class="right"></span>
<span id="author">Created with ❤️ by <a href="https://foosel.net">Gina "foosel" Häußge</a></span>
<span><a href="https://github.com/foosel/cardfoldr/issues/new/choose" target="_blank" rel="noopener noreferer">Problems? Suggestions?</a></span>
</footer>
</body>
</html>

0 comments on commit 75d2f5c

Please sign in to comment.