Skip to content

Commit

Permalink
Add visible links
Browse files Browse the repository at this point in the history
  • Loading branch information
gwllx committed Oct 23, 2023
1 parent 5769589 commit 87d4382
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = function(eleventyConfig) {
});

eleventyConfig.addPassthroughCopy("src/favicon.png");
eleventyConfig.addPassthroughCopy("src/img/*");

return {
dir: {
Expand Down
33 changes: 31 additions & 2 deletions src/_includes/moon/base.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
html {
height: 100%;
margin: 0;
padding: 0;
width: 100%;
}

body {
align-items: center;
background: linear-gradient(#01080c, #04293d);
background-size: 200%;
display: flex;
flex-direction: column;
height: 100%;
justify-content: center;
margin: 0;
padding: 0;
width: 100%;
}

.content {
align-items: center;
display: flex;
font-size: 96pt
flex-grow: 1;
font-size: 96pt;
}

.links {
display: none;
display: flex;
flex-direction: row;
justify-content: right;
margin-top: 20px;
margin-right: 50px;
width: 100%;
}

.links a {
margin-right: 25px;
}

.links a:last-child {
margin-right: 0px;
}

.links img {
width: 24px;
}
9 changes: 8 additions & 1 deletion src/_includes/moon/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@ window.onload = function() {
const phase_pc = phase_ms % lunarCycle_ms / lunarCycle_ms;
const index = Math.round(elems.length * phase_pc) % elems.length;

document.getElementsByClassName("content")[0].innerHTML = elems[index];
const content = document.getElementsByClassName("content")[0];
content.innerHTML = elems[index];

var toggle = false;
content.onclick = function() {
toggle = !toggle;
content.innerHTML = toggle ? "👽" : elems[index];
}
};
6 changes: 4 additions & 2 deletions src/_includes/moon/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<style>{% cssmin %}{% include "./base.css" %}{% endcssmin %}</style>
</head>
<body>
<div class="content"></div>
<div class="links">
{%- for link in links %}
<a rel="{{ link.rel }}" href="{{ link.href }}">{{ link.name }}</a>
<a rel="{{ link.rel }}" href="{{ link.href }}">
<img src="img/{{ link.img }}" alt="{{ link.name }}" />
</a>
{%- endfor %}
</div>
<div class="content"></div>
<script>{% jsmin %}{% include "./base.js" %}{% endjsmin %}</script>
</body>
</html>
1 change: 1 addition & 0 deletions src/img/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/img/mastodon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
title: Gareth Williamson
layout: moon/base
links:
- name: GitHub
href: https://github.com/gwllx
rel: link
img: github.svg
- name: Mastodon
href: https://mastodon.social/@gwllx
rel: me
img: mastodon.svg
---

0 comments on commit 87d4382

Please sign in to comment.