From bcde0d8cd5463bf1fa580db1d81fc419a1d3effb Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 30 Oct 2024 02:40:19 +0100 Subject: [PATCH] Improved chapter timeline rendering. --- components/scenes/chapters.vue | 50 ++++++++++++++++++++++------------ pages/scene/+Page.vue | 12 ++++---- 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/components/scenes/chapters.vue b/components/scenes/chapters.vue index 03ec5ae..d84be62 100755 --- a/components/scenes/chapters.vue +++ b/components/scenes/chapters.vue @@ -5,15 +5,22 @@ > @@ -89,6 +96,8 @@ const props = defineProps({ }, }); +console.log(props.chapters); + const lastChapter = props.chapters.at(-1); const duration = lastChapter.time + lastChapter.duration; @@ -196,10 +205,15 @@ const timeline = computed(() => { } } +.timeline { + overflow: hidden; + padding-right: 5rem; /* ensure last tag is cleared */ +} + .timeline-items { position: relative; height: 5rem; - border-bottom: solid 1px var(--shadow-weak); + border-bottom: solid 1px var(--shadow-weak-30); } .timeline-item { @@ -207,30 +221,32 @@ const timeline = computed(() => { bottom: -.25rem; padding: .1rem .5rem; border-radius: .6rem; - color: var(--primary); background: var(--background); - transform: rotate(-60deg); - transform-origin: 0 50%; - box-shadow: 0 0 3px var(--shadow-weak); + box-shadow: 0 0 3px var(--shadow-weak-30); font-size: .8rem; - font-weight: bold; .link { - color: inherit; + color: var(--primary); + font-weight: bold; } &:before { content: ''; display: inline-block; - width: 1rem; - height: 2px; + width: 1px; + height: 5rem; position: absolute; - left: calc(-1rem + 1px); + left: 0; margin: .3rem .5rem 0 0; - background: var(--primary); + border-left: dashed 1px var(--shadow-weak-30); } } +.timeline-timestamp { + color: var(--glass); + margin-left: .25rem; +} + @media(--small-30) { .chapters { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); diff --git a/pages/scene/+Page.vue b/pages/scene/+Page.vue index 2e188ae..5e70460 100644 --- a/pages/scene/+Page.vue +++ b/pages/scene/+Page.vue @@ -168,12 +168,6 @@ - -
+ +