-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacro.html
More file actions
277 lines (246 loc) · 12.5 KB
/
macro.html
File metadata and controls
277 lines (246 loc) · 12.5 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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE HTML>
<html>
<head>
<title>Max Patwardhan - Macro Photography</title>
<link rel="icon" type="image/png" href="images/personal/icon.png">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
<noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
</head>
<body class="is-preload">
<!-- Wrapper -->
<div id="wrapper">
<!-- Header -->
<header id="header">
<a href="index.html" class="logo">Home</a>
</header>
<!-- Nav -->
<nav id="nav">
<ul class="links">
<li><a href="index.html">Projects</a></li>
<li class="active"><a href="macro.html">Photography</a></li>
<li><a href="elements.html">About Me</a></li>
</ul>
<ul class="icons">
<li><a href="https://github.com/MaxPatwardhan" class="icon brands fa-github"><span class="label">GitHub</span></a></li>
<li><a href="https://www.linkedin.com/in/maxwell-patwardhan" class="icon brands alt fa-linkedin-in"><span class="label">LinkedIn</span></a></li>
</ul>
</nav>
<!-- Main -->
<div id="main">
<section class="post">
<header class="major">
<h2>Macro</h2>
<p>I occasionally remember to update this</p>
</header>
<!-- Gallery -->
<div class="box alt">
<div class="row gtr-50 gtr-uniform">
<!--
To add a new photo:
1. Drop your image file into images/macro/
2. Copy one of the col-4 blocks below
3. Update the src to point to your image (e.g., src="images/macro/your-photo.jpg")
4. Update the alt, data-description, and caption text
-->
<!-- Photo 1 -->
<div class="col-4">
<span class="image fit">
<img src="images/macro/bug_compressed.jpg" alt="Macro photo" class="gallery-item" data-description="This guy photobombed me but was nice enough to stay still for the focus stacking" />
<p class="caption">Board in need of debug</p>
</span>
</div>
<!-- Photo 2 -->
<div class="col-4">
<span class="image fit">
<img src="images/macro/horsey.jpg" alt="Macro photo" class="gallery-item" data-description="Circa 1965" />
<p class="caption">Canvas henna painting </p>
</span>
</div>
<!-- Photo 3 -->
<div class="col-4">
<span class="image fit">
<img src="images/macro/lillies.jpg" alt="Macro photo" class="gallery-item" data-description="" />
<p class="caption">Lillies</p>
</span>
</div>
<!-- Photo 4 -->
<div class="col-4">
<span class="image fit">
<img src="images/macro/rope.jpg" alt="Macro photo" class="gallery-item" data-description="" />
<p class="caption">Rope</p>
</span>
</div>
<!-- Photo 5 -->
<div class="col-4">
<span class="image fit">
<img src="images/macro/wafer_jpg.jpg" alt="Macro photo" class="gallery-item" data-description="" />
<p class="caption">Chip array</p>
</span>
</div>
<!-- Photo 6 -->
<div class="col-4">
<span class="image fit">
<img src="images/macro/watch_comp.jpg" alt="Macro photo" class="gallery-item" data-description="" />
<p class="caption">Mechanical, non-hacking watch</p>
</span>
</div>
<!-- Photo 6 -->
<div class="col-4">
<span class="image fit">
<img src="images/macro/chip_2.jpg" alt="Macro photo" class="gallery-item" data-description="" />
<p class="caption">A rock we tricked into thinking</p>
</span>
</div>
<!-- Photo 6 -->
<div class="col-4">
<span class="image fit">
<img src="images/macro/palmburd_1_jpg.jpg" alt="Macro photo" class="gallery-item" data-description="" />
<p class="caption">The blurring of the FFC's on the stack upsets me beyond measure</p>
</span>
</div>
</div>
</div>
</section>
</div>
<!-- Footer -->
<footer id="footer">
<section>
<div style="display: flex; align-items: center; gap: 10px;">
<h3 style="margin: 0;">Email:</h3>
<p style="margin: 0;"><a href="mailto:maxwellpatwardhan@gmail.com">maxwellpatwardhan@gmail.com</a></p>
</div>
<div style="display: flex; align-items: center; gap: 10px;">
<h3 style="margin: 0;">Other Pages:</h3>
<ul class="icons alt" style="display: flex; gap: 10px; list-style: none; padding: 0; margin: 0;">
<li><a href="https://github.com/MaxPatwardhan" class="icon brands alt fa-github"><span class="label">GitHub</span></a></li>
<li><a href="https://www.linkedin.com/in/maxwell-patwardhan" class="icon brands alt fa-linkedin-in"><span class="label">LinkedIn</span></a></li>
</ul>
</div>
</section>
</footer>
</div>
<!-- Lightbox (outside #wrapper so footer cannot overlap) -->
<div id="macro-lightbox" style="display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.85); z-index:100000; justify-content:center; align-items:center; cursor:zoom-out;">
<span id="macro-lightbox-close" style="position:absolute; top:20px; right:30px; font-size:36px; color:#fff; cursor:pointer; z-index:100001;">×</span>
<p id="macro-lightbox-desc" style="position:absolute; bottom:20px; left:0; right:0; text-align:center; color:#fff; font-size:18px; margin:0; pointer-events:none;"></p>
<div id="macro-lightbox-container" style="overflow:hidden; max-width:70vw; max-height:80vh; display:flex; justify-content:center; align-items:center; cursor:grab;">
<img id="macro-lightbox-img" src="" alt="Enlarged view" style="max-width:100%; max-height:80vh; border-radius:8px; transition:transform 0.15s ease; transform-origin:center center;" />
</div>
</div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.scrollex.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/browser.min.js"></script>
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
var lb = document.getElementById("macro-lightbox");
var img = document.getElementById("macro-lightbox-img");
var desc = document.getElementById("macro-lightbox-desc");
var container = document.getElementById("macro-lightbox-container");
var closeBtn = document.getElementById("macro-lightbox-close");
var scale = 1;
var minScale = 1;
var maxScale = 5;
var panning = false;
var startX = 0, startY = 0, translateX = 0, translateY = 0, lastTX = 0, lastTY = 0;
function resetZoom() {
scale = 1; translateX = 0; translateY = 0; lastTX = 0; lastTY = 0;
img.style.transform = "scale(1)";
container.style.cursor = "grab";
}
function applyTransform() {
img.style.transform = "scale(" + scale + ") translate(" + (translateX / scale) + "px, " + (translateY / scale) + "px)";
}
// Open lightbox
document.querySelectorAll(".gallery-item").forEach(function (item) {
item.addEventListener("click", function () {
img.src = this.src;
desc.textContent = this.getAttribute("data-description") || "";
resetZoom();
lb.style.display = "flex";
});
});
// Close lightbox
function closeLightbox() {
lb.style.display = "none";
img.src = "";
desc.textContent = "";
resetZoom();
}
closeBtn.addEventListener("click", closeLightbox);
lb.addEventListener("click", function (e) {
if (e.target === lb) closeLightbox();
});
// Scroll to zoom
container.addEventListener("wheel", function (e) {
e.preventDefault();
var delta = e.deltaY > 0 ? -0.15 : 0.15;
scale = Math.min(maxScale, Math.max(minScale, scale + delta));
if (scale <= 1) { translateX = 0; translateY = 0; lastTX = 0; lastTY = 0; }
applyTransform();
container.style.cursor = scale > 1 ? "grab" : "grab";
}, { passive: false });
// Pan when zoomed in
container.addEventListener("mousedown", function (e) {
if (scale <= 1) return;
panning = true;
startX = e.clientX; startY = e.clientY;
container.style.cursor = "grabbing";
e.preventDefault();
});
document.addEventListener("mousemove", function (e) {
if (!panning) return;
translateX = lastTX + (e.clientX - startX);
translateY = lastTY + (e.clientY - startY);
applyTransform();
});
document.addEventListener("mouseup", function () {
if (!panning) return;
panning = false;
lastTX = translateX; lastTY = translateY;
container.style.cursor = scale > 1 ? "grab" : "grab";
});
// Touch pinch-to-zoom
var lastTouchDist = 0;
container.addEventListener("touchstart", function (e) {
if (e.touches.length === 2) {
lastTouchDist = Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
} else if (e.touches.length === 1 && scale > 1) {
panning = true;
startX = e.touches[0].clientX; startY = e.touches[0].clientY;
}
}, { passive: true });
container.addEventListener("touchmove", function (e) {
if (e.touches.length === 2) {
e.preventDefault();
var dist = Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
var delta = (dist - lastTouchDist) * 0.01;
scale = Math.min(maxScale, Math.max(minScale, scale + delta));
if (scale <= 1) { translateX = 0; translateY = 0; lastTX = 0; lastTY = 0; }
applyTransform();
lastTouchDist = dist;
} else if (panning && e.touches.length === 1) {
translateX = lastTX + (e.touches[0].clientX - startX);
translateY = lastTY + (e.touches[0].clientY - startY);
applyTransform();
}
}, { passive: false });
container.addEventListener("touchend", function () {
panning = false;
lastTX = translateX; lastTY = translateY;
lastTouchDist = 0;
});
// Escape key closes
document.addEventListener("keydown", function (e) {
if (e.key === "Escape") closeLightbox();
});
});
</script>
</body>
</html>