forked from GCA-Classroom/02-prj-intel-sustainability
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
192 lines (173 loc) · 4 KB
/
style.css
File metadata and controls
192 lines (173 loc) · 4 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
/* Add your CSS here */
/* Reset basic default spacing */
body {
margin: 0;
font-family: 'Courier', Courier, monospace;
background-color: #f4f4f4;
color: #333;
}
/* Style the header / hero section */
header {
background-color: #003c71; /* Intel Blue */
color: white;
padding: 40px 20px;
text-align: center;
}
header img {
width: 300px;
margin-bottom: 20px;
}
header h1 {
font-size: 2em;
margin: 0;
}
header p {
font-size: 1.2em;
max-width: 600px;
margin: 10px auto 0;
}
/* Center the instructions text under the header */
.instructions {
text-align: center;
font-size: 1em;
margin: 20px 0 0 0;
}
/* Make the timeline section scroll horizontally */
section {
display: flex;
overflow-x: auto; /* enables horizontal scroll */
padding: 20px;
gap: 20px;
scroll-behavior: smooth;
/* Show only 3 cards at a time */
max-width: 980px; /* 3 cards * 300px + 2*20px gap = 960px */
margin: 0 auto; /* center the timeline */
/* Enable scroll snap for timeline cards */
scroll-snap-type: x mandatory;
}
/* Timeline card styles */
section div {
background-color: white;
flex: 0 0 300px; /* fixed width for each card */
border-radius: 10px;
padding: 15px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
transition: transform 0.3s ease;
position: relative;
overflow: hidden;
/* Snap each card to the scroll position */
scroll-snap-align: start;
}
/* On hover: slightly zoom card */
section div:hover {
transform: scale(1.05);
}
/* Style for headings inside the cards */
section h2 {
margin-top: 0;
font-size: 1.5em;
color: #003c71;
}
section h3 {
margin: 5px 0;
font-size: 1.2em;
}
/* Card images */
section img {
width: 100%;
height: 180px;
border-radius: 5px;
object-fit: cover;
margin: 10px 0;
}
/* Paragraphs inside cards - hidden by default */
section p {
font-size: 0.95em;
line-height: 1.4;
transition: max-height 0.3s ease, opacity 0.3s ease;
max-height: 0;
overflow: hidden;
opacity: 0;
/* Add absolute positioning for reveal effect */
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #003c71;
color: #fff;
padding: 20px;
box-sizing: border-box;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
pointer-events: none; /* Prevent accidental selection when hidden */
}
/* Hide image and titles on card hover */
section div:hover img,
section div:hover h2,
section div:hover h3 {
opacity: 0;
transition: opacity 0.3s ease;
}
/* Show paragraph text on hover, covering the full card */
section div:hover p {
max-height: 1000px;
opacity: 1;
pointer-events: auto;
}
/* Timeline arrow indicators */
.timeline-arrows {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 980px;
margin: 10px auto 0 auto;
padding: 0 30px;
}
.arrow {
font-size: 2em;
color: #003c71;
user-select: none;
pointer-events: none; /* purely visual */
}
/* Hide arrows on small screens (vertical timeline) */
@media (max-width: 600px) {
.timeline-arrows {
display: none;
}
section {
flex-direction: column; /* Stack cards vertically */
overflow-x: unset; /* Remove horizontal scroll */
overflow-y: auto; /* Enable vertical scroll if needed */
max-height: 80vh; /* Limit height so user can scroll */
gap: 20px;
max-width: 100%; /* Remove width limit on small screens */
/* Remove scroll snap on vertical layout */
scroll-snap-type: none;
}
section div {
width: 100%; /* Cards take full width */
max-width: 100%;
/* Remove scroll snap on vertical layout */
scroll-snap-align: unset;
}
/* Reduce header image and text size*/
header img {
width: 180px;
margin-bottom: 12px;
}
header h1 {
font-size: 1.2em;
}
header p {
font-size: 1em;
max-width: 95vw;
}
/* Make instructions smaller on small screens */
.instructions {
font-size: 0.7em;
}
}