Skip to content

Commit 85512cf

Browse files
committed
interface fix
1 parent 16eaa55 commit 85512cf

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

www/compile.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ function createPostPage(post, language) {
254254

255255
function createFilterInput(language) {
256256
const lang = language === 'uk' ? 'uk' : 'en';
257-
const placeholder = lang === 'uk' ? 'фільтр:' : 'filter:';
257+
const placeholder = lang === 'uk' ? 'Фільтр:' : 'Filter:';
258258

259259
return `
260260
<div class="filter-wrapper">
@@ -756,6 +756,16 @@ function generateMenu(activeMenu, posts = [], currentMonth = '') {
756756
body.classList.toggle('menu-open');
757757
});
758758
});
759+
760+
document.addEventListener('keydown', function(e) {
761+
if (e.key === 'Escape') {
762+
const filterInput = document.getElementById('postsFilter');
763+
if (filterInput) {
764+
filterInput.value = '';
765+
filterInput.dispatchEvent(new Event('input'));
766+
}
767+
}
768+
});
759769
</script>`;
760770
}
761771

www/src/md2html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ marked.use({
5454

5555
function mdToHtml(content) {
5656
// Заменяем теги на красивые спаны перед обработкой markdown
57-
content = content.replace(/(?<=\s)#([a-zA-Zа-яА-ЯёЁіІїЇєЄ]+)/g, '<span class="post-tag">#$1</span>');
57+
content = content.replace(/(?<=\s)#([a-zA-Zа-яА-ЯёЁіІїЇєЄ]+)/g, '<span class="post-tag" onclick="document.getElementById(\'postsFilter\').value=\'#$1\';document.getElementById(\'postsFilter\').dispatchEvent(new Event(\'input\'))">#$1</span>');
5858

5959
return marked.parse(content.replace(/<!--[\s\S]*?-->/g, ''));
6060
}

www/template/styles.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,11 @@ body {
692692
text-decoration: none;
693693
transition: all 0.2s ease;
694694
margin-top: 40px;
695+
cursor: pointer;
695696
}
696697

697698
.post-tag:hover {
698-
background: rgba(51, 51, 51, 0.1);
699+
background: rgba(62, 166, 74, 0.1);
699700
transform: translateY(-1px);
700701
}
701702

@@ -706,9 +707,10 @@ body {
706707

707708
.site-description-wrapper {
708709
margin: 1rem 1.2rem;
710+
margin-right: 0;
709711
border-left: 29px solid #333;
710712
box-sizing: border-box;
711-
max-width: 1040px;
713+
max-width: 1052px;
712714
}
713715

714716
.site-description {

0 commit comments

Comments
 (0)