mirror of
https://github.com/zaaarf/friendenstein.git
synced 2024-11-22 15:34:50 +01:00
feat: icons with tooltip instead of link
This commit is contained in:
parent
dc78abbf45
commit
40785d8267
5 changed files with 293 additions and 205 deletions
|
@ -75,10 +75,11 @@ subtitle_suffixes = [
|
||||||
|
|
||||||
# Social icons, list here: https://github.com/rhazdon/hugo-theme-hello-friend-ng/blob/master/layouts/partials/svg.html
|
# Social icons, list here: https://github.com/rhazdon/hugo-theme-hello-friend-ng/blob/master/layouts/partials/svg.html
|
||||||
social_icons = [
|
social_icons = [
|
||||||
{ name = "github", url = "https://github.com/zaaarf" },
|
{ name = "github", at = "https://github.com/zaaarf" },
|
||||||
{ name = "codeberg", url = "https://codeberg.org/zaaarf" },
|
{ name = "codeberg", at = "https://codeberg.org/zaaarf" },
|
||||||
{ name = "matrix", url = "https://matrix.to/#/@zaaarf:fantabos.co" },
|
{ name = "matrix", at = "https://matrix.to/#/@zaaarf:fantabos.co" },
|
||||||
{ name = "email", url = "mailto:me@zaaarf.foo" }
|
{ name = "discord", at = "@zaaarf", link = false },
|
||||||
|
{ name = "email", at = "mailto:me@zaaarf.foo" }
|
||||||
]
|
]
|
||||||
|
|
||||||
# Valid keys are "post" and "list", one referring to individual blogposts,
|
# Valid keys are "post" and "list", one referring to individual blogposts,
|
||||||
|
|
|
@ -26,8 +26,64 @@ div.home-container {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
a.social-icon {
|
.social-icon {
|
||||||
padding: .2em .3em 0 .3em;
|
padding: .2em .3em 0 .3em;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&-container {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-menu {
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
display: none;
|
||||||
|
opacity: 0;
|
||||||
|
transition: all 0.15s ease-out 0.15s;
|
||||||
|
|
||||||
|
background-color: transparent;
|
||||||
|
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
top: 100%;
|
||||||
|
|
||||||
|
z-index: 10;
|
||||||
|
|
||||||
|
&-arrow {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-left: 4px solid transparent;
|
||||||
|
border-right: 4px solid transparent;
|
||||||
|
border-bottom: 4px solid var(--metaColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-inner {
|
||||||
|
position: relative;
|
||||||
|
padding: .2em .5em;
|
||||||
|
border: thin solid var(--metaColor);
|
||||||
|
border-radius: 2px;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: "";
|
||||||
|
border-color: transparent;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: -1;
|
||||||
|
box-shadow: 0 0 20px 1px #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.nolink:hover .social-icon-menu {
|
||||||
|
display: inline-block;
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,17 @@
|
||||||
:root.dark {
|
:root {
|
||||||
.lightOnly {
|
&.dark {
|
||||||
|
.light-only {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.light {
|
||||||
|
.dark-only {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:root.light {
|
:root.light {
|
||||||
.darkOnly {
|
.darkOnly {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{% import "macros/svg.html" as svg %}
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
@ -8,22 +9,23 @@
|
||||||
<h1>{{ config.title }}</h1>
|
<h1>{{ config.title }}</h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if config.extra.home.subtitle %}
|
{% if config.extra.home.subtitle %}
|
||||||
<p>{{ config.extra.home.subtitle }}<span id="subtitleRand"></span></p>
|
<p>{{ config.extra.home.subtitle }}<span id="subtitle-rand"></span></p>
|
||||||
{% elif config.description %}
|
{% elif config.description %}
|
||||||
<p>{{ config.description }}<span id="subtitleRand"></span></p>
|
<p>{{ config.description }}<span id="subtitle-rand"></span></p>
|
||||||
|
{% endif %}
|
||||||
|
{% if config.extra.home.social_icons %}
|
||||||
|
{{ svg::draw_icons(icons=config.extra.home.social_icons) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% include "svg.html" %}
|
|
||||||
</div></div>
|
</div></div>
|
||||||
{% if config.extra.home.subtitle_suffixes %}
|
{% if config.extra.home.subtitle_suffixes %}
|
||||||
|
<script> //random subtitle logic
|
||||||
<script>
|
|
||||||
const suffixes = [
|
const suffixes = [
|
||||||
{% for s in config.extra.home.subtitle_suffixes %}
|
{% for s in config.extra.home.subtitle_suffixes %}
|
||||||
"{{ s }}",
|
"{{ s }}",
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
]
|
]
|
||||||
var current = suffixes[Math.floor(Math.random() * suffixes.length)];
|
var current = suffixes[Math.floor(Math.random() * suffixes.length)];
|
||||||
var span = document.getElementById("subtitleRand");
|
var span = document.getElementById("subtitle-rand");
|
||||||
span.textContent = current;
|
span.textContent = current;
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue