Skip to content

Commit

Permalink
set css position on transcript based on window breakpoint
Browse files Browse the repository at this point in the history
this will ensure the transcript shows below the video on smaller screens and to the side on larger screens
  • Loading branch information
nucleogenesis committed Oct 11, 2023
1 parent 886f50f commit 880d78f
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<section
:dir="languageDir"
:class="['media-player-transcript', { showing }]"
:style="{ background: $themeTokens.surface }"
:style="{ background: $themeTokens.surface, position: cssPosition }"
:aria-hidden="(!showing).toString()"
:aria-label="coreString('transcript')"
@mouseenter="hovering = true"
Expand Down Expand Up @@ -52,12 +52,17 @@
import { throttle } from 'frame-throttle';
import { getLangDir } from 'kolibri.utils.i18n';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import TranscriptCue from './TranscriptCue';
export default {
name: 'MediaPlayerTranscript',
components: { TranscriptCue },
mixins: [commonCoreStrings],
setup() {
const { windowBreakpoint } = useKResponsiveWindow();
return { windowBreakpoint };
},
data() {
return {
// TODO figure if this is supposed to be used
Expand All @@ -70,6 +75,9 @@
computed: {
...mapState('mediaPlayer', ['player']),
...mapState('mediaPlayer/captions', ['transcript', 'language', 'cues', 'activeCueIds']),
cssPosition() {
return this.windowBreakpoint >= 3 ? 'absolute' : 'relative';
},
showing() {
return this.player && this.transcript;
},
Expand Down

0 comments on commit 880d78f

Please sign in to comment.