Skip to content

Commit

Permalink
Add hover styling to images
Browse files Browse the repository at this point in the history
  • Loading branch information
yukitya-1811 committed Jun 22, 2024
1 parent 52ccd3f commit 12830dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion recipify/recipify/templates/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h1 class="mb-4 text-3xl font-extrabold text-gray-900 dark:text-white md:text-5x
{% for image in images %}
<div>
<a href="{% url 'pick_recipe' image.id %}">
<img class="h-auto max-w-full rounded-lg" src="{{ image.image.url }}" alt="Gallery image" />
<img class="h-auto max-w-full rounded-lg hover-highlight" src="{{ image.image.url }}" alt="Gallery image" />
</a>
</div>
{% endfor %}
Expand Down
7 changes: 7 additions & 0 deletions recipify/static/css/gallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@
max-height: 100%;
}

.hover-highlight {
transition: box-shadow 0.3s ease-in-out; /* Smooth transition */
}

.hover-highlight:hover {
opacity: 75%;
}

0 comments on commit 12830dc

Please sign in to comment.