-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_youtube.scss
152 lines (131 loc) · 2.99 KB
/
_youtube.scss
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
142
143
144
145
146
147
148
149
150
151
152
// Import references
@import "../../references.scss";
// -----------------------------------------------------------------------------
// This file contains styling for the yotube component
// -----------------------------------------------------------------------------
/// Local variables
$youtube-icon-color : rgb(3.2%, 52.7%, 40.8%) !default;
$youtube-icon-background-color : #fff !default;
/// ========================================================================
/// DIVIDER
/// ========================================================================
.youtube,
youtube {
display: block;
position: relative;
width: 100%;
height: 100%;
z-index: 1;
overflow: hidden;
}
//--- ELEMENTS ----------------------------------------------------------//
.youtube__image {
transition: opacity 400ms ease;
position: absolute;
left: 0;
top: 0;
z-index: 3;
width: 100%;
height: 100%;
background-size: cover;
background-position: 50% 50%;
background-repeat: no-repeat;
img {
object-fit: cover;
width: 100%;
height: 100%;
}
}
.youtube__video {
left: -2%;
top: -2%;
display: block;
position: relative;
width: 104%;
height: 104%;
}
.youtube__icon {
cursor: pointer;
display: flex;
position: absolute;
left: 0;
top: 0;
z-index: 4;
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
text-align: center;
font-size: 24px;
opacity: 0;
color: $youtube-icon-color;
& > * {
font-size: inherit;
line-height: 0; // Fix for icon alignment
position: relative;
background-color: $youtube-icon-background-color;
&::after {
content: "";
display: block;
position: absolute;
background-color: inherit;
left: -40%;
top: -40%;
width: 180%;
padding-bottom: 180%;
border-radius: 10%;
z-index: -1;
}
}
}
.youtube__iframe {
width: 100%;
height: 100%;
}
//--- MODIFIERS ----------------------------------------------------------//
.youtube_ready {
.youtube__icon {
opacity: 1;
}
}
.youtube_started {
.youtube__image,
.youtube__icon {
display: none;
}
}
.youtube_playing {
z-index: 1;
.youtube__image {
opacity: 0;
}
.youtube__icon {
opacity: 0;
}
}
.youtube_paused {
.youtube__image {
}
.youtube__icon {
opacity: 1;
}
}
.youtube_error {
.youtube__image {
opacity: 0;
}
.youtube__icon {
opacity: 0;
}
}
// This lets ios click go though the elements and interacting with the youtube player directly.
// Allowing to have custom overlay on iphone and ipad
.youtube_ios {
.youtube__image {
pointer-events: none;
}
.youtube__icon {
pointer-events: none;
}
}
//--- MEDIA QUERIES ----------------------------------------------------------//