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

docs: redesign #3357

Merged
merged 48 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2a2341d
initial scaffolding, tailwind setup
karooolis Nov 1, 2024
e2d46d9
fix fonts, add bgs, changelog, installation
karooolis Nov 4, 2024
ce7269d
add clipboard, icons, improve layout
karooolis Nov 4, 2024
b00fc50
get random contributors, weighted by contribution
karooolis Nov 4, 2024
91a50d2
add missing links
karooolis Nov 5, 2024
958d1d1
add substack subscription form
karooolis Nov 5, 2024
dc7d758
add cloudflare streams
karooolis Nov 5, 2024
0d30b96
add copied to clipboard tooltip
karooolis Nov 5, 2024
746260d
add auto-playable mud intro video
karooolis Nov 5, 2024
7179f93
upgrade react + react/types
karooolis Nov 5, 2024
cddb005
add swi btns
karooolis Nov 5, 2024
1eea0f0
add mobile responsiveness
karooolis Nov 5, 2024
1ac47ce
update find us color palette
karooolis Nov 5, 2024
42e898b
add diagram description
karooolis Nov 5, 2024
543ef86
add github stats routes
karooolis Nov 6, 2024
ecd5157
add MUD video
karooolis Nov 6, 2024
decd42f
add stars graph (wip)
karooolis Nov 6, 2024
dc9cad7
add github stars + star btn
karooolis Nov 6, 2024
ec145c7
handle request quota limit
karooolis Nov 7, 2024
73e1338
add video thumbnail
karooolis Nov 7, 2024
4991f11
update swi graph + explore quarry btn
karooolis Nov 7, 2024
eadf498
integartions btns mobile + colors
karooolis Nov 7, 2024
fe6f451
github source btn
karooolis Nov 7, 2024
c99e076
changelog full scroll wip
karooolis Nov 7, 2024
c9555e0
add fadein/fadeout projects
karooolis Nov 8, 2024
1f668b6
thumbnail, trusted by, etc
karooolis Nov 8, 2024
4ced61c
append changelog to json
karooolis Nov 8, 2024
7514716
convert existing changelog to json
karooolis Nov 8, 2024
b7d6d83
dispkay all changelog data
karooolis Nov 8, 2024
fce4e3b
correct changelog dates
karooolis Nov 8, 2024
7ede946
changelog horizontal scroll
karooolis Nov 8, 2024
12d07ae
add changelog more no
karooolis Nov 8, 2024
ea88341
architecture mobile + video thumbnail
karooolis Nov 8, 2024
9e56fc6
undo changelog.mdx change
karooolis Nov 8, 2024
0414527
undo changeset change
karooolis Nov 8, 2024
6c35170
remove convert changelog script
karooolis Nov 8, 2024
e7e8f4c
update changelog script
karooolis Nov 8, 2024
78188a5
changeset flag env
karooolis Nov 8, 2024
5bdf018
remove unused graph
karooolis Nov 8, 2024
e5b831f
update quarry url
karooolis Nov 10, 2024
9d9f064
fix docs build
karooolis Nov 10, 2024
3287d41
use fetch helpers for api
karooolis Nov 10, 2024
e801589
copy update
biscaryn Nov 11, 2024
65a6631
add ecosystem
karooolis Nov 12, 2024
c7f5235
architecture + integrations
karooolis Nov 12, 2024
675af36
add overflow-x hidden
karooolis Nov 13, 2024
805b3ea
update docs footer
karooolis Nov 13, 2024
742de7a
Merge branch 'main' into kumpis/mud-landing-page
karooolis Nov 14, 2024
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
2 changes: 1 addition & 1 deletion docs/app/DevconBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export function DevconBanner() {
if (Date.now() > 1731603600000) return null;
return (
<div className="bg-black/20 text-white p-4 text-center">
<div className="bg-mud/20 text-white p-4 text-center">
Hello Devcon! Come learn about MUD at{" "}
<a href="https://mud.dev/day" className="underline font-semibold">
MUD Day
Expand Down
17 changes: 17 additions & 0 deletions docs/app/api/contributors/getContributors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { headers } from "next/headers";

export async function getContributors() {
const headersList = headers();
const host = headersList.get("host") || "";
const protocol = headersList.get("x-forwarded-proto") || "http";
const baseUrl = `${protocol}://${host}`;

try {
const response = await fetch(`${baseUrl}/api/contributors`);
const data = await response.json();
return data;
} catch (error) {
console.error(error);
return [];
}
}
44 changes: 44 additions & 0 deletions docs/app/api/contributors/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Octokit } from "octokit";

const octokit = new Octokit();

export async function GET() {
try {
const response = await octokit.request("GET /repos/{owner}/{repo}/contributors", {
owner: "latticexyz",
repo: "mud",
});

const allContributors = response.data;
if (!Array.isArray(allContributors)) {
return Response.json({
count: 0,
contributors: [],
});
}

const userContributors = allContributors
?.filter((contributor: { type: string }) => contributor.type === "User")
.map((contributor) => {
const weightedContributions = Math.log(contributor.contributions + 1) * 10;
const index = Math.random() * weightedContributions;
const score = weightedContributions - index;
return {
...contributor,
score,
};
})
.sort((a, b) => b.score - a.score);

return Response.json({
count: userContributors.length,
contributors: userContributors?.slice(0, 7),
});
} catch (error) {
console.error(error);
return Response.json({
count: 0,
contributors: [],
});
}
}
17 changes: 17 additions & 0 deletions docs/app/api/stargazers/getStargazers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { headers } from "next/headers";

export async function getStargazers() {
const headersList = headers();
const host = headersList.get("host") || "";
const protocol = headersList.get("x-forwarded-proto") || "http";
const baseUrl = `${protocol}://${host}`;

try {
const response = await fetch(`${baseUrl}/api/stargazers`);
const data = await response.json();
return data;
} catch (error) {
console.error(error);
return 0;
}
}
19 changes: 19 additions & 0 deletions docs/app/api/stargazers/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Octokit } from "octokit";

const octokit = new Octokit();

export async function GET() {
try {
const {
data: { stargazers_count: totalStars },
} = await octokit.request("GET /repos/{owner}/{repo}", {
owner: "latticexyz",
repo: "mud",
});

return Response.json(totalStars);
} catch (error) {
console.error(error);
return Response.json(0);
}
}
88 changes: 88 additions & 0 deletions docs/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Hide scrollbar for Chrome, Safari and Opera */
body::-webkit-scrollbar,
div::-webkit-scrollbar,
pre::-webkit-scrollbar {
display: none;
}

body,
div,
pre {
-ms-overflow-style: none;
scrollbar-width: none;
}

html {
background-color: black;
}

pre {
font-size: 0.5;
background-color: #222;
border-color: #222;
border-width: 1rem;
border-radius: 0.4rem;
overflow-x: scroll;
margin-bottom: 18px;
}

summary {
margin-bottom: 16px;
}

summary > p {
display: inline;
}

/* Substack subscribe widget */
#custom-substack-embed {
max-width: 530px !important;
flex-direction: column !important;
}

#custom-substack-embed p {
position: absolute !important;
max-width: 530px !important;
font-family: var(--font-supply-mono) !important;
text-transform: uppercase !important;
}

.custom-substack-widget {
flex-wrap: nowrap !important;
max-width: 600px !important;
border: none !important;
border-radius: 0 !important;
}

.custom-substack-widget input {
flex-basis: 100% !important;
width: 100% !important;
padding-left: 20px !important;
padding-right: 20px !important;
font-size: 20px !important;
font-family: var(--font-supply-mono) !important;
text-transform: uppercase !important;
border: 1px solid rgba(255, 255, 255, 0.2) !important;
box-sizing: border-box !important;
}

.custom-substack-widget input::placeholder {
opacity: 0.3 !important;
}

.custom-substack-widget button {
flex-shrink: 0 !important;
flex-grow: 0 !important;
width: 122px !important;
/* flex-basis: 122px !important; */
border: none !important;
padding: 23px 25px !important;
margin-left: 15px !important;
font-size: 20px !important;
font-family: var(--font-supply-mono) !important;
text-transform: uppercase !important;
}
42 changes: 38 additions & 4 deletions docs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
import "tailwindcss/tailwind.css";

import { Metadata } from "next";
import { ReactNode } from "react";
import { twMerge } from "tailwind-merge";
import localFont from "next/font/local";
import { cn } from "../lib/cn";
import { DevconBanner } from "./DevconBanner";
import "./globals.css";

const basierCircle = localFont({
src: [
{
path: "../public/fonts/BasierCircle-Regular.otf",
weight: "400",
style: "normal",
},
{
path: "../public/fonts/BasierCircle-SemiBold.otf",
weight: "600",
style: "normal",
},
{
path: "../public/fonts/BasierCircle-Bold.otf",
weight: "700",
style: "normal",
},
],
variable: "--font-basier-circle",
});

const supplyMono = localFont({
src: "../public/fonts/PPSupplyMono-Regular.woff2",
Expand All @@ -22,6 +42,13 @@ const supplyMono = localFont({
],
});

const berkeleyMono = localFont({
src: "../public/fonts/BerkeleyMono-Regular.otf",
preload: true,
variable: "--font-berkeley-mono",
fallback: ["ui-monospace"],
});

export const metadata: Metadata = {
title: "MUD | Framework for onchain applications",
description:
Expand All @@ -38,7 +65,14 @@ type Props = { children: ReactNode };
export default function Layout({ children }: Props) {
return (
<html lang="en">
<body className={twMerge("bg-mud text-white", supplyMono.variable)}>
<body
className={cn(
"text-white font-sans overflow-x-hidden",
basierCircle.variable,
supplyMono.variable,
berkeleyMono.variable,
)}
>
<DevconBanner />
{children}
</body>
Expand Down
Loading
Loading