Skip to content

Commit

Permalink
Fix dapp logo showcase (#2478)
Browse files Browse the repository at this point in the history
* Fix dapp logo showcase

* Do not rely on `left` to scale down the image
  • Loading branch information
lmuntaner authored May 21, 2024
1 parent c31e8e1 commit 2ae0695
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/frontend/src/flows/dappsExplorer/teaser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ const marqueeList = (dapps: KnownDapp[]): TemplateResult => {
// shows an empty space where the image suddenly pops seconds
// later.
({ logoSrc, name }) => html`<div class="c-marquee__item">
<img src=${logoSrc} alt="${name}" class="c-marquee__image" />
<div class="c-marquee__image-container">
<img src=${logoSrc} alt="${name}" class="c-marquee__image" />
</div>
</div>`
);
Expand Down
17 changes: 9 additions & 8 deletions src/frontend/src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3029,17 +3029,18 @@ input[type="checkbox"] {
user-select: none;
}

.c-marquee__image {
.c-marquee__image-container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
transform: translate(0, -50%);
height: 65%;
/*
remove the max-width set by the reset, so that the image can be as wide as
as required by the height
*/
max-width: unset;
aspect-ratio: 1;
}

.c-marquee__image {
height: 100%;
width: 100%;
object-fit: contain;
}

@keyframes marquee {
Expand Down

0 comments on commit 2ae0695

Please sign in to comment.