|
1 | 1 | <script lang="ts"> |
2 | | - import { |
3 | | - adoptedProjects, |
4 | | - type Project, |
5 | | - } from "$lib/assets/data/adoptedProjectsData"; |
6 | | - import { onMount } from "svelte"; |
| 2 | + import ProjectSection from "$lib/components/adopted-projects/ProjectSection.svelte"; |
7 | 3 |
|
8 | | - let projectsWithStatus: Project[] = $state(adoptedProjects); |
| 4 | + type ProjectItem = { |
| 5 | + title: string; |
| 6 | + description: string; |
| 7 | + githubUrl: string; |
| 8 | + stars: string; |
| 9 | + commits: string; |
| 10 | + }; |
9 | 11 |
|
10 | | - function checkImage(url: string) { |
11 | | - return new Promise<boolean>((resolve) => { |
12 | | - if (!url) return resolve(false); |
13 | | - const img = new Image(); |
14 | | - img.onload = () => resolve(true); |
15 | | - img.onerror = () => resolve(false); |
16 | | - img.src = url; |
17 | | - }); |
18 | | - } |
| 12 | + type ProjectSectionData = { |
| 13 | + logo: string; |
| 14 | + title: string; |
| 15 | + description: string; |
| 16 | + projects: ProjectItem[]; |
| 17 | + githubUrl: string; |
| 18 | + websiteUrl: string; |
| 19 | + twitterUrl: string; |
| 20 | + }; |
19 | 21 |
|
20 | | - onMount(async () => { |
21 | | - const results = await Promise.all( |
22 | | - adoptedProjects.map(async (p) => { |
23 | | - const hasImage = await checkImage(p.logo); |
24 | | - return { ...p, hasImage }; |
25 | | - }) |
26 | | - ); |
27 | | - projectsWithStatus = results; |
28 | | - }); |
| 22 | + const geysermc: ProjectItem[] = [ |
| 23 | + { |
| 24 | + title: "Geyser", |
| 25 | + description: |
| 26 | + "Geyser is a program that allows Minecraft: Bedrock Edition clients to join Minecraft: Java Edition servers, allowing for true crossplay between both editions of the game.", |
| 27 | + githubUrl: "https://github.com/GeyserMC/Geyser", |
| 28 | + stars: "5.4k+", |
| 29 | + commits: "4.5k+", |
| 30 | + }, |
| 31 | + { |
| 32 | + title: "Floodgate", |
| 33 | + description: |
| 34 | + "Floodgate is a hybrid mode plugin to allow for connections from Geyser to join online mode servers.", |
| 35 | + githubUrl: "https://github.com/GeyserMC/Floodgate", |
| 36 | + stars: "600+", |
| 37 | + commits: "400+", |
| 38 | + }, |
| 39 | + { |
| 40 | + title: "MCProtocolLib", |
| 41 | + description: |
| 42 | + "MCProtocolLib is a simple library for communicating with Minecraft clients and servers.", |
| 43 | + githubUrl: "https://github.com/GeyserMC/MCProtocolLib", |
| 44 | + stars: "850+", |
| 45 | + commits: "1.5k+", |
| 46 | + }, |
| 47 | + ]; |
| 48 | +
|
| 49 | + const cloudburstmc: ProjectItem[] = [ |
| 50 | + { |
| 51 | + title: "Protocol", |
| 52 | + description: |
| 53 | + "A protocol library for Minecraft that supports multiple versions.", |
| 54 | + githubUrl: "https://github.com/CloudburstMC/Protocol", |
| 55 | + stars: "350+", |
| 56 | + commits: "850+", |
| 57 | + }, |
| 58 | + { |
| 59 | + title: "ProxyPass", |
| 60 | + description: |
| 61 | + "Proxy pass allows developers to MITM a vanilla client and server without modifying them.", |
| 62 | + githubUrl: "https://github.com/CloudburstMC/ProxyPass", |
| 63 | + stars: "150+", |
| 64 | + commits: "150+", |
| 65 | + }, |
| 66 | + { |
| 67 | + title: "Server", |
| 68 | + description: |
| 69 | + "Cloudburst is a server software for Minecraft: Bedrock Edition.", |
| 70 | + githubUrl: "https://github.com/CloudburstMC/Cloudburst", |
| 71 | + stars: "5000", |
| 72 | + commits: "8000", |
| 73 | + }, |
| 74 | + ]; |
| 75 | +
|
| 76 | + const sections: ProjectSectionData[] = [ |
| 77 | + { |
| 78 | + logo: "/resources/projects/geysermc_icon.png", |
| 79 | + title: "GeyserMC", |
| 80 | + description: |
| 81 | + "Bringing together the Minecraft community, one project at a time.", |
| 82 | + projects: geysermc, |
| 83 | + githubUrl: "https://github.com/GeyserMC", |
| 84 | + websiteUrl: "https://geysermc.org", |
| 85 | + twitterUrl: "https://x.com/Geyser_MC" |
| 86 | + }, |
| 87 | + { |
| 88 | + logo: "/resources/projects/cloudburst_icon.png", |
| 89 | + title: "CloudburstMC", |
| 90 | + description: |
| 91 | + "Maintains core libraries to power Minecraft: Bedrock Edition servers.", |
| 92 | + projects: cloudburstmc, |
| 93 | + githubUrl: "https://github.com/CloudburstMC", |
| 94 | + websiteUrl: "https://cloudburstmc.org", |
| 95 | + twitterUrl: "https://x.com/CloudburstMC" |
| 96 | + }, |
| 97 | + ]; |
29 | 98 | </script> |
30 | 99 |
|
31 | 100 | <svelte:head> |
|
42 | 111 | <p |
43 | 112 | class="mx-auto max-w-3xl text-lg text-primary-100 dark:text-primary-300 sm:text-xl" |
44 | 113 | > |
45 | | - Free and open-source projects we actively support and contribute to |
| 114 | + These projects remain free and open-source, with Open Collaboration providing infrastructure, resources, and long-term support. |
46 | 115 | </p> |
47 | 116 | </div> |
48 | 117 | </section> |
49 | 118 |
|
50 | | -<section class="bg-background py-16 dark:bg-gray-900 sm:py-24"> |
51 | | - <div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8"> |
52 | | - <div class="grid gap-10 md:grid-cols-2"> |
53 | | - {#each projectsWithStatus as project} |
54 | | - <div class="group/card relative h-full w-full"> |
55 | | - <div |
56 | | - class="relative z-10 flex h-full flex-col rounded-xl bg-white p-8 shadow-lg transition-transform duration-300 ease-out group-hover/card:translate-x-1 group-hover/card:translate-y-1 dark:bg-gray-800" |
57 | | - > |
58 | | - <div class="ml-auto h-3 w-16 bg-primary dark:bg-accent"></div> |
59 | | - |
60 | | - <div class="mb-6 mt-4 flex h-24 items-center"> |
61 | | - {#if project.hasImage} |
62 | | - <img |
63 | | - src={project.logo} |
64 | | - alt={project.name} |
65 | | - class="max-h-full max-w-full object-contain" |
66 | | - loading="lazy" |
67 | | - style="outline: none; border: none;" |
68 | | - /> |
69 | | - {:else} |
70 | | - <span |
71 | | - class="text-3xl font-bold text-primary-600 dark:text-primary-400" |
72 | | - > |
73 | | - {project.name} |
74 | | - </span> |
75 | | - {/if} |
76 | | - </div> |
77 | | - |
78 | | - <div class="flex-grow"> |
79 | | - <h3 |
80 | | - class="mb-3 text-2xl font-bold text-primary-900 dark:text-white" |
81 | | - > |
82 | | - {project.name} |
83 | | - </h3> |
84 | | - <p class="mb-6 text-base text-primary-600 dark:text-primary-300"> |
85 | | - {project.description} |
86 | | - </p> |
87 | | - </div> |
88 | | - |
89 | | - <div class="mt-auto"> |
90 | | - <a |
91 | | - href={project.link} |
92 | | - class="group flex items-center font-semibold text-primary-600 transition hover:text-primary-800 dark:text-primary-400 dark:hover:text-primary-300" |
93 | | - > |
94 | | - Learn More |
95 | | - <svg |
96 | | - class="ml-2 h-4 w-4 transition-transform group-hover:translate-x-1" |
97 | | - xmlns="http://www.w3.org/2000/svg" |
98 | | - fill="none" |
99 | | - viewBox="0 0 24 24" |
100 | | - stroke="currentColor" |
101 | | - > |
102 | | - <path |
103 | | - stroke-linecap="round" |
104 | | - stroke-linejoin="round" |
105 | | - stroke-width="2" |
106 | | - d="M17 8l4 4m0 0l-4 4m4-4H3" |
107 | | - /> |
108 | | - </svg> |
109 | | - </a> |
110 | | - </div> |
111 | | - </div> |
112 | | - |
113 | | - <div |
114 | | - aria-hidden="true" |
115 | | - class="absolute -left-2 -top-2 z-0 h-full w-full rounded-xl bg-primary p-8 transition-all duration-300 ease-out group-hover/card:-left-4 group-hover/card:-top-4 dark:bg-accent" |
116 | | - > |
117 | | - <div |
118 | | - class="ml-auto mt-2 h-3 w-16 border border-gray-700 bg-gray-100 opacity-50" |
119 | | - ></div> |
120 | | - |
121 | | - <div class="opacity-0"> |
122 | | - <div class="mb-6 mt-4 h-24 w-full"></div> |
123 | | - |
124 | | - <h3 class="mb-3 text-2xl font-bold">{project.name}</h3> |
125 | | - <p class="mb-6 text-base">{project.description}</p> |
126 | | - </div> |
127 | | - </div> |
128 | | - </div> |
129 | | - {/each} |
130 | | - </div> |
131 | | - </div> |
| 119 | +<section class="bg-background dark:bg-gray-900"> |
| 120 | + {#each sections as section} |
| 121 | + <ProjectSection {...section} /> |
| 122 | + {/each} |
132 | 123 | </section> |
0 commit comments