-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.css
113 lines (105 loc) · 1.97 KB
/
styles.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
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
html {
--light-grey: #aaa;
--mid-grey: #777;
}
body {
font-family: Helvetica, Arial, sans-serif;
background: #333;
color: #ddd;
}
p a {
color: #ddd;
}
/* ------- GALLERY PREVIEW STYLES ------- */
.gallery {
display: flex;
justify-content: center;
}
.gallery figure {
width: 100%;
overflow: hidden;
border: 1px solid var(--mid-grey);
margin: 5px;
transition: border-color .25s ease-in-out;
}
.gallery figure:hover {
border-color: var(--light-grey);
}
.gallery img {
display: block;
width: 100%;
object-fit: cover;
object-position: center;
}
/* ------- LIGHTBOX STYLES ------- */
/* Hides the lightbox and contents, sets their styles */
.lightbox {
opacity: 0;
position: fixed;
width: 100%;
height: 100%;
top: -100%;
left: 0;
background: rgba(10,10,10,.8);
transition: all .5s ease-in-out;
/* replace "all" with "opacity" stop the dropdown animation */
}
.lightbox figure {
box-sizing: border-box;
width: 100%;
max-height: 100%;
margin: 1% auto;
padding: 10px 20px;
background: inherit;
box-shadow: 0 0 40px 0 #000;
}
.lightbox figcaption {
display: block;
font-size: 0.75em;
margin-bottom: .75em;
}
.lightbox img {
display: block;
margin: 0 auto;
max-width: 100%;
max-height: 90vh;
}
.lightbox .close {
display: block;
width: 1em;
height: 1em;
text-align: center;
padding: 2px;
float: right;
text-decoration: none;
font-weight: bold;
color: inherit;
border: 2px solid var(--mid-grey);
border-radius: 2px;
transition: border-color .25s ease-in-out;
}
.lightbox .close:hover {
border-color: var(--light-grey);
}
/* Shows the lightbox only when targeted */
.lightbox:target {
opacity: 1;
outline: none;
top: 0;
}
.lightbox:target figure {
display: block;
}
/* ------- GALLERY PREVIEW ABOVE MOBLE ------- */
@media (min-width: 620px) {
.gallery figure {
border-width: 2px;
}
.gallery img {
/* adjust to suit */
height: 400px;
}
.lightbox figcaption {
font-size: 1em;
}
}