diff --git a/package-lock.json b/package-lock.json index b6ea2320..cc882010 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "22.0.0", + "version": "22.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "22.0.0", + "version": "22.1.0", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.4.0", diff --git a/package.json b/package.json index ab49ba1a..ccf511b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "22.0.0", + "version": "22.1.0", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "scripts": { diff --git a/src/assets/scripts/media-toggles.js b/src/assets/scripts/media-toggles.js deleted file mode 100644 index dd69cd37..00000000 --- a/src/assets/scripts/media-toggles.js +++ /dev/null @@ -1,27 +0,0 @@ -window.addEventListener('load', () => { - const buttonSets = document.querySelectorAll('.section-header-buttons') - const initializeButtonSet = (buttonSet) => { - const buttons = buttonSet.querySelectorAll('button') - const buttonIds = Array.from(buttons).map((button) => button.getAttribute('data-toggle')) - - buttons.forEach(button => { - button.addEventListener('click', function () { - const targetId = this.getAttribute('data-toggle') - const targetContent = document.getElementById(targetId) - - buttons.forEach(btn => { - btn.classList.toggle('active', btn === this) - btn.classList.toggle('secondary', btn !== this) - }) - - buttonIds.forEach(id => { - document.getElementById(id).classList.toggle('hidden', id !== targetId) - }) - - targetContent.classList.remove('hidden') - }) - }) - } - - buttonSets.forEach(initializeButtonSet) -}) \ No newline at end of file diff --git a/src/assets/styles/components/buttons.css b/src/assets/styles/components/buttons.css index 03002c3f..93fa9a75 100644 --- a/src/assets/styles/components/buttons.css +++ b/src/assets/styles/components/buttons.css @@ -1,4 +1,52 @@ -button { +/* music - chart toggle styles */ +#tracks-recent ~ .tracks-recent, +#tracks-window ~ .tracks-window { + display: none; +} + +#tracks-recent:checked ~ .tracks-recent, +#tracks-window:checked ~ .tracks-window { + display: block; +} + +input[id="tracks-recent"] ~ [for="tracks-recent"], +input[id="tracks-window"] ~ [for="tracks-window"] { + margin-bottom: var(--sizing-lg); +} + +#tracks-recent:not(:checked) ~ [for="tracks-recent"]:hover, +#tracks-recent:not(:checked) ~ [for="tracks-recent"]:active, +#tracks-window:not(:checked) ~ [for="tracks-window"]:hover, +#tracks-window:not(:checked) ~ [for="tracks-window"]:active { + color: var(--accent-color-hover); + background: transparent; +} + +#tracks-recent:not(:checked) ~ [for="tracks-recent"]:focus, +#tracks-recent:not(:checked) ~ [for="tracks-recent"]:focus-within, +#tracks-window:not(:checked) ~ [for="tracks-window"]:focus, +#tracks-window:not(:checked) ~ [for="tracks-window"]:focus-within { + transition-property: none; + outline: 2px dashed var(--accent-color); + border: 0; +} + +#tracks-recent:checked ~ [for="tracks-recent"], +#tracks-window:checked ~ [for="tracks-window"] { + cursor: not-allowed; + border-color: var(--accent-color); + background-color: var(--accent-color); +} + +#tracks-recent:not(:checked) ~ [for="tracks-recent"], +#tracks-window:not(:checked) ~ [for="tracks-window"] { + color: var(--accent-color); + background: transparent; +} + +/* generic button styles */ +button, +.button { appearance: none; border: none; diff --git a/src/pages/dynamic/music/index.html b/src/pages/dynamic/music/index.html index 05cda682..4fc13d14 100644 --- a/src/pages/dynamic/music/index.html +++ b/src/pages/dynamic/music/index.html @@ -6,10 +6,6 @@ permalink: "/music/index.html" updated: "now" schema: music-index --- -{%- capture js -%} - {% render "../../../assets/scripts/media-toggles.js" %} -{%- endcapture -%} -
I've listened to {{ music.week.artists.size }} artists, {{ music.week.albums.size }} albums and {{ music.week.totalTracks }} tracks this week. Most of that has been {{ music.week.genres | sortByPlaysDescending: "plays" | genreStrings: "genre" | mediaLinks: "genre", 5 }}.
See more of the artists, albums or tracks I've listened to this week. Or take a look at what I've listened to this month or over the last 3 months.
@@ -37,16 +33,18 @@ schema: music-index Tracks - +