Skip to content

Commit d9a8cc1

Browse files
committed
added the gallery tab
1 parent 6278a1b commit d9a8cc1

File tree

2 files changed

+93
-8
lines changed

2 files changed

+93
-8
lines changed

_pages/gallery.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
layout: page
3+
permalink: /gallery/
4+
title: Gallery
5+
# description: Miscellaneous
6+
nav: true
7+
nav_order: 8
8+
---
9+
10+
<div class="carousel" style="text-align: center;">
11+
<div style="position: relative; display: inline-block;">
12+
<div class="carousel-slide">
13+
<img class="carousel-image" src="/assets/img/lab_photo.jpg" alt="Lab Photo" style="width:600px;">
14+
<div class="caption">KGML Team</div>
15+
</div>
16+
17+
<div class="carousel-slide" style="display:none;">
18+
<img class="carousel-image" src="/assets/img/jie_grad_celebration.jpg" alt="Graduation Celebration" style="width:600px;">
19+
<div class="caption">Jie’s PhD Defense Celebration</div>
20+
</div>
21+
22+
<button class="prev" onclick="changeSlide(-1)">&#10094;</button>
23+
<button class="next" onclick="changeSlide(1)">&#10095;</button>
24+
25+
</div>
26+
</div>
27+
28+
<script>
29+
let slideIndex = 0;
30+
showSlides(slideIndex);
31+
32+
function changeSlide(n) {
33+
showSlides(slideIndex += n);
34+
}
35+
36+
function showSlides(n) {
37+
let i;
38+
let slides = document.getElementsByClassName("carousel-slide");
39+
if (n >= slides.length) { slideIndex = 0 }
40+
if (n < 0) { slideIndex = slides.length - 1 }
41+
for (i = 0; i < slides.length; i++) {
42+
slides[i].style.display = "none";
43+
}
44+
slides[slideIndex].style.display = "block";
45+
}
46+
</script>
47+
48+
<style>
49+
.carousel {
50+
position: relative;
51+
max-width: 100%;
52+
}
53+
54+
.carousel-image {
55+
width: 600px;
56+
height: auto;
57+
display: block;
58+
margin: 0 auto;
59+
}
60+
61+
.prev, .next {
62+
position: absolute;
63+
top: 50%;
64+
font-size: 18px;
65+
padding: 16px;
66+
cursor: pointer;
67+
background-color: rgba(0, 0, 0, 0.5);
68+
color: white;
69+
border: none;
70+
transform: translateY(-50%);
71+
z-index: 1;
72+
}
73+
74+
.prev {
75+
left: -50px;
76+
}
77+
78+
.next {
79+
right: -50px;
80+
}
81+
82+
.caption {
83+
text-align: center;
84+
color: #333;
85+
font-size: 16px;
86+
margin-top: 10px;
87+
font-style: italic;
88+
}
89+
90+
.carousel-slide {
91+
position: relative;
92+
}
93+
</style>

_pages/misc.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)