Skip to content

Commit

Permalink
gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
sumanthvrao committed Sep 16, 2024
1 parent 3aa977e commit 5aecc82
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 1 deletion.
133 changes: 133 additions & 0 deletions css/grid-gallery.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
.gg-container {
--main-color: #000;
--secondary-color: #111;
--txt-color: #fff;
--img-bg-color: rgba(240, 240, 240, 0.9);
--backdrop-color: rgba(240, 240, 240, 0.9);
--gap-length: 2px;
--row-height: 200px;
--column-width: 220px;
}

.gg-container *[data-theme="dark"] {
--main-color: #ddd;
--secondary-color: #eee;
--txt-color: #111;
--img-bg-color: rgba(20, 20, 20, 0.9);
--backdrop-color: rgba(30, 30, 30, 0.9);
}

.gg-box {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(var(--column-width), 1fr));
grid-auto-rows: var(--row-height);
grid-gap: var(--gap-length);
margin: 20px 0;
}

.gg-box img {
object-fit: cover;
cursor: pointer;
width: 100%;
height: 100%;
background: var(--img-bg-color);
}

.gg-box img:hover {
opacity: 0.98;
}

#gg-screen {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: var(--backdrop-color);
z-index: 9999;
text-align: center;
}

#gg-screen .gg-image {
height: 100%;
display: inline-flex;
justify-content: center;
align-items: center;
}

#gg-screen .gg-image img {
max-width: 100%;
max-height: 100%;
margin: 0 auto;
}

.gg-btn {
width: 35px;
height: 35px;
background: var(--main-color);
color: var(--txt-color);
text-align: center;
line-height: 35px;
cursor: pointer;
-moz-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
-webkit-transition: all 0.4s ease;
transition: all 0.4s ease;
font-size: 20px;
box-sizing: border-box;
padding-left: 2px;
position: fixed;
bottom: 10px;
}

.gg-btn:hover {
background: var(--secondary-color);
}

.gg-close {
top: 10px;
}

.gg-close,
.gg-next {
right: 10px;
}

.gg-prev {
right: 50px;
}

.gg-prev,
.gg-next {
bottom: 10px;
}

@media (min-width: 478px) {
.gg-box img:nth-child(3n):not(:last-of-type) {
grid-row-end: span 2;
}

[data-layout="horizontal"] img:nth-child(2n):not(:last-of-type) {
grid-column-end: span 2;
grid-row-end: span 1;
}

[data-layout="square"] img:nth-child(2n):not(:last-of-type) {
grid-row-end: span 1;
grid-column-end: span 1;
}
}

@media (max-width: 768px) {
.gg-box {
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
grid-auto-rows: calc(var(--row-height) - 12vh);
margin: 10px 0;
}
}

@media (max-width: 450px) {
.gg-box {
grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
}
1 change: 1 addition & 0 deletions css/grid-gallery.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-45GX6K04VS"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/grid-gallery.css"/>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
Expand Down Expand Up @@ -346,6 +347,20 @@ <h2 id='hobbies'>Hobbies</h2>
</p>
<br>

<h2>Gallery</h2>
<div class="gg-container">
<div class="gg-box">
<img src="photos/hospital_2024.jpeg">
<img src="photos/hike_2022.jpg">
<img src="photos/imc_2023.jpg">
<img src="photos/ragnar_2023.jpg">
<img src="photos/funny_2023.jpeg">

</div>
</div>



<!-- <h2>Blog</h2> -->
<!-- Insert scrollable up button here for top of the page; and move it to the right -->
<!-- <a href="#" class="back-to-top scrollToTop">Scroll To Top</a> -->
Expand All @@ -358,6 +373,7 @@ <h2 id='hobbies'>Hobbies</h2>
</button>

</div>
<script type="text/javascript" src="js/grid-gallery.js"></script>
</body>

</html>
Binary file added photos/funny_2023.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added photos/hike_2022.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added photos/hospital_2024.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added photos/imc_2023.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added photos/ragnar_2023.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion research.html

This file was deleted.

0 comments on commit 5aecc82

Please sign in to comment.