-
Notifications
You must be signed in to change notification settings - Fork 0
/
randomImageTimer.css
77 lines (60 loc) · 1.62 KB
/
randomImageTimer.css
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
@import url('https://fonts.googleapis.com/css2?family={{timerFontFamily}}');
.main-container {
width: 100%;
height: 95%;
/* Arranges the elements. */
display: flex;
flex-direction: {{timerPosition}};
}
#display {
/* 'Absolute' elements are positioned relative to their closest positioned
* ancestors. */
position: relative;
/* This element takes up all the remaining space. */
min-height: 0;
flex: 1;
}
#display > div {
/* For layering. */
position: absolute;
/* Each layer takes up all the space of its parent. */
width: 100%;
height: 100%;
}
#img-layer img {
/* Used by object-fit property. */
width: 100%;
height: 100%;
/* The replaced content is made to fill the box, while preserving its aspect
* ratio. */
object-fit: contain;
}
#overlay * {
position: absolute;
/* Centers any children of the 'overlay' element. */
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
/* Centers the text horizontally and line-height-wise. */
text-align: center;
vertical-align: middle;
font-family: sans-serif;
font-size: 15vmin;
color: white;
background-color: rgba(0, 0, 0, 0.333);
}
#timer {
/* Doesn't grow and is therefore the limiting factor of #display. */
flex: none;
font-family: {{timerFontFamily}};
font-size: {{timerFontSize}}px;
color: {{timerFontColor}};
text-align: {{timerAlignment}};
}
#img-layer, #overlay, #timer {
/* The 'transitionend' event is used to coordinate functions. Therefore any
* kind of transition is mandatory for the widget to work properly. */
opacity: 0;
transition: opacity 1.5s;
}