-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVideo.js
141 lines (129 loc) · 3.33 KB
/
Video.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import React from "react";
import { styled, css, connect } from "frontity";
import * as Variables from "../../styles/Variables";
import * as Mixins from "../../styles/Mixins";
const VideoTab = ({
backgroundColor,
sectionHeader,
sectionDescription,
videoContent,
}) => {
return (
<Section backgroundColor={backgroundColor}>
<SectionHeader>{sectionHeader}</SectionHeader>
<SectionDescription>{sectionDescription}</SectionDescription>
<VideosContainer>
{videoContent.map((videoBlock, videoBlockIndex) => {
const { videoBlockHeader, videoBlockDescription, video } = videoBlock;
return (
<VideoWrapper
backgroundColor={backgroundColor}
key={`video-${videoBlockIndex}`}
>
{videoBlockHeader && (
<VideoHeader>{videoBlockHeader}</VideoHeader>
)}
{videoBlockDescription && (
<VideoDescription>{videoBlockDescription}</VideoDescription>
)}
<Video
src={video.src}
loading="lazy"
title={video.title}
frameBorder="0"
allow={video.allow}
allowFullScreen={true}
/>
</VideoWrapper>
);
})}
</VideosContainer>
</Section>
);
};
export default connect(VideoTab);
const Section = styled.section`
${(props) =>
props.backgroundColor === "dark" &&
Mixins.addColors(Variables.colorBlack, Variables.colorWhite)};
`;
const SectionHeader = styled.h2`
text-align: center;
padding-top: 1.5rem;
${Mixins.addHeadingFont(700, 3.5)};
margin: 0 1rem;
text-shadow: ${Variables.textShadow};
`;
const SectionDescription = styled.p`
text-align: center;
font-size: 1.75rem;
padding: 0 3rem;
`;
const VideosContainer = styled.article`
display: flex;
flex-wrap: wrap;
justify-content: space-around;
gap: 3rem;
`;
const VideoWrapper = styled.figure`
padding: 1rem 3rem;
margin: 3rem 2rem 5rem 2rem;
background-color: ${(props) =>
props.backgroundColor === "dark" && Variables.colorRedDeep1};
border-radius: 1rem;
text-align: center;
max-width: min-content;
@media (max-width: ${Variables.query1000}) {
margin: 0 2rem;
&:last-child {
margin-bottom: 4rem;
}
}
@media (max-width: ${Variables.query600}) {
padding: 1rem;
}
`;
const VideoHeader = styled.h3`
${Mixins.addHeadingFont(400, 3)};
text-decoration: underline;
`;
const Video = styled.iframe`
width: 60rem;
height: 32rem;
box-shadow: ${Variables.boxShadow};
@media (max-width: ${Variables.query1450}) {
width: 50rem;
height: 28rem;
}
@media (max-width: ${Variables.query1250}) {
width: 35rem;
height: 19rem;
}
@media (max-width: ${Variables.query1000}) {
width: 60rem;
height: 32rem;
}
@media (max-width: ${Variables.query750}) {
width: 50rem;
height: 28rem;
}
@media (max-width: ${Variables.query600}) {
width: 35rem;
height: 19rem;
}
@media (max-width: ${Variables.query600}) {
width: 35rem;
height: 19rem;
}
@media (max-width: ${Variables.query400}) {
width: 26rem;
height: 14rem;
}
`;
const VideoDescription = styled.p`
font-size: 1.75rem;
padding-bottom: 1rem;
@media (max-width: ${Variables.query600}) {
padding-bottom: 0;
}
`;