From a8b863383a2ace14b6d7d832100bce9cb11a39f8 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 22 Nov 2022 14:04:18 -0500 Subject: [PATCH] icons standardization --- layouts/shortcodes/audio.html | 32 +++++++++++++++++++++++--------- layouts/shortcodes/video.html | 34 +++++++++++----------------------- static/js/icons.js | 12 ++++++++++++ 3 files changed, 46 insertions(+), 32 deletions(-) create mode 100644 static/js/icons.js diff --git a/layouts/shortcodes/audio.html b/layouts/shortcodes/audio.html index a8e3b01..52fe632 100644 --- a/layouts/shortcodes/audio.html +++ b/layouts/shortcodes/audio.html @@ -2,8 +2,14 @@ .audio-player { display: flex; flex-direction: row; + align-items: center; + justify-content:center; width: 100%; } + .audio-player>*{ + height:fit-content; + padding:0.25rem; + } .audio-player p{ width: fit-content; } @@ -31,15 +37,22 @@ .icon svg{ width:2.25rem; + height:2.25rem; z-index: -1; background-color: transparent; pointer-events: none; } -.icon path{ - stroke:var(--theme-accent); - fill:var(--theme-accent); -} +.icon path, + .icon rect { + stroke: var(--theme-accent); + fill: var(--theme-accent); + } +.icon svg circle { + stroke: var(--theme-accent); + fill: transparent; + stroke-width: 6; +} @keyframes spin-icon { 0%{rotate:0;} 100%{rotate:360deg;} @@ -54,7 +67,7 @@
- +
@@ -91,7 +85,7 @@

- + " - video.parentElement.children[1].children[0].innerHTML = icon; + video.parentElement.children[1].children[0].innerHTML = icons['pause']; } else { event.target.pause(); - var icon = " "; - video.parentElement.children[1].children[0].innerHTML = icon; + video.parentElement.children[1].children[0].innerHTML = icons['play']; } } function fullscreen(event) { video = event.target.parentElement.parentElement; if (document.fullscreenElement) { document.exitFullscreen(); - var icon = " "; - event.target.innerHTML = icon; + event.target.innerHTML = icons['expand']; } else { video.requestFullscreen(); - var icon = " "; - event.target.innerHTML = icon; + event.target.innerHTML = icons['shrink']; } @@ -158,13 +148,11 @@ if (video.paused) { video.playbackRate = video.parentElement.children[1].children[2].value; video.play(); - var icon = " "; - video.parentElement.children[1].children[0].innerHTML = icon; + video.parentElement.children[1].children[0].innerHTML = icons['pause']; } else { video.pause(); - var icon = " "; - video.parentElement.children[1].children[0].innerHTML = icon; + video.parentElement.children[1].children[0].innerHTML = icons['play']; } } function update_video_speed(event) { @@ -222,7 +210,7 @@ display: none; } -