Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
admineral committed Dec 9, 2023
1 parent d9d2063 commit 8dfa384
Show file tree
Hide file tree
Showing 18 changed files with 6,623 additions and 4,481 deletions.
21 changes: 0 additions & 21 deletions LICENSE.md

This file was deleted.

6 changes: 3 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import Footer from "@/components/layout/footer";
import { Suspense } from "react";

export const metadata = {
title: "Precedent - Building blocks for your Next.js project",
title: "Kronews",
description:
"Precedent is the all-in-one solution for your Next.js project. It includes a design system, authentication, analytics, and more.",
metadataBase: new URL("https://precedent.dev"),
"Krone-Hackathon",
metadataBase: new URL("https://precedent-krone.vercel.app"),
themeColor: "#FFF",
};

Expand Down
161 changes: 6 additions & 155 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,169 +1,20 @@
import Card from "@/components/home/card";
import { DEPLOY_URL } from "@/lib/constants";
import { Github, Twitter } from "@/components/shared/icons";
import WebVitals from "@/components/home/web-vitals";
import ComponentGrid from "@/components/home/component-grid";
import Image from "next/image";
import { nFormatter } from "@/lib/utils";

export default async function Home() {
const { stargazers_count: stars } = await fetch(
"https://api.github.com/repos/steven-tey/precedent",
{
...(process.env.GITHUB_OAUTH_TOKEN && {
headers: {
Authorization: `Bearer ${process.env.GITHUB_OAUTH_TOKEN}`,
"Content-Type": "application/json",
},
}),
// data will revalidate every 24 hours
next: { revalidate: 86400 },
},
)
.then((res) => res.json())
.catch((e) => console.log(e));

export default function Home() {
return (
<>
<div className="z-10 w-full max-w-xl px-5 xl:px-0">
<a
href="https://twitter.com/steventey/status/1613928948915920896"
target="_blank"
rel="noreferrer"
className="mx-auto mb-5 flex max-w-fit animate-fade-up items-center justify-center space-x-2 overflow-hidden rounded-full bg-blue-100 px-7 py-2 transition-colors hover:bg-blue-200"
>
<Twitter className="h-5 w-5 text-[#1d9bf0]" />
<p className="text-sm font-semibold text-[#1d9bf0]">
Introducing Precedent
</p>
</a>
<div className="z-10 w-full max-w-2xl px-5 xl:px-0">
<h1
className="animate-fade-up bg-gradient-to-br from-black to-stone-500 bg-clip-text text-center font-display text-4xl font-bold tracking-[-0.02em] text-transparent opacity-0 drop-shadow-sm [text-wrap:balance] md:text-7xl md:leading-[5rem]"
className="animate-fade-up bg-gradient-to-br from-black to-stone-500 bg-clip-text text-center font-display text-3xl font-bold tracking-[-0.02em] text-transparent opacity-0 drop-shadow-sm [text-wrap:balance] md:text-7xl md:leading-[5rem]"
style={{ animationDelay: "0.15s", animationFillMode: "forwards" }}
>
Building blocks for your Next project
Innovating Journalism
</h1>
<p
className="mt-6 animate-fade-up text-center text-gray-500 opacity-0 [text-wrap:balance] md:text-xl"
style={{ animationDelay: "0.25s", animationFillMode: "forwards" }}
>
An opinionated collection of components, hooks, and utilities for your
Next.js project.
Revolutionize the way we approach news and media in the digital age.
</p>
<div
className="mx-auto mt-6 flex animate-fade-up items-center justify-center space-x-5 opacity-0"
style={{ animationDelay: "0.3s", animationFillMode: "forwards" }}
>
<a
className="group flex max-w-fit items-center justify-center space-x-2 rounded-full border border-black bg-black px-5 py-2 text-sm text-white transition-colors hover:bg-white hover:text-black"
href={DEPLOY_URL}
target="_blank"
rel="noopener noreferrer"
>
<svg
className="h-4 w-4 group-hover:text-black"
viewBox="0 0 24 24"
fill="currentColor"
xmlns="https://www.w3.org/2000/svg"
>
<path
d="M12 4L20 20H4L12 4Z"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
<p>Deploy to Vercel</p>
</a>
<a
className="flex max-w-fit items-center justify-center space-x-2 rounded-full border border-gray-300 bg-white px-5 py-2 text-sm text-gray-600 shadow-md transition-colors hover:border-gray-800"
href="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/steven-tey/precedent"
target="_blank"
rel="noopener noreferrer"
>
<Github />
<p>
<span className="hidden sm:inline-block">Star on</span> GitHub{" "}
<span className="font-semibold">{nFormatter(stars)}</span>
</p>
</a>
</div>
</div>
<div className="my-10 grid w-full max-w-screen-xl animate-fade-up grid-cols-1 gap-5 px-5 md:grid-cols-3 xl:px-0">
{features.map(({ title, description, demo, large }) => (
<Card
key={title}
title={title}
description={description}
demo={
title === "Beautiful, reusable components" ? (
<ComponentGrid />
) : (
demo
)
}
large={large}
/>
))}
</div>
</>
);
}

const features = [
{
title: "Beautiful, reusable components",
description:
"Pre-built beautiful, a11y-first components, powered by [Tailwind CSS](https://tailwindcss.com/), [Radix UI](https://www.radix-ui.com/), and [Framer Motion](https://framer.com/motion)",
large: true,
},
{
title: "Performance first",
description:
"Built on [Next.js](https://nextjs.org/) primitives like `@next/font` and `next/image` for stellar performance.",
demo: <WebVitals />,
},
{
title: "One-click Deploy",
description:
"Jumpstart your next project by deploying Precedent to [Vercel](https://vercel.com/) in one click.",
demo: (
<a href={DEPLOY_URL}>
<Image
src="https://vercel.com/button"
alt="Deploy with Vercel"
width={120}
height={30}
unoptimized
/>
</a>
),
},
{
title: "Built-in Auth + Database",
description:
"Precedent comes with authentication and database via [Auth.js](https://authjs.dev/) + [Prisma](https://prisma.io/)",
demo: (
<div className="flex items-center justify-center space-x-20">
<Image alt="Auth.js logo" src="/authjs.webp" width={50} height={50} />
<Image alt="Prisma logo" src="/prisma.svg" width={50} height={50} />
</div>
),
},
{
title: "Hooks, utilities, and more",
description:
"Precedent offers a collection of hooks, utilities, and `@vercel/og`",
demo: (
<div className="grid grid-flow-col grid-rows-3 gap-10 p-10">
<span className="font-mono font-semibold">useIntersectionObserver</span>
<span className="font-mono font-semibold">useLocalStorage</span>
<span className="font-mono font-semibold">useScroll</span>
<span className="font-mono font-semibold">nFormatter</span>
<span className="font-mono font-semibold">capitalize</span>
<span className="font-mono font-semibold">truncate</span>
</div>
),
},
];
}
28 changes: 13 additions & 15 deletions components/layout/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
import { BuyMeACoffee } from "../shared/icons";

export default function Footer() {
return (
<div className="absolute w-full py-5 text-center">
<div className="fixed bottom-0 w-full py-5 text-center">
<p className="text-gray-500">
A project by{" "}
<a
className="font-semibold text-gray-600 underline-offset-4 transition-colors hover:underline"
href="https://twitter.com/steventey"
href="https://github.com/admineral"
target="_blank"
rel="noopener noreferrer"
>
Steven Tey
Elias Zobler
</a>
{" "}and{" "}
<a
className="font-semibold text-gray-600 underline-offset-4 transition-colors hover:underline"
href="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/nixknameee"
target="_blank"
rel="noopener noreferrer"
>
Nikoll Gjokaj
</a>
</p>
<a
href="https://www.buymeacoffee.com/steventey"
target="_blank"
rel="noopener noreferrer"
className="mx-auto mt-2 flex max-w-fit items-center justify-center space-x-2 rounded-lg border border-gray-200 bg-white px-6 py-2 transition-all duration-75 hover:scale-105"
>
<BuyMeACoffee className="h-6 w-6" />
<p className="font-medium text-gray-600">Buy me a coffee</p>
</a>
</div>
);
}
}
2 changes: 1 addition & 1 deletion components/layout/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function NavBar({ session }: { session: Session | null }) {
height="30"
className="mr-2 rounded-sm"
></Image>
<p>Precedent</p>
<p>Kronews</p>
</Link>
<div>
{session ? (
Expand Down
4 changes: 2 additions & 2 deletions components/layout/sign-in-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const SignInModal = ({
<Modal showModal={showSignInModal} setShowModal={setShowSignInModal}>
<div className="w-full overflow-hidden shadow-xl md:max-w-md md:rounded-2xl md:border md:border-gray-200">
<div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 bg-white px-4 py-6 pt-8 text-center md:px-16">
<a href="https://precedent.dev">
<a href="https://precedent-krone.vercel.app">
<Image
src="/logo.png"
alt="Logo"
Expand All @@ -34,7 +34,7 @@ const SignInModal = ({
</a>
<h3 className="font-display text-2xl font-bold">Sign In</h3>
<p className="text-sm text-gray-500">
This is strictly for demo purposes - only your email and profile
only your email and profile
picture will be stored.
</p>
</div>
Expand Down
1 change: 0 additions & 1 deletion lib/constants.ts

This file was deleted.

2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const nextConfig = {
return [
{
source: "/github",
destination: "https://github.com/steven-tey/precedent",
destination: "https://github.com/admineral",
permanent: false,
},
];
Expand Down
Loading

0 comments on commit 8dfa384

Please sign in to comment.