diff --git a/.env.example b/.env.example index 97094f3..4eb1ee0 100644 --- a/.env.example +++ b/.env.example @@ -1,27 +1,20 @@ DATABASE_URL=postgresql://user:pass@host/db?sslmode=require DATABASE_URL_UNPOOLED=postgresql://user:pass@host/db?sslmode=require -KV_REST_API_URL=https://example.upstash.io -KV_REST_API_TOKEN= +# Self-hosted Redis (redis:// or rediss:// for TLS) +REDIS_URL=redis://localhost:6379 -# Vercel Blob (snapshot agent binary) +# Vercel Blob (avatars) BLOB_READ_WRITE_TOKEN= -# System-level Hetzner provider token used by GSM. +# Optional: Hetzner token for lib/providers (future node provisioning). HETZNER_API_TOKEN= -# Optional: pin a golden image ID. If empty, GSM auto-manages snapshots. -HETZNER_SNAPSHOT_IMAGE_ID= -# Optional builder defaults used by provider profile. -HETZNER_BUILDER_BASE_IMAGE=ubuntu-24.04 -HETZNER_BUILDER_SERVER_TYPE=cx23 -HETZNER_BUILDER_LOCATION=nbg1 - -BOOTSTRAP_JWT_SECRET= BETTER_AUTH_SECRET= BETTER_AUTH_URL=http://localhost:3000 -# Optional public URL override for local snapshot bakes. Use ngrok/tunnel URL. +# URL nodes use to reach the panel (written into daemon.json). Use a +# ngrok/tunnel URL in local dev so daemons can reach /api/remote/*. NODEBYTE_PUBLIC_URL= VERCEL_AUTOMATION_BYPASS_SECRET= @@ -48,16 +41,5 @@ NEXT_PUBLIC_SENTRY_DSN= SENTRY_ORG= SENTRY_PROJECT= -# Optional local snapshot build tuning -SNAPSHOT_SKIP_FULL_UPGRADE=0 -SNAPSHOT_BUILDER_MAX_WAIT_SECONDS= -SNAPSHOT_BUILDER_POLL_SECONDS= -SNAPSHOT_IMAGE_MAX_WAIT_SECONDS= -SNAPSHOT_IMAGE_POLL_SECONDS= - -# Optional local git source override for snapshot compilation -NBP_GIT_REVISION= -NBP_GIT_REPO_URL= - -# Optional token for private submodule access / sandbox git fetch +# Optional token for private submodule access GIT_AUTH_TOKEN= diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 1284840..69c1bb4 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -2,127 +2,78 @@ ## Our Pledge -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards -Examples of behavior that contributes to a positive environment for our -community include: +Examples of behavior that contributes to a positive environment for our community include: - Demonstrating empathy and kindness toward other people - Being respectful of differing opinions, viewpoints, and experiences - Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the - overall community +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -- The use of sexualized language or imagery, and sexual attention or - advances of any kind +- The use of sexualized language or imagery, and sexual attention or advances of any kind - Trolling, insulting or derogatory comments, and personal or political attacks - Public or private harassment -- Publishing others' private information, such as a physical or email - address, without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting +- Publishing others' private information, such as a physical or email address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -haydenbleasel.com/contact. -All complaints will be reviewed and investigated promptly and fairly. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at haydenbleasel.com/contact. All complaints will be reviewed and investigated promptly and fairly. -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. +All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning -**Community Impact**: A violation through a single incident or series -of actions. +**Community Impact**: A violation through a single incident or series of actions. -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. -**Consequence**: A permanent ban from any sort of public interaction within -the community. +**Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. +For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2fb0b16..2bfce02 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,25 +6,20 @@ labels: bug assignees: "" --- -**Describe the bug** -A clear and concise description of what the bug is. +**Describe the bug** A clear and concise description of what the bug is. -**Ghost version** -I am using version ... +**Ghost version** I am using version ... -**To Reproduce** -Steps to reproduce the behavior: +**To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error -**Expected behavior** -A clear and concise description of what you expected to happen. +**Expected behavior** A clear and concise description of what you expected to happen. -**Screenshots** -If applicable, add screenshots to help explain your problem. +**Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 282e37a..fb01154 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -6,11 +6,8 @@ labels: enhancement assignees: "" --- -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] +**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -**Describe the solution you'd like** -A clear and concise description of what you want to happen. +**Describe the solution you'd like** A clear and concise description of what you want to happen. -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. +**Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml deleted file mode 100644 index 94cc1d2..0000000 --- a/.github/workflows/dependency-review.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: "Dependency review" -on: - pull_request: - -permissions: - contents: read - pull-requests: write - -jobs: - dependency-review: - runs-on: ubuntu-latest - steps: - - name: "Checkout repository" - uses: actions/checkout@v6 - - name: "Dependency Review" - uses: actions/dependency-review-action@v5 - with: - comment-summary-in-pr: always diff --git a/.gitignore b/.gitignore index afd1a1c..7a4de30 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,7 @@ generated/ tsconfig.tsbuildinfo .vercel .env*.local + +.vscode/ + +next-env.d.ts diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 59f219f..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnPaste": true, - "editor.formatOnSave": true, - "emmet.showExpandedAbbreviation": "never", - "js/ts.tsdk.path": "node_modules/typescript/lib", - "js/ts.tsdk.promptToUseWorkspaceVersion": true, - "[css]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[graphql]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[handlebars]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[html]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[javascript]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[javascriptreact]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[json]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[jsonc]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[less]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[markdown]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[scss]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[typescript]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[typescriptreact]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[vue-html]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[vue]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "[yaml]": { - "editor.defaultFormatter": "oxc.oxc-vscode" - }, - "editor.codeActionsOnSave": { - "source.fixAll.oxc": "explicit" - } -} diff --git a/agent b/agent index b8715dc..8486921 160000 --- a/agent +++ b/agent @@ -1 +1 @@ -Subproject commit b8715dc29793f9eddcac88717ffb2ecf5b152efb +Subproject commit 8486921f6b8048d41d693e2cc01c53997d6e7512 diff --git a/app/(auth)/layout.tsx b/app/(auth)/layout.tsx index 09421ea..811f330 100644 --- a/app/(auth)/layout.tsx +++ b/app/(auth)/layout.tsx @@ -3,12 +3,17 @@ import type { ReactNode } from "react"; import { createMetadata } from "@/lib/seo/metadata"; import { getSession } from "@/lib/session"; +import { getBranding } from "@/lib/settings"; -export const metadata = createMetadata({ - description: "Sign in to NodeByte Panel.", - robots: { follow: false, index: false }, - title: "Sign in", -}); +export const generateMetadata = async () => { + const { panelName } = await getBranding(); + return createMetadata({ + description: `Sign in to ${panelName}.`, + robots: { follow: false, index: false }, + siteName: panelName, + title: "Sign in", + }); +}; const AuthLayout = async ({ children }: { children: ReactNode }) => { const session = await getSession(); @@ -17,19 +22,19 @@ const AuthLayout = async ({ children }: { children: ReactNode }) => { } return ( -
+
{/* Background gradient */} -
+
{/* Animated orbs */}
-
+
{/* Grid overlay */} -
+
{children}
); diff --git a/app/(auth)/sign-in/page.tsx b/app/(auth)/sign-in/page.tsx index 77818e8..fd439aa 100644 --- a/app/(auth)/sign-in/page.tsx +++ b/app/(auth)/sign-in/page.tsx @@ -9,8 +9,10 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { authClient, signIn } from "@/lib/auth-client"; +import { useBranding } from "@/providers/branding"; const SignInPage = () => { + const { panelName, signUpEnabled } = useBranding(); const router = useRouter(); const [pending, setPending] = useState(false); const [passkeyPending, setPasskeyPending] = useState(false); @@ -81,17 +83,17 @@ const SignInPage = () => {

- - NodeByte Panel + + {panelName}

-

+

Sign in to your account

@@ -118,31 +120,33 @@ const SignInPage = () => {
- +
- or + or
-

- No account?{" "} - - Create one - -

+ {signUpEnabled && ( +

+ No account?{" "} + + Create one + +

+ )}
); diff --git a/app/(auth)/sign-up/page.tsx b/app/(auth)/sign-up/page.tsx index dc0e54a..a1be923 100644 --- a/app/(auth)/sign-up/page.tsx +++ b/app/(auth)/sign-up/page.tsx @@ -1,92 +1,16 @@ -"use client"; -import Link from "next/link"; -import { useRouter } from "next/navigation"; -import { useState } from "react"; -import { toast } from "sonner"; +import { redirect } from "next/navigation"; -import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; -import { Label } from "@/components/ui/label"; -import { signUp } from "@/lib/auth-client"; +import { getBranding } from "@/lib/settings"; -const SignUpPage = () => { - const router = useRouter(); - const [pending, setPending] = useState(false); +import { SignUpForm } from "./sign-up-form"; - const handleSubmit = async (event: React.FormEvent) => { - event.preventDefault(); - const form = new FormData(event.currentTarget); - setPending(true); - const { error } = await signUp.email({ - email: String(form.get("email")), - name: String(form.get("name")), - password: String(form.get("password")), - }); - setPending(false); - if (error) { - toast.error(error.message ?? "Sign up failed"); - return; - } - router.push("/dashboard"); - router.refresh(); - }; - - return ( -
-
-

- - NodeByte Panel - -

-

- Create your account -

-
-
-
- - -
-
- - -
-
- - -
- -

- Already have an account?{" "} - - Sign in - -

-
-
- ); +// External billing systems create accounts, so there's nothing to sign up for. +const SignUpPage = async () => { + const { signUpEnabled } = await getBranding(); + if (!signUpEnabled) { + redirect("/sign-in"); + } + return ; }; export default SignUpPage; diff --git a/app/(auth)/sign-up/sign-up-form.tsx b/app/(auth)/sign-up/sign-up-form.tsx new file mode 100644 index 0000000..0e916bc --- /dev/null +++ b/app/(auth)/sign-up/sign-up-form.tsx @@ -0,0 +1,92 @@ +"use client"; +import Link from "next/link"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import { toast } from "sonner"; + +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { signUp } from "@/lib/auth-client"; +import { useBranding } from "@/providers/branding"; + +export const SignUpForm = () => { + const { panelName } = useBranding(); + const router = useRouter(); + const [pending, setPending] = useState(false); + + const handleSubmit = async (event: React.FormEvent) => { + event.preventDefault(); + const form = new FormData(event.currentTarget); + setPending(true); + const { error } = await signUp.email({ + email: String(form.get("email")), + name: String(form.get("name")), + password: String(form.get("password")), + }); + setPending(false); + if (error) { + toast.error(error.message ?? "Sign up failed"); + return; + } + router.push("/dashboard"); + router.refresh(); + }; + + return ( +
+
+

+ + {panelName} + +

+

+ Create your account +

+
+
+
+ + +
+
+ + +
+
+ + +
+ +

+ Already have an account?{" "} + + Sign in + +

+
+
+ ); +}; diff --git a/app/(marketing)/components/hero-graphic.tsx b/app/(marketing)/components/hero-graphic.tsx index 384cd5a..2db91ec 100644 --- a/app/(marketing)/components/hero-graphic.tsx +++ b/app/(marketing)/components/hero-graphic.tsx @@ -62,14 +62,14 @@ const CONNECTIONS = [ // ─── Projection ─────────────────────────────────────────────────────────────── const proj = (lat: number, lon: number, rot: number, r = R) => { - const phi = lat * 0.017_453; - const lam = lon * 0.017_453 + rot; - const cp = Math.cos(phi), - sp = Math.sin(phi); - const cl = Math.cos(lam), - sl = Math.sin(lam); - const y = sp, - z = cp * cl; + const phi = lat * 0.017453; + const lam = lon * 0.017453 + rot; + const cp = Math.cos(phi); + const sp = Math.sin(phi); + const cl = Math.cos(lam); + const sl = Math.sin(lam); + const y = sp; + const z = cp * cl; return { x: r * cp * sl + CX, y: -r * (y * cT - z * sT) + CY, @@ -86,17 +86,17 @@ const gcPath = ( lon2: number, n: number ) => { - const d2r = 0.017_453; + const d2r = 0.017453; const l1 = lon1 * d2r; const l2 = lon2 * d2r; const p1 = lat1 * d2r; const p2 = lat2 * d2r; - const ax = Math.cos(p1) * Math.cos(l1), - ay = Math.cos(p1) * Math.sin(l1), - az = Math.sin(p1); - const bx = Math.cos(p2) * Math.cos(l2), - by = Math.cos(p2) * Math.sin(l2), - bz = Math.sin(p2); + const ax = Math.cos(p1) * Math.cos(l1); + const ay = Math.cos(p1) * Math.sin(l1); + const az = Math.sin(p1); + const bx = Math.cos(p2) * Math.cos(l2); + const by = Math.cos(p2) * Math.sin(l2); + const bz = Math.sin(p2); const omega = Math.acos( Math.max(-1, Math.min(1, ax * bx + ay * by + az * bz)) ); @@ -110,11 +110,11 @@ const gcPath = ( const pts: { lat: number; lon: number }[] = []; for (let i = 0; i <= n; i += 1) { const t = i / n; - const A = Math.sin((1 - t) * omega) / sinO, - B = Math.sin(t * omega) / sinO; - const x = A * ax + B * bx, - y = A * ay + B * by, - z = A * az + B * bz; + const A = Math.sin((1 - t) * omega) / sinO; + const B = Math.sin(t * omega) / sinO; + const x = A * ax + B * bx; + const y = A * ay + B * by; + const z = A * az + B * bz; pts.push({ lat: Math.atan2(z, Math.hypot(x, y)) / d2r, lon: Math.atan2(y, x) / d2r, @@ -127,8 +127,8 @@ const popLookup: Record = Object.fromEntries( POPS.map((p) => [p.id, p]) ); const ARC_PATHS = CONNECTIONS.map((c) => { - const a = popLookup[c.a], - b = popLookup[c.b]; + const a = popLookup[c.a]; + const b = popLookup[c.b]; return gcPath(a.lat, a.lon, b.lat, b.lon, 50); }); @@ -146,13 +146,19 @@ const cssHex = (v: string, el: HTMLElement): string => { }; const useThemeColors = () => { - const [c, set] = useState({ accent: "#38bdf8", primary: "#6366f1" }); + const [colors, setColors] = useState({ + accent: "#38bdf8", + primary: "#6366f1", + }); useEffect(() => { const el = document.createElement("span"); el.style.cssText = "display:none;position:absolute"; document.body.append(el); const read = () => - set({ accent: cssHex("--accent", el), primary: cssHex("--primary", el) }); + setColors({ + accent: cssHex("--accent", el), + primary: cssHex("--primary", el), + }); read(); const mo = new MutationObserver(read); mo.observe(document.documentElement, { @@ -164,7 +170,7 @@ const useThemeColors = () => { el.remove(); }; }, []); - return c; + return colors; }; // ─── Colour helpers ─────────────────────────────────────────────────────────── @@ -181,7 +187,7 @@ const rgba = (hex: string, a: number) => // ─── Component ──────────────────────────────────────────────────────────────── -export default function HeroGraphic() { +const HeroGraphic = () => { const ref = useRef(null); const { accent } = useThemeColors(); @@ -229,7 +235,7 @@ export default function HeroGraphic() { /* dot grid */ for (let lat = -85; lat <= 85; lat += DOT_DEG) { - const step = DOT_DEG / Math.max(Math.cos(lat * 0.017_453), 0.28); + const step = DOT_DEG / Math.max(Math.cos(lat * 0.017453), 0.28); for (let lon = 0; lon < 360; lon += step) { const p = proj(lat, lon, rot); if (p.z <= 0) { @@ -326,15 +332,15 @@ export default function HeroGraphic() { }, [accent]); return ( -
- -
-
+
+ +
+
- + Global Network · 3+ Data Center Partners
@@ -346,10 +352,10 @@ export default function HeroGraphic() { ].map((r) => ( - + {r.label} @@ -358,4 +364,6 @@ export default function HeroGraphic() {
); -} +}; + +export default HeroGraphic; diff --git a/app/(marketing)/components/pricing-section.tsx b/app/(marketing)/components/pricing-section.tsx index 14a053e..3c43f16 100644 --- a/app/(marketing)/components/pricing-section.tsx +++ b/app/(marketing)/components/pricing-section.tsx @@ -11,7 +11,6 @@ import { CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible"; -import type { CatalogServerType } from "@/lib/providers/types"; import { cn } from "@/lib/utils"; const formatPrice = (amount: number, currency: string) => @@ -21,11 +20,20 @@ const formatPrice = (amount: number, currency: string) => style: "currency", }).format(amount); +export interface PricingPlan { + name: string; + cores: string; + memory: string; + disk: string; + backups: number; + pricePerMonth: number; +} + // The 2nd plan (index 1) in the featured set is highlighted as best value. const HIGHLIGHT_INDEX = 1; interface PlanCardProps { - type: CatalogServerType; + type: PricingPlan; currency: string; highlight?: boolean; isAuthenticated: boolean; @@ -41,57 +49,57 @@ const PlanCard = ({ className={cn( "relative flex flex-col gap-5 rounded-2xl border p-5 backdrop-blur-sm transition-all duration-300", highlight - ? "border-primary/60 bg-card/60 shadow-lg shadow-primary/10 ring-1 ring-primary/20" + ? "border-primary/60 bg-card/60 shadow-primary/10 ring-primary/20 shadow-lg ring-1" : "border-border/50 bg-card/30 hover:border-primary/30 hover:bg-card/50" )} > {highlight && ( - + Most popular )} {/* Specs */}
-
- +
+
- vCPU + vCPU {type.cores}
-
- +
+
- RAM - {type.memory} GB + RAM + {type.memory}
-
- +
+
- SSD - {type.disk} GB + SSD + {type.disk}
-
- +
+
- Arch + Backups - {type.architecture} + {type.backups}
{/* Price + CTA */} -
+
-
+
{formatPrice(type.pricePerMonth, currency)}
-
per month
+
per month