Skip to content

Commit f10ec83

Browse files
authored
fix(site): Optimise contributors donors images (#8956)
1 parent d2d219f commit f10ec83

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

sites/svelte.dev/scripts/get_contributors.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ try {
6868
new URL(`../src/routes/_components/Supporters/contributors.jpg`, import.meta.url).pathname
6969
);
7070

71-
// TODO: Optimizing the static/contributors.jpg image should probably get automated as well
72-
console.log(
73-
'remember to additionally optimize the resulting /static/contributors.jpg image file via e.g. https://squoosh.app '
74-
);
75-
7671
const str = `[\n\t${authors.map((a) => `'${a.login}'`).join(',\n\t')}\n]`;
7772

7873
writeFile(outputFile, `export default ${str};`);

sites/svelte.dev/scripts/get_donors.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ try {
6161
.writeAsync(
6262
new URL(`../src/routes/_components/Supporters/donors.jpg`, import.meta.url).pathname
6363
);
64-
// TODO: Optimizing the static/donors.jpg image should probably get automated as well
65-
console.log(
66-
'remember to additionally optimize the resulting /static/donors.jpg image file via e.g. https://squoosh.app '
67-
);
6864

6965
const str = `[\n\t${included.map((a) => `${JSON.stringify(a.backer.name)}`).join(',\n\t')}\n]`;
7066

sites/svelte.dev/src/routes/_components/Supporters/index.svelte

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
import { Section } from '@sveltejs/site-kit/components';
33
import contributors from './contributors.js';
44
import donors from './donors.js';
5+
6+
// @ts-ignore
7+
import contributors_img from './contributors.jpg?w=1200&format=webp';
8+
// @ts-ignore
9+
import donors_img from './donors.jpg?w=1200&format=webp';
510
</script>
611

712
<Section --background="var(--sk-back-2">
@@ -20,6 +25,7 @@
2025
<a
2126
class="supporter"
2227
style="background-position: {(100 * i) / (contributors.length - 1)}% 0"
28+
style:background-image="url({contributors_img})"
2329
href="https://github.com/{contributor}"
2430
>
2531
{contributor}
@@ -37,6 +43,7 @@
3743
<a
3844
class="supporter"
3945
style="background-position: {(100 * i) / (donors.length - 1)}% 0"
46+
style:background-image="url({donors_img})"
4047
href="https://opencollective.com/svelte">{donor}</a
4148
>
4249
{/each}
@@ -85,14 +92,6 @@
8592
filter: drop-shadow(1px 2px 8px rgba(0, 0, 0, 0.3));
8693
}
8794
88-
.contributors .supporter {
89-
background-image: url(./contributors.jpg);
90-
}
91-
92-
.donors .supporter {
93-
background-image: url(./donors.jpg);
94-
}
95-
9695
@media (min-width: 480px) {
9796
.grid {
9897
grid-template-columns: repeat(8, minmax(0, 1fr));

0 commit comments

Comments
 (0)