Skip to content

Commit c575d0b

Browse files
committed
docs(showcase): filter by score, randomize
also add support for INP etc but that needs script changes I can't push right now
1 parent d8aeb96 commit c575d0b

File tree

3 files changed

+532
-406
lines changed

3 files changed

+532
-406
lines changed

packages/docs/src/routes/(ecosystem)/ecosystem/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ import { EcosystemMenu } from './ecosystem-menu';
1010
import { MobileEcosystemMenu } from './mobile-ecosystem-menu';
1111
import { QwikPlusLogo } from './qwik-plus-logo';
1212

13+
const getRandomSites = (sites: typeof SHOWCASE) => {
14+
return sites
15+
.filter((site) => site.perf.score >= 0.9)
16+
.sort(() => (Math.random() > 0.5 ? 1 : -1))
17+
.slice(0, 6);
18+
};
19+
1320
export default component$(() => {
1421
useStyles$(styles);
1522

@@ -19,7 +26,7 @@ export default component$(() => {
1926
const videos = MEDIA.videos.filter(mediaFilter);
2027
const podcasts = MEDIA.podcasts.filter(mediaFilter);
2128
const presentations = MEDIA.presentations.filter(mediaFilter);
22-
const showcaseSites = SHOWCASE.slice(0, 6);
29+
const showcaseSites = getRandomSites(SHOWCASE);
2330

2431
return (
2532
<>

0 commit comments

Comments
 (0)