Compare commits

..

No commits in common. "cefae0c90cc3963c4c4aa9613faf25caaed01f33" and "7bc5b1bbb936888761037a050612c8e37a7eb5ac" have entirely different histories.

11 changed files with 22 additions and 126 deletions

4
.gitignore vendored
View File

@ -1,5 +1 @@
*.pdf
content/*/*.html
devel/
archive/
public/

View File

@ -1,46 +0,0 @@
{title: 1. signální}
{artist: Chinaski}
{columns: 2}
{sov}
Až si [G]zejtra ráno [C]řeknu zase [Em]jednou provždy dost,
[G]právem se mi [C]budeš tiše [Em]smát,
jak [G]omluvit si [C]svoji slabost, [Em]nenávist a zlost,
když [G]za všechno si [C]můžu vlastně [Em]sám?
{eov}
{soc}
[Em]Za spoustu dní, možná za [C]spoustu let,
až se mi [G]rozední, budu ti [D]vyprávět
na první [Am]signální, jak jsem [C]obletěl svět,
jak tě to [G]omámí a [D]nepustí zpět.
Jaký si to [F]uděláš, [Bb]takový to [Dm]máš.
jaký si to [F]uděláš, [Bb]takový to [Dm]máš.
{eoc}
{sov}
Až se [G]dneska večer [C]budu tvářit [Em]zas jak Karel Gott,
[G]budu zpívat [C]vam pam pidam [Em]pam,
všechna [G]sláva, polní [C]tráva, ale [Em]peníz přijde vhod,
[G]jak jsem si to [C]udělal, tak to [Em]mám.
{eov}
{column_break}
{soc}
[Em]Za spoustu dní, možná za [C]spoustu let,
až se mi [G]rozední, budu ti [D]vyprávět
na první [Am]signální, jak jsem [C]obletěl svět,
jak tě to [G]omámí a [D]nepustí zpět.
Jaký si to [F]uděláš, [Bb]takový to [Dm]máš.
jaký si to [F]uděláš, [Bb]takový to [Dm]máš.
{eoc}
{sov}
Nanana na nana...
Jaký si to [F]uděláš, [Bb]takový to [Dm]máš.
jaký si to [F]uděláš, [Bb]takový to [Dm]máš.
{eov}

View File

@ -1,6 +0,0 @@
+++
title = "1. signální"
[taxonomies]
album = ["20 let v síti"]
artist = ["Chinaski"]
+++

View File

@ -10,7 +10,7 @@ SRC_EXTENSION := .cho
SONG_CHO := $(foreach dir,$(SRC_DIR),$(wildcard $(dir)/*$(SRC_EXTENSION)))
SONG_PDF := $(patsubst %$(SRC_EXTENSION),%.pdf,$(SONG_CHO))
SONG_HTML := $(patsubst %$(SRC_EXTENSION),%.html,$(SONG_CHO))
SONGBOOK := content/songbook.pdf
SONGBOOK := songbook.pdf
.DEFAULT_GOAL := pdf
@ -38,4 +38,3 @@ songbook: pdf
.PHONY: clean
clean:
rm -f $(SONG_PDF) $(SONG_HTML) $(SONGBOOK)

View File

@ -19,13 +19,13 @@ table {
}
.song {
padding: 3em 0 1em 1em;
padding: 1em 0 0 1em;
}
.title {
font-size: 1.5em;
font-weight: bold;
margin-bottom: 2em;
margin-bottom: 1em;
}
.chords {
@ -78,4 +78,3 @@ table {
color: $col-black;
}
}

View File

@ -191,8 +191,7 @@ main.song {
&.font-size>.button:hover, &.font-size>.button.active { background-color: #bf616a }
&.transpose>.button:hover, &.transpose>.button.active { background-color: #5e81ac }
&.autoscroll>.button:hover, &.autoscroll>.button.active { background-color: #d08770 }
&.autoscroll>#autoscroll.active { background-color: #bf616a }
&.autoscroll>.button.active { background-color: #d08770 }
.button{
display: grid;
@ -235,4 +234,3 @@ main.song {
}
}
}

View File

@ -20,21 +20,15 @@ function buttonToggle(clickedButton) {
}
function filterSongs() {
const searchTerm = sanitizeString(search.value);
const searchTerm = search.value.trim().toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
const songs = Array.from(songList.children);
songs.forEach(song => {
const matching = (
(song.dataset.title.includes(searchTerm) || (song.dataset.artist && song.dataset.artist.includes(searchTerm))) &&
(!selectedCategory || song.dataset.category === selectedCategory)
);
const title = song.dataset.title.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
const matching = title.includes(searchTerm) && (!selectedCategory || song.dataset.category === selectedCategory);
song.classList.toggle("hidden", !matching);
});
}
function sanitizeString(string) {
return string.trim().toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "")
}
// Event listeners
search.addEventListener("input", filterSongs);
// Filtering happens before the reset itself without this timeout
@ -43,12 +37,8 @@ buttons.forEach(button => button.addEventListener("click", () => buttonToggle(bu
// Normalize song titles
Array.from(songList.children).forEach(song => {
song.dataset.title = sanitizeString(song.dataset.title);
if (song.dataset.artist) {
song.dataset.artist = sanitizeString(song.dataset.artist);
}
song.dataset.title = song.dataset.title.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
});
// Display the filter section on JS-enabled browsers
window.addEventListener("load", () => filters.classList.remove = "hidden");

View File

@ -3,40 +3,18 @@ const song = document.querySelector("iframe.song").contentWindow;
// Autoscroll
var scroll;
var scrollTimeout = 60;
const minTimeout = 10;
const maxTimeout = 120;
const scrollIncrement = 20;
function pageScroll() {
song.scrollBy(0, 1);
scroll = setTimeout(pageScroll, scrollTimeout);
scroll = setTimeout(pageScroll, 80);
}
function updateScrollSpeed() {
if (controls.querySelector("#autoscroll").classList.contains("active")) {
clearTimeout(scroll);
scroll = setTimeout(pageScroll, scrollTimeout);
}
}
controls.querySelector("#autoscroll-increase").addEventListener("click", () => {
scrollTimeout = Math.max(minTimeout, scrollTimeout - scrollIncrement);
updateScrollSpeed();
});
controls.querySelector("#autoscroll-decrease").addEventListener("click", () => {
scrollTimeout = Math.min(maxTimeout, scrollTimeout + scrollIncrement);
updateScrollSpeed();
});
controls.querySelector("#autoscroll").addEventListener("click", function() {
this.classList.toggle("active");
document.querySelector("#autoscroll").addEventListener("click", function() {
if (this.classList.contains("active")) {
pageScroll();
} else {
clearTimeout(scroll);
} else {
pageScroll();
}
this.classList.toggle("active");
});
// Scaling
@ -53,7 +31,5 @@ controls.querySelector("#font-size-increase").addEventListener("click", () => pa
controls.querySelector("#font-size-decrease").addEventListener("click", () => pageScale(-0.1));
controls.querySelector("#font-size-reset").addEventListener("click", () => pageScale(0));
// Display the controls on JS-enabled browsers
window.addEventListener("load", () => controls.classList.remove = "hidden");

View File

@ -21,13 +21,7 @@
</section>
<section class="song-list">
{% for song in section.pages %}
<div class="{{ macros::primary_category(song=song) }}"
data-title="{{ song.title }}"
data-category="{{ macros::primary_category(song=song) }}"
{% if song.taxonomies["artist"] %}
data-artist="{{ song.taxonomies["artist"][0] }}"
{% endif %}
>
<div class="{{ macros::primary_category(song=song) }}" data-title="{{ song.title }}" data-category="{{ macros::primary_category(song=song) }}">
<div class="meta">
<div class="title">{{ song.title }}</div>
{% if song.taxonomies["artist"] %}

View File

@ -1,5 +1,5 @@
{% macro primary_category(song) %}
{%- if song.taxonomies["album"] -%}
{{ song.taxonomies["album"][0] }}
{%- endif -%}
{%- if song.taxonomies["album"] -%}
{{ song.taxonomies["album"][0] }}
{%- endif -%}
{% endmacro %}

View File

@ -1,5 +1,4 @@
{% extends "index.html" %}
{% block content %}
<main class="song">
{% for asset in page.assets %}
@ -11,15 +10,13 @@
<div class="button icon-font-size" id="font-size-reset"></div>
<div class="button icon-add" id="font-size-increase"></div>
</section>
<!--<section class="transpose">-->
<!-- <div class="button icon-subtract" id="transpose-decrease"></div>-->
<!-- <div class="button icon-transpose" id="transpose-reset"></div>-->
<!-- <div class="button icon-add" id="transpose-increase"></div>-->
<!--</section>-->
<section class="transpose">
<div class="button icon-subtract" id="transpose-decrease"></div>
<div class="button icon-transpose" id="transpose-reset"></div>
<div class="button icon-add" id="transpose-increase"></div>
</section>
<section class="autoscroll">
<div class="button icon-subtract" id="autoscroll-decrease"></div>
<div class="button icon-scroll" id="autoscroll"></div>
<div class="button icon-add" id="autoscroll-increase"></div>
</section>
</nav>
{% endif %}
@ -30,4 +27,3 @@
{% block script %}
<script src="{{ get_url(path="/js/song-controls.js") }}"></script>
{% endblock %}