Skip to content

Commit

Permalink
feat(layout): adjust flex handling for image/text/video
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerd Müller committed Feb 14, 2021
1 parent d8e39ea commit 3390ccc
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 37 deletions.
32 changes: 32 additions & 0 deletions libs/ui/src/lib/chapter/chapter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
align-items: center;
justify-content: center;
flex-flow: row wrap;
padding: 0 16px;

&--fore {
transform: translateZ(90px) scale(.7);
Expand Down Expand Up @@ -76,3 +77,34 @@
filter: blur(0)
}
}

.full {
flex: 1 80%;
}

.primary {
flex: 1 66%;
}

.second {
flex: 0 50%;
}

.third {
flex: 0 33%;
}

.fourth {
flex: 0 25%;
}

.fifth {
flex: 0 20%;
}

@media screen and (max-device-height: 860px){

.parallax__group {
height: 150vh;
}
}
4 changes: 1 addition & 3 deletions libs/ui/src/lib/chapter/chapter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import {AppContext } from '../chapter/context';

import { ChapterProps } from '@gerdesque/data';



export const Chapter = (props: ChapterProps) => {

const [character, setCharacter] = useContext(AppContext);
const [character] = useContext(AppContext);

const renderChapterGroups = () => {
return props.groups.map((group, index) =>
Expand Down
17 changes: 0 additions & 17 deletions libs/ui/src/lib/image/image.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,6 @@ img {
text-align: center;
}

.full {
width: 80%;
}

.primary {
width: 66%;
}

.second {
width: 50%;
}

.third {
width: 33%;
padding: 5px;
}

.avatar img {
border-radius: 50%;
}
Expand Down
4 changes: 0 additions & 4 deletions libs/ui/src/lib/text/text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
width: 80%;
}

.third {
width: 33%;
}

p {
text-align: center;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/src/lib/title/title.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

h1 {
line-height: 1.2;
font-size: 3em;
font-size: #{'clamp(1em, 1em + 2vw, 3em)'};
font-family: LinolschriftHeavy,arial,sans-serif;
font-weight: normal;
}
Expand Down
10 changes: 0 additions & 10 deletions libs/ui/src/lib/video/video.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,4 @@ video::cue {

.chapter_video {
position: relative;
}

.fourth {
flex: 1 25%;
padding: 5px;
}

.fifth {
flex: 1 20%;
padding: 5px;
}
6 changes: 4 additions & 2 deletions libs/ui/src/lib/video/video.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {useState} from 'react';
import React, {useContext, useState} from 'react';
import { SUBTITLE_SUFFIX, VIDEO_SUFFIX } from '@gerdesque/data';
import { AppContext } from '../chapter/context';

/* eslint-disable-next-line */
export interface VideoProps {
Expand All @@ -9,6 +10,7 @@ export interface VideoProps {
}

export const Video = (props: VideoProps) => {
const [,,language] = useContext(AppContext);
const [isPlaying, setPlaying] = useState(false);

const playVideo = (playing) => {
Expand All @@ -20,7 +22,7 @@ export const Video = (props: VideoProps) => {
<p>{props.title}</p>
<video controls onPlaying={() => playVideo(true)} onPause={() => playVideo(false)}>
<source type='video/mp4' src={"./assets/movies/"+props.value+VIDEO_SUFFIX}></source>
<track kind="subtitles" label="English" srcLang="en" src={"./assets/movies/"+props.value+SUBTITLE_SUFFIX} default/>
{language === 'en' && <track kind="subtitles" label="English" srcLang="en" src={"./assets/movies/"+props.value+SUBTITLE_SUFFIX} default/>}
Your browser does not support the video tag.
</video>
</div>);
Expand Down

0 comments on commit 3390ccc

Please sign in to comment.