-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
224 lines (196 loc) · 9.08 KB
/
Copy pathindex.html
File metadata and controls
224 lines (196 loc) · 9.08 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<html lang="en">
<head>
<base href="/" />
<meta charset="utf-8" />
<title>Rat Watch</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Rat Watch — Baltimore freak-bike collective. Builds, rides, and community projects." />
<meta property="og:title" content="Rat Watch" />
<meta property="og:description" content="Tall bikes, jousting, parades, and weekly builds in Baltimore." />
<link rel="canonical" href="https://www.ratwatch.org/" />
<base href="/" />
<link rel="icon" href="/images/favicon.svg" type="image/svg+xml" />
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;600&display=swap" rel="stylesheet" />
<style>
:root{
--pad: clamp(16px,4vw,40px);
--gap: 14px;
--bg: #0f1013;
--fg: #e9ebef;
--muted:#a1a7af;
--card:#17181e;
--outline:#2a2b31;
--badge:#2c3037cc;
--badge2:#418a7bcc;
--accent:#9fd3c7;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--fg);font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif}
header{position:relative}
.hero{
position:relative; overflow:hidden;
height:min(68vh,720px); background:#000;
border-bottom:1px solid var(--outline);
}
.hero video{
position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.9;
filter:contrast(1.05) saturate(1.05);
}
.hero-overlay{
position:absolute; inset:0; background:linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.65));
display:grid; place-items:center; text-align:center; padding:0 var(--pad);
}
h1{
margin:0; font-family:"Bebas Neue",system-ui; letter-spacing:.5px;
font-size:clamp(40px,10vw,110px);
}
.tagline{margin:.2rem 0 1rem; color:var(--muted); font-weight:600}
nav{display:flex; gap:10px; justify-content:center; flex-wrap:wrap}
.btn{
padding:.6rem .95rem; border-radius:999px; border:1px solid var(--outline); background:#17181c; color:var(--fg);
text-decoration:none; transition:background .15s, transform .05s;
}
.btn:hover{background:#20222a}
.btn:active{transform:translateY(1px)}
main{padding: 24px var(--pad) 80px}
.intro{max-width:900px; margin:0 auto 22px; color:var(--muted); text-align:center; line-height:1.6}
/* Masonry grid */
.masonry{display:grid; grid-template-columns:repeat(auto-fill,minmax(400px,1fr)); grid-auto-rows:8px; gap:var(--gap); align-items:start}
.tile{position:relative; isolation: isolate; background:var(--card); border:1px solid var(--outline); border-radius:12px; overflow:hidden; box-shadow:0 2px 10px rgba(0,0,0,.25)}
.tile img{display:block; width:100%; height:auto; object-fit:cover; filter:saturate(1.03); transition:transform .25s}
.tile:hover img{transform:scale(1.03)}
.banner{position:absolute; left:10px; top:10px; max-width:86%; background:var(--badge); color:#f2f2f2;
padding:.45rem .6rem; border-radius:8px; font-weight:700; letter-spacing:.2px; box-shadow:0 3px 10px rgba(0,0,0,.25); backdrop-filter: blur(2px);}
.banner small{display:block; margin-top:.35rem; font-weight:500; opacity:.9}
.tag{position:absolute; right:10px; bottom:10px; background:var(--badge2); color:#fff; padding:.35rem .55rem; border-radius:8px; font-size:.85rem; box-shadow:0 3px 10px rgba(0,0,0,.25); backdrop-filter: blur(2px);}
footer{padding:40px var(--pad); color:var(--muted); border-top:1px solid var(--outline)}
footer a{color:var(--accent); text-decoration:none}
</style>
</head>
<body>
<header>
<div class="hero">
<video autoplay muted loop playsinline>
<source src="/images/projects/crew.mp4" type="video/mp4" />
</video>
<div class="hero-overlay">
<div>
<h1>Rat Watch</h1>
<p class="tagline">Baltimore freak-bike collective</p>
<nav aria-label="Primary">
<a class="btn" href="/projects/">Projects</a>
<a class="btn" href="/members/">Members</a>
<a class="btn" href="/mission/">Mission</a>
<a class="btn" href="/get_involved/">Get Involved</a>
<a class="btn" href="/contact/">Contact</a>
</nav>
</div>
</div>
</div>
</header>
<main>
<p class="intro">Build nights, tallbike rides, shenanigans, and community.</p>
<section id="gallery" class="masonry" aria-label="Collage"></section>
</main>
<footer>
© <span id="y"></span> Rat Watch · Baltimore ·
<a href="mailto:ratwatchbalt@proton.me">ratwatchbalt@proton.me</a> ·
<a href="https://www.instagram.com/ratwatchbalt/">@ratwatchbalt</a>
</footer>
<script>
document.getElementById('y').textContent = new Date().getFullYear();
// Global default (used only if an item doesn't specify its own base)
const BASE = "/images/";
const items = [
// ⚠️ Make sure the folder name matches reality: tall_bikes/ vs tallbikes/
{ base: "/images/projects/tall_bikes/", file: "brayden_flying.jpg", title: "Repair Bike", sub: "Tallbike", tag: "Build" },
{ base: "/images/projects/tall_bikes/", file: "group_tall.jpg", title: "Group", sub: "Tallbike", tag: "Ride" },
{ base: "/images/projects/building/maranda/", file: "more_welding.jpg", title: "Welding Mar-Machine", sub: "Tallbike", tag: "Build" },
{ base: "/images/projects/toilet_bowl/", file: "taj_toilet.jpg", title: "Toilet Bowl Race", sub: "Tallbike", tag: "Community" },
{ base: "/images/projects/building/", file: "brayden_welding.jpeg", title: "Brayden welding", sub: "Tallbike", tag: "Build" },
{ base: "/images/projects/mayors_parade", file: "tree_bike_1.jpg", title: "Christmas tree bike", sub: "Wild Ride", tag: "Community" },
];
const grid = document.getElementById("gallery");
const rowH = 20, gap = 8;
// --- URL helpers ------------------------------------------------------------
function joinURL(base, file){
const b = (base ?? "").replace(/\/+$/,"");
const f = (file ?? "").replace(/^\/+/,"");
return `${b}/${f}`;
}
function resolveSrc(it){
// 1) explicit src, 2) absolute file, 3) item.base+file, 4) BASE+file
if (it.src) return it.src;
if (/^(\/|https?:)/.test(it.file)) return it.file;
return joinURL(it.base || BASE, it.file);
}
function dirname(path){ return (path.match(/^(.*)\//) || ["",""])[1]; }
function basenameNoExt(path){
const name = path.split("/").pop() || "";
return name.replace(/\.(jpe?g|png|webp)$/i, "");
}
// Attach WebP srcset if responsive assets exist alongside the image
function attachResponsiveIfAvailable(img, folder, baseNoExt){
const test = new Image();
test.onload = () => {
img.srcset = [
joinURL(folder, `${baseNoExt}-400w.webp`) + " 400w",
joinURL(folder, `${baseNoExt}-600w.webp`) + " 600w",
joinURL(folder, `${baseNoExt}-800w.webp`) + " 800w",
joinURL(folder, `${baseNoExt}-1000w.webp`) + " 1000w",
].join(", ");
img.sizes = "(max-width: 640px) 50vw, (max-width: 1024px) 33vw, 25vw";
};
test.onerror = () => { /* keep base src only */ };
// Probe one expected size in the same folder
test.src = joinURL(folder, `${baseNoExt}-800w.webp`) + `?t=${Date.now()}`;
}
function makeTile(item){
const el = document.createElement("article");
el.className = "tile";
const img = document.createElement("img");
img.loading = "lazy";
img.decoding = "async";
img.alt = item.title || "";
const primary = resolveSrc(item); // full path incl. folder
const folder = dirname(primary) || "/"; // folder of this item
const baseNo = basenameNoExt(primary); // filename w/o ext
img.src = primary;
// Fallback chain: same folder, try .jpg then .jpeg
img.addEventListener("error", () => {
if (!img.dataset.f1){ img.dataset.f1 = 1; img.src = joinURL(folder, baseNo + ".jpg"); return; }
if (!img.dataset.f2){ img.dataset.f2 = 1; img.src = joinURL(folder, baseNo + ".jpeg"); return; }
});
// Optional responsive WebP set if present
attachResponsiveIfAvailable(img, folder, baseNo);
const banner = document.createElement("div");
banner.className = "banner";
banner.innerHTML = `${item.title || ""}<small>${item.sub || ""}</small>`;
const tag = document.createElement("div");
tag.className = "tag";
tag.textContent = item.tag || "";
el.append(img, banner, tag);
img.addEventListener("load", () => {
const h = el.getBoundingClientRect().height;
el.style.gridRowEnd = `span ${Math.ceil((h + gap) / rowH)}`;
});
return el;
}
// Render
items.forEach(it => grid.appendChild(makeTile(it)));
// Re-span on resize
let raf;
window.addEventListener("resize", () => {
cancelAnimationFrame(raf);
raf = requestAnimationFrame(() => {
document.querySelectorAll(".masonry .tile").forEach(el => {
const h = el.getBoundingClientRect().height;
el.style.gridRowEnd = `span ${Math.ceil((h + gap) / rowH)}`;
});
});
});
</script>
</body>
</html>