Skip to content

Commit

Permalink
style: Reformats code
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Hui committed Apr 24, 2024
1 parent 46a265f commit 48c5f71
Showing 1 changed file with 52 additions and 59 deletions.
111 changes: 52 additions & 59 deletions _includes/gallery_component.html
Original file line number Diff line number Diff line change
@@ -1,69 +1,62 @@
<div class="gallery">
{%- for media_url in include.media -%}
<div class="image_container">
<img
src="{{site.url | append: "/" | append: media_url}}"
class="gallery_img"
decoding="async" alt="">
</div>
{%- endfor -%}
<div class="image_container">
<img src="{{site.url | append: " /" | append: media_url}}" class="gallery_img" decoding="async" alt="">
</div>

{%- endfor -%}
</div>


{%- if include.grid -%}
<!-- https://www.w3schools.com/css/css_grid.asp -->
<style>
.gallery {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-evenly;
/* grid-template-columns: auto auto auto; */
gap: 10px;
}

{%- if include.grid -%}
<!-- https://www.w3schools.com/css/css_grid.asp -->
<style>
.gallery {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-evenly;
/* grid-template-columns: auto auto auto; */
gap: 10px;
}
.image_container {
height: 200px;
width: 200px;
}

.image_container {
height: 200px;
width: 200px;
}
img {
object-fit: cover;
width: 100%;
height: 100%;
}
</style>
{% else %}
<!-- the css to handle nice image resizing from-->
<!-- https://blog.logrocket.com/responsive-image-gallery-css-flexbox/ -->
<style>
.gallery {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
gap: 10px;
}

img {
object-fit: cover;
width: 100%;
height: 100%;
}


</style>
{% else %}
<!-- the css to handle nice image resizing from-->
<!-- https://blog.logrocket.com/responsive-image-gallery-css-flexbox/ -->
<style>
.gallery {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
gap: 10px;
}
.gallery::after {
content: "";
flex-grow: 999;

.gallery::after {
content: "";
flex-grow: 999;

}
}

.image_container {
height: 300px;
}
.image_container {
height: 300px;
}

img {
object-fit: cover;
width: 100%;
height: 100%;
flex: 1 1 auto;
}


</style>
{%- endif -%}
img {
object-fit: cover;
width: 100%;
height: 100%;
flex: 1 1 auto;
}
</style>
{%- endif -%}
</div>

0 comments on commit 48c5f71

Please sign in to comment.