Compare commits
2 Commits
6b245f540d
...
b851a127c7
Author | SHA1 | Date | |
---|---|---|---|
b851a127c7 | |||
a2b355477f |
@ -4,7 +4,9 @@ title = "About"
|
|||||||
notoc = true
|
notoc = true
|
||||||
+++
|
+++
|
||||||
|
|
||||||
This is my personal website mainly used for technical articles about problems and projects I am working on.
|
<img src="profile-picture.jpg" alt="Profile Picture" class="profile-picture">
|
||||||
|
|
||||||
|
This is my personal website mainly used for technical articles about problems and projects I am working on.
|
||||||
|
|
||||||
It is generated to static HTML via [Zola](https://www.getzola.org/).
|
It is generated to static HTML via [Zola](https://www.getzola.org/).
|
||||||
|
|
BIN
content/about/profile-picture.jpg
Normal file
BIN
content/about/profile-picture.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
@ -188,7 +188,6 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input.search {
|
input.search {
|
||||||
display: none; // Hide for non-js browsers
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
@ -211,6 +210,12 @@ a {
|
|||||||
&:hover { text-decoration: underline }
|
&:hover { text-decoration: underline }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.profile-picture {
|
||||||
|
float: right;
|
||||||
|
width: 15rem;
|
||||||
|
margin-left: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 50rem) {
|
@media screen and (max-width: 50rem) {
|
||||||
|
|
||||||
.grid { grid-template-columns: auto }
|
.grid { grid-template-columns: auto }
|
||||||
@ -230,6 +235,11 @@ a {
|
|||||||
}
|
}
|
||||||
span.title { display: none }
|
span.title { display: none }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.profile-picture {
|
||||||
|
width: 10rem;
|
||||||
|
margin-left: 1em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
|
@ -1,15 +1,23 @@
|
|||||||
function filter_title(str)
|
function filter_title(query, articles)
|
||||||
{
|
{
|
||||||
if (str.length == 0) {
|
const search = query.trim().toLowerCase();
|
||||||
articles.forEach(article => article.style.display = "block");
|
|
||||||
} else {
|
if (search.length === 0) {
|
||||||
articles.forEach(article => article.style.display = article.dataset.title.indexOf(str.toLowerCase()) === -1 ? "none" : "block");
|
articles.forEach(article => article.style.display = 'block');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
articles.forEach(article => {
|
||||||
|
const title = article.dataset.title || '';
|
||||||
|
article.style.display = title.includes(search) ? 'block' : 'none';
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = document.querySelector("input[type='search']");
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
const form = document.querySelector("form");
|
document.querySelector('.search-wrapper').innerHTML =
|
||||||
let articles = Array.from(document.querySelectorAll("article"));
|
'<input class="search" type="search" placeholder="Search">';
|
||||||
|
|
||||||
search.addEventListener("input", () => filter_title(search.value));
|
const search = document.querySelector("input[type='search']");
|
||||||
window.addEventListener("load", () => search.style.display = "inline-block");
|
const articles = Array.from(document.querySelectorAll('article'));
|
||||||
|
|
||||||
|
search.addEventListener('input', () => filter_title(search.value, articles));
|
||||||
|
});
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{{ section.title }}</h1>
|
<h1>{{ section.title }}</h1>
|
||||||
<input class="search" type="search" placeholder="Search">
|
<div class="search-wrapper"></div>
|
||||||
{{ macros::list_posts() }}
|
{{ macros::list_posts() }}
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user