Skip to content

Commit

Permalink
Properly size thumbnail images with nonexistent/unavailable sources
Browse files Browse the repository at this point in the history
Adds some HTML and CSS to ensure that thumbnail images with bad sources
are correctly sized. Resolves ComputerScienceHouse#80.
  • Loading branch information
adamhb123 committed Aug 9, 2021
1 parent 48bed50 commit e1fbe6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gallery/static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,18 @@ h2 {
transition: 0.3s box-shadow;
}

.album-wrapper > a {
display: inline-block;
position: relative;
width: 100%;
}

.album {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
transform: rotate(5deg);
display: block;
width: 100%;
Expand Down
2 changes: 2 additions & 0 deletions gallery/templates/view_dir.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
{% if child_type == "Directory" %}
<div class="album-wrapper">
<a href="/view/dir/{{ child.id }}">
<!-- Dummy div, needed for ensuring proper element sizing (see issue #80) -->
<div style="margin-top:100%"></div>
<img class="album" src="/api/thumbnail/get/dir/{{ child.id }}">
</a>
</div>
Expand Down

0 comments on commit e1fbe6e

Please sign in to comment.