adjust color, refactor config

This commit is contained in:
leafee98 2023-07-14 11:10:19 +08:00
parent 8aa240342b
commit 19f195ba84
3 changed files with 165 additions and 91 deletions

View file

@ -4,106 +4,109 @@ name = "Leafee98"
description = "Welcome to leafee98's site" description = "Welcome to leafee98's site"
canonical_link = "https://leafee98.com/" canonical_link = "https://leafee98.com/"
[social] [[section]]
name = "Social" name = "Social"
[[social.items]] [[section.items]]
name = "GitHub" name = "GitHub"
permalink = "https://github.com/leafee98" permalink = "https://github.com/leafee98"
highlight = true
[[social.items]] [[section.items]]
name = "Email" name = "Email"
description = "***REMOVED***" permalink = "mailto:mail@example.org"
hide = true
[[social.items]] [[section.items]]
name = "Matrix" name = "Matrix"
description = "***REMOVED***" permalink = "https://matrix.to/#/@matrix:example.org"
hide = true
[[section]]
name = "Sites"
[service] [[section.items]]
name = "Service"
[[service.items]]
name = "Blog" name = "Blog"
permalink = "https://blog.leafee98.com/" permalink = "https://blog.leafee98.com/"
description = "I blog at here." description = "I blog at here."
highlight = true highlight = true
[[service.items]] [[section.items]]
name = "Forgejo" name = "Forgejo"
permalink = "https://git.leafee98.com/" permalink = "https://git.leafee98.com/"
description = "My own git server." description = "My own git server."
highlight = true
[[service.items]] [[section.items]]
name = "Woodpecker" name = "Woodpecker"
permalink = "https://woodpecker.leafee98.com/" permalink = "https://woodpecker.leafee98.com/"
description = "My own CI/CD service." description = "My own CI/CD service."
[[service.items]] [[section.items]]
name = "Dufs" name = "Dufs"
permalink = "https://dufs.leafee98.com/" permalink = "https://dufs.leafee98.com/"
description = "A simple webdav server, hosting some public available files." description = "A simple webdav server, hosting some public available files."
[[service.items]] [[section.items]]
name = "Uptime" name = "Uptime"
permalink = "https://uptime.leafee98.com/" permalink = "https://uptime.leafee98.com/"
description = "Service Monitor." description = "Service Monitor."
[[service.items]] [[section.items]]
name = "Plik" name = "Plik"
permalink = "https://plik.leafee98.com/" permalink = "https://plik.leafee98.com/"
description = "Temperory file share utility." description = "Temperory file share utility."
[[service.items]] [[section.items]]
name = "Pasty" name = "Pasty"
permalink = "https://paste.leafee98.com/" permalink = "https://paste.leafee98.com/"
description = "Temperory text share utility." description = "Temperory text share utility."
[[service.items]] [[section.items]]
name = "Ntfy" name = "Ntfy"
permalink = "https://ntfy.leafee98.com/" permalink = "https://ntfy.leafee98.com/"
description = "United Push implemention." description = "United Push implemention."
# Personal Service # # Personal Service
[personal_service] # [personal_service]
name = "Personal Service" # name = "Personal Service"
#
[[personal_service.items]] # [[personal_service.items]]
name = "Miniflux" # name = "Miniflux"
permalink = "https://rss.leafee98.com/" # permalink = "https://rss.leafee98.com/"
description = "My RSS reader." # description = "My RSS reader."
#
[[personal_service.items]] # [[personal_service.items]]
name = "Joplin" # name = "Joplin"
permalink = "https://joplin.leafee98.com/" # permalink = "https://joplin.leafee98.com/"
description = "My notebook sync server." # description = "My notebook sync server."
#
[[personal_service.items]] # [[personal_service.items]]
name = "Syncthing" # name = "Syncthing"
permalink = "https://syncthing.leafee98.com/" # permalink = "https://syncthing.leafee98.com/"
description = "My file syncing agent." # description = "My file syncing agent."
#
[[personal_service.items]] # [[personal_service.items]]
name = "Radicale" # name = "Radicale"
permalink = "https://calendar.leafee98.com/" # permalink = "https://calendar.leafee98.com/"
description = "Selfhost calender and task server." # description = "Selfhost calender and task server."
#
[[personal_service.items]] # [[personal_service.items]]
name = "Matrix" # name = "Matrix"
permalink = "https://matrix.leafee98.com/" # permalink = "https://matrix.leafee98.com/"
description = "My matrix instance." # description = "My matrix instance."
#
[[personal_service.items]] # [[personal_service.items]]
name = "Turn" # name = "Turn"
permalink = "https://turn.leafee98.com/" # permalink = "https://turn.leafee98.com/"
description = "Provide VoIP for matrix." # description = "Provide VoIP for matrix."
#
[[personal_service.items]] # [[personal_service.items]]
name = "Webdav" # name = "Webdav"
permalink = "https://webdav.leafee98.com/" # permalink = "https://webdav.leafee98.com/"
description = "Webdav endpoint for online storage, powered by apache httpd." # description = "Webdav endpoint for online storage, powered by apache httpd."
#
[[personal_service.items]] # [[personal_service.items]]
name = "FileBrowser" # name = "FileBrowser"
permalink = "https://file.leafee98.com/" # permalink = "https://file.leafee98.com/"
description = "File manager for my online storage." # description = "File manager for my online storage."

View file

@ -24,31 +24,36 @@
{% endmacro %} {% endmacro %}
{% macro render_item(name, permalink, description) %} {% macro render_item(item) %}
{% if permalink is defined %}
{% set class_str = "item" %}
{% if item.highlight %}
{% set class_str = class_str + " " + "highlight" %}
{% endif %}
{% set href ="/#" %}
{% if item.permalink is defined %}
{% set href = item.permalink %}
{% endif %}
<a class="{{ class_str }}" href="{{ href | safe }}">
<dl> <dl>
<dt><a href="{{ permalink | safe }}">{{ name }}</a></dt> <dt>{{ item.name }}</dt>
{% if description is defined %} {% if item.description is defined %}
<dd>{{ description }}</dd> <dd>{{ item.description }}</dd>
{% endif %} {% endif %}
</dl> </dl>
{% else %} </a>
<dl>
<dt><a href="/#">{{ name }}</a></dt>
{% if description is defined %}
<dd>{{ description }}</dd>
{% endif %}
</dl>
{% endif %}
{% endmacro %} {% endmacro %}
{% macro section(sect) %} {% macro render_section(sect) %}
<section> <section>
<h2>{{ sect.name }}</h2> <h2>{{ sect.name }}</h2>
<div class="item_container"> <div class="item_container">
{% for item in sect.items %} {% for item in sect.items %}
{{ render_item(item.name, item.permalink, item.description) }} {{ render_item(item) }}
{% endfor %} {% endfor %}
</div> </div>
</section> </section>
@ -71,14 +76,14 @@
<body> <body>
<main> <main>
<div> <div class="big_title">
<h1>{{ name }}</h1> <h1>{{ name }}</h1>
<p>{{ description }}</p> <p>{{ description }}</p>
</div> </div>
{{ section(social) }} {% for s in section %}
{{ section(service) }} {{ render_section(s) }}
{{ section(personal_service) }} {% endfor %}
</main> </main>
</body> </body>

View file

@ -7,6 +7,45 @@
font-size: 16px; font-size: 16px;
} }
body {
background-color: var(--c-global-bg)
}
/* colors */
:root {
--c-m-bg-0: #FFFFFF;
--c-m-bg-1: #F3F6FC;
--c-m-bg-2: #E5E9ED;
--c-m-bg-3: #C2E7FF;
--c-m-bg-4: #B8DBF0;
--c-m-ft: #1F1F1F;
}
@media (prefers-color-scheme: dark) {
:root {
--c-m-bg-0: #1F1F1F;
--c-m-bg-1: #2D2F31;
--c-m-bg-2: #383B3C;
--c-m-bg-3: #004A77;
--c-m-bg-4: #0F547D;
--c-m-ft: #E3E3E3;
}
}
:root {
--c-global-bg: var(--c-m-bg-1);
--c-item-bg: var(--c-m-bg-2);
--c-item-bg-hover: var(--c-m-bg-4);
--c-item-bg-hl: var(--c-m-bg-3);
--c-item-bg-hl-hover: var(--c-m-bg-4);
}
* {
color: var(--c-m-ft);
}
/* main panel */ /* main panel */
main { main {
@ -16,9 +55,29 @@ main {
flex-direction: column; flex-direction: column;
width: 52rem; width: 52rem;
max-width: 100%; max-width: 100%;
padding: 1rem; padding: 4rem 1rem 3rem 1rem;
} }
/* big title */
.big_title {
padding-bottom: 2.5rem;
}
.big_title h1 {
font-size: 2.5rem;
font-weight: bold;
margin-bottom: 1.5rem;
}
.big_title h1,
.big_title p {
text-align: center;
}
h2 { font-size: 1.625rem; }
/* section layout */ /* section layout */
section { section {
@ -44,19 +103,26 @@ h2 {
margin-bottom: 2rem; margin-bottom: 2rem;
} }
/* item layout */
dl { /* item layout */
.item {
width: 9rem; width: 9rem;
border: 1px solid; border: 1px solid var(--c-border);
border-radius: 0.5rem;
padding: 0.5rem 0.25rem; padding: 0.5rem 0.25rem;
background-color: var(--c-item-bg);
} }
.item.highlight { background-color: var(--c-item-bg-hl); }
.item.highlight:hover { background-color: var(--c-item-bg-hl-hover); }
.item:hover { background-color: var(--c-item-bg-hover); }
/* item text */ /* item text */
dt, dd { a { text-decoration: none; }
text-align: center; dl * { line-height: 1.2; }
} dt { font-size: 1rem; font-weight: 500; }
dd { font-size: 0.875rem; }
dt { dt, dd { text-align: center; }
margin-bottom: 0.5rem;
} dt { margin-bottom: 0.5rem; }