Skip to content

Commit

Permalink
updated agent images
Browse files Browse the repository at this point in the history
  • Loading branch information
rrusher committed May 4, 2024
1 parent 070e54e commit aa3a4f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions blocks/offices/offices.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
.offices.block.agents .cards-list .cards-item .card-image {
display: inline-block;
width: 33%;
height: 100%;
}

.offices.block .cards-list .cards-item .card-image picture {
Expand All @@ -69,6 +70,7 @@
object-position: center;
width: 100%;
height: 100%;
object-fit: contain;
}

.offices.block.agents .cards-list .cards-item .card-body {
Expand Down
13 changes: 8 additions & 5 deletions blocks/offices/offices.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ function buildAgentCards(list, data) {
cardsItem.className = 'cards-item';
const cardImage = document.createElement('div');
cardImage.className = 'card-image';
const tmpImage = 'https://main--hsf-commonmoves--hlxsites.hlx.page/media/images/no-profile-image.png';
const image = createOptimizedPicture(tmpImage, item.name, true);
image.style = 'padding-bottom: 75%';

cardImage.append(image);
const tmpImage = item.image ? item.image : 'https://main--hsf-commonmoves--hlxsites.hlx.page/media/images/no-profile-image.png';
const pic = document.createElement('picture');
const image = document.createElement('img');
pic.append(image);
pic.style = 'padding-bottom: 75%';
image.src = tmpImage;
image.loading = 'eager';
cardImage.append(pic);
cardsItem.append(cardImage);
const cardBody = document.createElement('div');
cardBody.className = 'card-body';
Expand Down

0 comments on commit aa3a4f3

Please sign in to comment.