From cacae8699461da180f263259843f0a52a1051d31 Mon Sep 17 00:00:00 2001 From: Lemmy Adams Date: Thu, 12 Sep 2024 12:07:05 +0100 Subject: [PATCH 1/3] Add check on completed transcript --- less/youtube.less | 18 ++++++++++++++++++ templates/youtube.hbs | 6 ++++++ 2 files changed, 24 insertions(+) diff --git a/less/youtube.less b/less/youtube.less index ea08bed..f27a1d9 100644 --- a/less/youtube.less +++ b/less/youtube.less @@ -35,4 +35,22 @@ &__transcript-body-inline a { .link-text; } + + &__transcript-btn { + display: inline-flex; + align-items: center; + justify-content: center; + } + + &__transcript-btn-icon { + margin-inline-start: @icon-padding / 2; + } + + &.is-complete &__transcript-btn-icon .icon { + .icon-tick; + } + + &__transcript-body-inline { + display: none; + } } diff --git a/templates/youtube.hbs b/templates/youtube.hbs index 9aba031..d285767 100644 --- a/templates/youtube.hbs +++ b/templates/youtube.hbs @@ -36,6 +36,9 @@ {{_transcript.inlineTranscriptButton}} + + + {{/if}} @@ -48,6 +51,9 @@ {{_transcript.transcriptLink}} {{/if}} + + + {{/if}} From b37620c66e661b59f92bba9283194915d8763ae5 Mon Sep 17 00:00:00 2001 From: Lemmy Adams Date: Tue, 1 Oct 2024 17:21:23 +0100 Subject: [PATCH 2/3] Improved transcript and css to match vimeo & media --- less/youtube.less | 19 +++++++++++++++++++ templates/youtube.hbs | 16 +++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/less/youtube.less b/less/youtube.less index f27a1d9..c727671 100644 --- a/less/youtube.less +++ b/less/youtube.less @@ -50,7 +50,26 @@ .icon-tick; } + &__transcript-btn-inline .icon { + .icon-plus; + } + &__transcript-body-inline { display: none; } + + // Skip to transcript button + &__skip-to-transcript { + + html:not(.has-accessibility) & { + .u-display-none; + } + + &:not(:focus-visible) { + height: 0; + padding: 0; + margin: 0; + overflow: hidden; + } + } } diff --git a/templates/youtube.hbs b/templates/youtube.hbs index d285767..9d7f70e 100644 --- a/templates/youtube.hbs +++ b/templates/youtube.hbs @@ -4,7 +4,9 @@ {{> component this}} {{#any _transcript._externalTranscript _transcript._inlineTranscript}} - + {{/any}}
@@ -34,7 +36,11 @@ {{#if _transcript._inlineTranscript}}