Skip to content

Commit ec37932

Browse files
author
Tino Mettler
committed
CSS cleanup, separate functional and visual CSS code
Added file style.css which is aimed to contain CSS code that affects the look of the gallery. This could be extended to provide different or user-modified styles to give each gallery an individual look.
1 parent b0373f7 commit ec37932

File tree

4 files changed

+86
-95
lines changed

4 files changed

+86
-95
lines changed

data/website_gallery/css/gallery.css

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,16 @@
1515
along with this software. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
body {
19-
font-family: system-ui, Arial, Helvetica, sans-serif;
20-
background-color: rgb(238, 240, 242);
21-
}
22-
23-
.heading h1 {
24-
text-align: center;
25-
background-color: #cdd;
26-
color: black;
27-
display: grid;
28-
}
29-
30-
.heading h1:after {
31-
content: " ";
32-
border-bottom: 1px solid #888888;
33-
height: 1px;
34-
}
35-
3618
.gallery {
3719
display: flex;
3820
flex-wrap: wrap;
3921
justify-content: center;
4022
align-items: center;
41-
gap: 3vw;
42-
margin: 3vw auto;
43-
padding: 1.5vw;
4423
}
4524

46-
.slider {
47-
margin: 0;
48-
padding: 0;
49-
}
50-
51-
5225
.gallery img {
5326
cursor: pointer;
5427
object-fit: contain;
55-
background: none;
56-
padding: 0;
57-
border: 1px outset #737780;
58-
59-
}
60-
61-
.gallery img:hover {
62-
transform: scale(1.08);
6328
}
6429

6530
.thumb {
@@ -76,38 +41,4 @@ body {
7641
align-items: center;
7742
object-fit: contain;
7843
justify-content: center;
79-
background: none;
80-
box-shadow: 0 1vw 4vw 1vw rgba(0,0,0,0.6);
81-
}
82-
83-
.navgrid {
84-
font-size: 3.5vh;
85-
display: grid;
86-
grid-template-columns: 4em 1fr 1.5em 1.5em 1fr 1.5em 1.5em;
87-
grid-column-gap: 1vw;
88-
background-color: black;
89-
}
90-
91-
.nav {
92-
height: 5vh;
93-
background-color: rgba(60,60,60, 0.4);
94-
justify-content: center;
95-
align-items: center;
96-
display: flex;
97-
z-index: 1001;
98-
color: #ccc;
99-
}
100-
101-
.counter {
102-
font-size: 2.5vh;
103-
}
104-
105-
.button {
106-
cursor: pointer;
107-
}
108-
109-
.button:hover {
110-
cursor: pointer;
111-
color: white;
112-
text-shadow: 0px 0px 10px #ccc;
11344
}

data/website_gallery/css/modal.css

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@
2020
padding: 0;
2121
box-sizing: border-box;
2222
}
23-
body {
24-
margin: 0;
25-
padding: 0;
26-
width: 100vw;
27-
height: 100vh;
28-
background: #000;
29-
display: flex;
30-
flex-direction: column;
31-
}
3223

3324
.viewer {
3425
position: relative;
@@ -39,10 +30,20 @@ body {
3930
display: none;
4031
}
4132

33+
.navgrid {
34+
display: grid;
35+
}
36+
37+
.nav {
38+
justify-content: center;
39+
align-items: center;
40+
display: flex;
41+
z-index: 1001;
42+
}
43+
4244
.slider {
4345
position: relative;
4446
width: 100vw;
45-
height: 95vh;
4647
touch-action: none;
4748
overflow: hidden;
4849
}
@@ -69,8 +70,6 @@ body {
6970
will-change: contents;
7071
overflow: hidden;
7172
position: relative;
72-
padding: 0;
73-
margin: 0;
7473
touch-action: none;
7574
object-fit: contain;
7675
}
@@ -80,8 +79,6 @@ body {
8079
max-height: 100%;
8180
width: auto;
8281
height: auto;
83-
padding: 0;
84-
margin: 0;
8582
display: block;
8683
transform-origin: 0 0;
8784
cursor: zoom-in;
@@ -98,15 +95,3 @@ body {
9895
transition: transform 0.2s ease-out;
9996
}
10097

101-
.nav-bar {
102-
width: 100vw;
103-
height: 5vh;
104-
background: #333;
105-
color: #fff;
106-
display: flex;
107-
align-items: center;
108-
padding-left: 20px;
109-
box-sizing: border-box;
110-
font-family: Arial, sans-serif;
111-
font-size: 16px;
112-
}

data/website_gallery/css/style.css

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
body {
2+
font-family: system-ui, Arial, Helvetica, sans-serif;
3+
background-color: rgb(238, 240, 242);
4+
width: 100vw;
5+
height: 100vh;
6+
display: flex;
7+
flex-direction: column;
8+
}
9+
10+
.heading h1 {
11+
text-align: center;
12+
background-color: #cdd;
13+
color: black;
14+
display: grid;
15+
}
16+
17+
.heading h1:after {
18+
content: " ";
19+
border-bottom: 1px solid #888888;
20+
height: 1px;
21+
}
22+
23+
.gallery {
24+
gap: 3vw;
25+
margin: 3vw auto;
26+
padding: 1.5vw;
27+
}
28+
29+
.gallery img {
30+
background: none;
31+
border: 1px outset #737780;
32+
33+
}
34+
35+
.gallery img:hover {
36+
transform: scale(1.08);
37+
}
38+
39+
.thumb-box {
40+
background: none;
41+
box-shadow: 0 1vw 4vw 1vw rgba(0,0,0,0.6);
42+
}
43+
44+
.nav {
45+
height: 5vh;
46+
background-color: rgba(60,60,60, 0.4);
47+
color: #ccc;
48+
}
49+
50+
.slider {
51+
height: 95vh; /* remaining vh after nav vh */
52+
}
53+
54+
.navgrid {
55+
grid-template-columns: 4em 1fr 1.5em 1.5em 1fr 1.5em 1.5em;
56+
font-size: 3.5vh;
57+
grid-column-gap: 1vw;
58+
background-color: black;
59+
}
60+
61+
.button {
62+
cursor: pointer;
63+
}
64+
65+
.button:hover {
66+
cursor: pointer;
67+
color: white;
68+
text-shadow: 0px 0px 10px #ccc;
69+
}
70+
71+
.counter {
72+
font-size: 2.5vh;
73+
}
74+

data/website_gallery/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
77
<link rel="stylesheet" href="css/modal.css">
88
<link rel="stylesheet" href="css/gallery.css">
9+
<link rel="stylesheet" href="css/style.css">
910
<title id="page-title">Image Gallery</title>
1011

1112

0 commit comments

Comments
 (0)