Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance optimization #1333

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 27 additions & 18 deletions blocks/featured-posts/featured-posts.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
font-size: 18px;
max-width: 85%;
margin: 0 auto;
bottom: 37px;
bottom: 20px;
}

.featured-posts h3 a {
Expand All @@ -44,16 +44,7 @@
}

.featured-posts .post-1 h3 {
font-size: var(--body-font-size-xl);
}

.featured-posts .post-1 {
height: auto;
}

.featured-posts .post-1 img {
height: auto;
min-height: 256px;
font-size: var(--body-font-size-l);
}

.featured-posts .post picture {
Expand All @@ -68,10 +59,14 @@
left: 0;
right: 0;
bottom: 0;
background-image: linear-gradient(rgb(255 255 255 / 0%), rgb(255 255 255 / 0%), rgb(0 0 0 / 80%) 80%);
background-image: linear-gradient(
rgb(255 255 255 / 0%),
rgb(255 255 255 / 0%),
rgb(0 0 0 / 80%) 80%
);
}

@media only screen and (min-width: 768px) {
@media only screen and (min-width: 992px) {
.featured-posts {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
Expand All @@ -82,6 +77,7 @@
}

.featured-posts .post-1 {
height: auto;
grid-area: 1 / 1 / 3 / 3;
}

Expand All @@ -94,7 +90,7 @@
}

.featured-posts .post-4 {
grid-area: 2 / 4 / 3 / 5
grid-area: 2 / 4 / 3 / 5;
}

.featured-posts img,
Expand All @@ -109,12 +105,25 @@
height: 100%;
margin: 0;
}

.featured-posts h3 {
bottom: 37px;
}

.featured-posts .post-1 img {
height: auto;
min-height: 256px;
}

.featured-posts .post-1 h3 {
font-size: var(--body-font-size-xl);
}
}

.featured-posts .post .zoom-effect-wrapper > a{
transition: all .4s;
.featured-posts .post .zoom-effect-wrapper > a {
transition: all 0.4s;
}

.featured-posts .post:hover .zoom-effect-wrapper > a{
.featured-posts .post:hover .zoom-effect-wrapper > a {
transform: scale(1.15);
}
}
10 changes: 6 additions & 4 deletions blocks/featured-posts/featured-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@ export default async function decorate(block) {
const newsItem = newsItems.find((news) => link.href.indexOf(news.path) >= 0);
if (newsItem) {
link.textContent = newsItem.title;
link.title = newsItem.title;
link.setAttribute('data-publisher', newsItem.publisher);
}

div.classList.add('post', `post-${index + 1}`);
div.firstElementChild.classList.add('zoom-effect-wrapper');
if (newsItem && !div.firstElementChild.querySelector('img')) {
div.firstElementChild.append(
a({ href: link.getAttribute('href') },
createOptimizedPicture(newsItem.image, newsItem.title, false),
a({ href: link.getAttribute('href'), title: newsItem.title },
createOptimizedPicture(newsItem.image, newsItem.title),
),
);
} else {
const newsThumbImage = div.firstElementChild.children[0];
newsThumbImage.querySelector('img').setAttribute('alt', newsItem.title);
div.firstElementChild.append(
a({ href: link.getAttribute('href') }, ...div.firstElementChild.children),
a({ href: link.getAttribute('href'), title: newsItem.title }, newsThumbImage),
);
}

Expand Down
3 changes: 2 additions & 1 deletion blocks/footer/footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
.row-3 .hubspot-iframe-wrapper {
margin-left: -15px;
margin-right: -15px;
min-height: 298px;
}

.row-3 .hubspot-iframe-wrapper iframe {
Expand All @@ -242,7 +243,7 @@
display: block;
width: 1px;
min-width: 100%;
height: 1px;
height: 290px;
max-height: 100%;
}

Expand Down
1 change: 1 addition & 0 deletions scripts/iframeResizer.map

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,19 @@ main div.section.wave.bluegreen2 {
margin-bottom: 30px;
}

main div.section.wave.bluegreen2::after {
background-repeat: no-repeat;
background-image: url('/images/wave-background-bottom.webp'),
url('/images/wave-background-bottom.png');
background-size: 100% 100%;
height: 82px;
width: 100%;
position: absolute;
padding: 0;
bottom: 0;
content: '';
}

/* stylelint-disable-next-line no-descending-specificity */
main .section.wave:not(.background-grey-top-half, .bluegreen),
main .section.wave.bluegreen2:not(.background-grey-top-half, .bluegreen) {
Expand Down
Loading