Skip to content

Commit

Permalink
feat: add default images for products without image in off.html #208
Browse files Browse the repository at this point in the history
  • Loading branch information
GitPersSiham committed Jul 15, 2024
1 parent f2e87f0 commit 5e21cb6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions frontend/public/off.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@
height: 144px;
margin: 12px;
}
.default-image {
filter: invert(.9) !important;
}

searchalicious-results::part(image) {
object-fit: contain;
width: 100%;
Expand Down Expand Up @@ -456,11 +454,11 @@

<script src="vega5.js"></script>
<script>
const defaultImageUrl = 'https://world.openfoodfacts.org/images/icons/dist/packaging.svg'; // Update this path to your default image location
const defaultImageUrl = 'https://world.openfoodfacts.org/images/icons/dist/packaging.svg';

function handleImageError(event) {
event.target.src = defaultImageUrl;
event.target.classList.add('default-image');

}
</script>
<script
Expand Down

0 comments on commit 5e21cb6

Please sign in to comment.