only load content when it comes into view

This commit is contained in:
2025-12-20 16:40:22 +01:00
parent 61ec024ad4
commit 0d0aaa5f46
5 changed files with 16 additions and 1 deletions
+3
View File
@@ -113,6 +113,9 @@ projects.sort((a, b) => a.data.name.localeCompare(b.data.name));
gap: 0.25rem; gap: 0.25rem;
padding: 0.25rem; padding: 0.25rem;
height: min-content; height: min-content;
content-visibility: auto;
contain-intrinsic-size: 96px;
&:focus-within { &:focus-within {
background-color: #548e9b; background-color: #548e9b;
} }
+2
View File
@@ -79,6 +79,8 @@
padding: 0.5rem; padding: 0.5rem;
gap: 0.25rem; gap: 0.25rem;
border-radius: 0.25rem; border-radius: 0.25rem;
content-visibility: auto;
contain-intrinsic-size: 88px;
span { span {
color: var(--text-secondary); color: var(--text-secondary);
-1
View File
@@ -135,7 +135,6 @@
for (let i = 0; i < chars.length; i++) { for (let i = 0; i < chars.length; i++) {
const span = document.createElement("span"); const span = document.createElement("span");
span.setAttribute("data-number", chars[i]); span.setAttribute("data-number", chars[i]);
span.setAttribute("aria-label", chars[i]);
span.style.animationDelay = `${i * 0.05}s`; span.style.animationDelay = `${i * 0.05}s`;
viewCounter.appendChild(span); viewCounter.appendChild(span);
} }
+6
View File
@@ -69,4 +69,10 @@ const permalink = `${Astro?.site?.href}blog/${slug}`;
min-width: 100px; min-width: 100px;
width: 30%; width: 30%;
} }
.content {
p {
content-visibility: auto;
}
}
</style> </style>
+5
View File
@@ -53,6 +53,11 @@ const allPosts= posts.sort((a, b) => new Date(b.data.publishDate).valueOf() - ne
margin-right: 16px; margin-right: 16px;
} }
.post-item {
content-visibility: auto;
contain-intrinsic-size: 228px;
}
hr { hr {
margin: 60px auto; margin: 60px auto;
} }