feat: new home page

This commit is contained in:
DIYgod
2022-09-07 03:23:18 +01:00
parent 39647340ec
commit 9fc6b24839
6 changed files with 191 additions and 141 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
#### And inline by Next.js during docker build
#############################################################
NEXT_PUBLIC_APP_NAME=xlog
NEXT_PUBLIC_APP_NAME=XLog
NEXT_PUBLIC_OUR_DOMAIN=localhost:3000
NEXT_PUBLIC_DISCORD_LINK="https://discord.gg/9XscSqJEq4"
NEXT_PUBLIC_GITHUB_LINK="https://github.com/Crossbell-Box/xlog"
+2
View File
@@ -67,6 +67,7 @@
"react-dom": "^18.1.0",
"react-hook-form": "^7.31.1",
"react-hot-toast": "^2.2.0",
"react-scroll": "^1.8.7",
"react-sortablejs": "^6.1.1",
"refractor": "^4.7.0",
"rehype-prism-plus": "^1.4.0",
@@ -106,6 +107,7 @@
"@types/react": "^18.0.9",
"@types/react-avatar-editor": "^12.0.0",
"@types/react-dom": "^18.0.3",
"@types/react-scroll": "^1.8.4",
"@types/sortablejs": "^1.13.0",
"@types/ua-parser-js": "^0.7.36",
"@types/uuid": "^8.3.4",
+26
View File
@@ -38,6 +38,7 @@ specifiers:
'@types/react': ^18.0.9
'@types/react-avatar-editor': ^12.0.0
'@types/react-dom': ^18.0.3
'@types/react-scroll': ^1.8.4
'@types/sortablejs': ^1.13.0
'@types/ua-parser-js': ^0.7.36
'@types/uuid': ^8.3.4
@@ -81,6 +82,7 @@ specifiers:
react-dom: ^18.1.0
react-hook-form: ^7.31.1
react-hot-toast: ^2.2.0
react-scroll: ^1.8.7
react-sortablejs: ^6.1.1
refractor: ^4.7.0
rehype-prism-plus: ^1.4.0
@@ -156,6 +158,7 @@ dependencies:
react-dom: 18.2.0_react@18.2.0
react-hook-form: 7.33.0_react@18.2.0
react-hot-toast: 2.2.0_biqbaboplfbrettd7655fr4n2y
react-scroll: 1.8.7_biqbaboplfbrettd7655fr4n2y
react-sortablejs: 6.1.4_yi7d4rnqh6snv6o2bvvwtjnph4
refractor: 4.7.0
rehype-prism-plus: 1.4.1
@@ -195,6 +198,7 @@ devDependencies:
'@types/react': 18.0.14
'@types/react-avatar-editor': 12.0.0
'@types/react-dom': 18.0.5
'@types/react-scroll': 1.8.4
'@types/sortablejs': 1.13.0
'@types/ua-parser-js': 0.7.36
'@types/uuid': 8.3.4
@@ -2081,6 +2085,12 @@ packages:
'@types/react': 18.0.14
dev: true
/@types/react-scroll/1.8.4:
resolution: {integrity: sha512-DpHA9PYw42/rBrfKbGE/kAEvHRfyDL/ACfKB/ORWUYuCLi/yGrntxSzYXmg/7TLgQsJ5ma13GCDOzFSOz+8XOA==}
dependencies:
'@types/react': 18.0.14
dev: true
/@types/react/18.0.14:
resolution: {integrity: sha512-x4gGuASSiWmo0xjDLpm5mPb52syZHJx02VKbqUKdLmKtAwIh63XClGsiTI1K6DO5q7ox4xAsQrU+Gl3+gGXF9Q==}
dependencies:
@@ -6132,6 +6142,10 @@ packages:
resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
dev: true
/lodash.throttle/4.1.1:
resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==}
dev: false
/lodash/4.17.21:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
dev: false
@@ -7698,6 +7712,18 @@ packages:
use-sidecar: 1.1.2_luyos4mouogwq6z3wafb3re4ce
dev: false
/react-scroll/1.8.7_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-fBOIwweAlhicx8RqP9tQXn/Uhd+DTtVRjw+0VBsIn1Z+MjRYLhTZ0tMoTAU1vOD3dce8mI6copexI4yWII+Luw==}
peerDependencies:
react: ^15.5.4 || ^16.0.0 || ^17.0.0 || ^18.0.0
react-dom: ^15.5.4 || ^16.0.0 || ^17.0.0 || ^18.0.0
dependencies:
lodash.throttle: 4.1.1
prop-types: 15.8.1
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
dev: false
/react-sortablejs/6.1.4_yi7d4rnqh6snv6o2bvvwtjnph4:
resolution: {integrity: sha512-fc7cBosfhnbh53Mbm6a45W+F735jwZ1UFIYSrIqcO/gRIFoDyZeMtgKlpV4DdyQfbCzdh5LoALLTDRxhMpTyXQ==}
peerDependencies:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 135 KiB

+40 -25
View File
@@ -4,13 +4,16 @@ import { UniLink } from "../ui/UniLink"
import { ConnectButton } from "../common/ConnectButton"
import { getSiteLink } from "~/lib/helpers"
import Image from "next/image"
import { Link } from "react-scroll"
export function MainLayout({
children,
title,
tabs,
}: {
children?: React.ReactNode
title?: string
tabs?: string[]
}) {
return (
<>
@@ -19,45 +22,57 @@ export function MainLayout({
siteName={APP_NAME}
description={APP_DESCRIPTION}
/>
<header className="py-10">
<header className="py-5 fixed w-full top-0 bg-white z-50">
<div className="max-w-screen-lg px-5 mx-auto flex justify-between items-center">
<div className="text-3xl font-extrabold flex items-center">
<div className="inline-block w-16 h-16 mr-4">
<div className="inline-block w-9 h-9">
<Image alt={APP_NAME} src="/logo.svg" width={100} height={100} />
</div>
{APP_NAME.toUpperCase()}
</div>
<div className="space-x-5 text-zinc-500">
<div className="space-x-14 text-zinc-500 flex">
{tabs?.map((tab, index) => (
<Link
activeClass="text-theme-color"
className="cursor-pointer flex items-center"
to={tab}
spy={true}
smooth={true}
duration={500}
key={tab}
>
{tab}
</Link>
))}
<ConnectButton />
</div>
</div>
</header>
{children}
<footer className="mt-10 font-medium text-zinc-500 border-t">
<footer className="mt-10 font-medium border-t">
<div className="max-w-screen-lg px-5 py-14 mx-auto flex justify-between">
<div>
<span className="align-middle">
&copy;{" "}
<UniLink
href={getSiteLink({
subdomain: "blog",
})}
className="hover-text-theme-color"
>
{APP_NAME}
<span className="text-zinc-700 ml-2 inline-flex items-center space-x-5 align-middle">
{GITHUB_LINK && (
<UniLink className="flex items-center" href={GITHUB_LINK}>
<span className="inline-block i-mdi-github text-2xl hover:text-zinc-900"></span>
</UniLink>
</span>
<span className="text-zinc-400 ml-2 inline-flex items-center space-x-1 align-middle">
)}
{DISCORD_LINK && (
<UniLink className="flex items-center" href={DISCORD_LINK}>
<span className="inline-block i-mdi-discord text-xl hover-text-theme-color"></span>
<span className="inline-block i-mdi-discord text-2xl hover-text-theme-color"></span>
</UniLink>
{GITHUB_LINK && (
<UniLink className="flex items-center" href={GITHUB_LINK}>
<span className="inline-block i-mdi-github text-xl hover:text-zinc-900"></span>
</UniLink>
)}
</span>
</div>
)}
</span>
<span className="align-middle">
&copy;{" "}
<UniLink
href={getSiteLink({
subdomain: "blog",
})}
className="hover-text-theme-color"
>
{APP_NAME}
</UniLink>
</span>
</div>
</footer>
</>
+122 -115
View File
@@ -17,6 +17,7 @@ import { useConnectModal } from "@rainbow-me/rainbowkit"
import { useRouter } from "next/router"
import { GITHUB_LINK, APP_NAME } from "~/lib/env"
import { getSiteLink } from "~/lib/helpers"
import { Link, Element } from "react-scroll"
export const getServerSideProps: GetServerSideProps = async (ctx) => {
return {
@@ -60,11 +61,11 @@ export default function Home({ region }: { region: string | null }) {
height: 630,
},
icon: <BlockchainIcon className="inline mb-2" />,
title: "Blockchain",
title: "On-chain",
text: (
<>
All blog data, including config, posts, following, comment...
Permanently stored on the blockchain <b>by your own hands</b> and can
All blog data, including config, posts, following, comment, etc., are
permanently stored on the blockchain <b>by your own hands</b> and can
only be controlled by yourself and not the platform.
</>
),
@@ -73,11 +74,11 @@ export default function Home({ region }: { region: string | null }) {
screenshot: {
src: "/screenshot2.png",
width: 1528,
height: 1204,
height: 946,
},
icon: <LoveIcon className="inline mb-2" />,
title: "Rich Interactions",
text: "Users can follow, comment, like, and mint your blog and posts, all on the blockchain of course.",
text: "You can follow, comment, like, and mint your blog and posts, all on the blockchain of course.",
},
{
screenshot: {
@@ -89,16 +90,6 @@ export default function Home({ region }: { region: string | null }) {
title: "Highly Customizable",
text: "Domain name, navigation bar, custom styles, all as you wish, and stored on the blockchain.",
},
{
screenshot: {
src: "/screenshot1.png",
width: 1520,
height: 1331,
},
icon: <LaughIcon className="inline mb-2" />,
title: "Elegant",
text: "Elegant and clean default theme allows you to get a great looking blog straight away.",
},
]
const comparing = [
@@ -115,118 +106,134 @@ export default function Home({ region }: { region: string | null }) {
]
return (
<MainLayout>
<MainLayout tabs={["Features", `Why ${APP_NAME}`]}>
<section>
<div className="max-w-screen-lg px-5 mx-auto">
<div className="mt-28">
<h2 className="text-6xl font-bold">
Blog on the Blockchain.
<br />
Blogging geekily.
</h2>
<h3 className="mt-5 text-zinc-500">
Meet {APP_NAME}, the on-chain and{" "}
<div className="h-screen w-full flex justify-center flex-col relative">
<div className="w-28 h-28 mb-16">
<Image alt="logo" src="/logo.svg" width={200} height={200} />
</div>
<h2 className="text-5xl font-bold mb-5">Blog Free</h2>
<h3 className="mt-5 text-zinc-800 text-6xl font-light">
{APP_NAME}, an on-chain and{" "}
<UniLink href={GITHUB_LINK}>open-source</UniLink> blogging
platform for everyone.
</h3>
<div className="mt-10">
{addressIn ? (
<UniLink
href="/dashboard"
className="text-theme-color inline-flex items-center space-x-2"
>
<span className="i-bi-grid text-lg"></span>
<span>Dashboard</span>
</UniLink>
) : (
<ConnectButton />
)}
<div className="my-16">
<Button
className="text-theme-color w-80 h-10"
onClick={() =>
addressIn ? router.push("/dashboard") : openConnectModal?.()
}
size="xl"
>
{addressIn ? (
<>
<span className="i-bi-grid text-lg mr-2"></span>
<span>Dashboard</span>
</>
) : (
"Connect"
)}
</Button>
</div>
<div className="mt-8 text-zinc-500">
Trusted by these awesome teams and geeks
<ul className="mt-4 space-x-4">
<li className="inline-flex w-20 align-middle items-center">
<UniLink
href={getSiteLink({
subdomain: "rss3",
})}
>
<Image
src="/RSS3.png"
alt="RSS3"
width="2518"
height="629"
></Image>
</UniLink>
</li>
<li className="inline-flex w-12 align-middle items-center">
<UniLink
href={getSiteLink({
subdomain: "crossbell-blog",
})}
>
<Image
src="/Crossbell.svg"
alt="Crossbell"
width="1000"
height="1000"
></Image>
</UniLink>
</li>
<li className="inline-flex h-5 align-middle items-center">
<UniLink className="inline-block" href="#">
<DotsHorizontalIcon className="w-4 h-4" />
</UniLink>
</li>
</ul>
<div className="text-center absolute bottom-20 w-full">
<Link
to="Features"
spy={true}
smooth={true}
duration={500}
className="cursor-pointer inline-block i-fluent:ios-arrow-rtl-24-filled text-3xl rotate-90"
></Link>
</div>
<ul className="my-28 space-y-24">
{description.map((item, index) => (
<li
className="relative w-full flex items-center justify-center"
key={index}
>
<div className="w-3/5">
<Image
src={item.screenshot.src}
alt={item.title}
width={item.screenshot.width}
height={item.screenshot.height}
></Image>
</div>
<div className="w-2/5 px-8">
</div>
<div>
<Element name="Features">
<ul className="pt-28 space-y-24">
{description.map((item, index) => (
<li className="relative w-full" key={index}>
<p className="text-4xl font-bold">
{item.icon}
<br />
<span className="mr-4">{item.icon}</span>
{item.title}
</p>
<p className="text-zinc-500 mt-4">{item.text}</p>
</div>
</li>
))}
</ul>
<table className="mb-28 w-full table-fixed">
<tbody>
<tr className="border-b text-xl">
<th className="text-center w-60"></th>
<th className="text-center py-3">{APP_NAME}</th>
<th className="text-center">Mirror.xyz</th>
</tr>
{comparing.map((item, index) => (
<tr className="border-b" key={index}>
<td className="text-center py-3">{item}</td>
<td className="text-center">
<CheckIcon className="inline-block w-6 h-6 text-green-600" />
</td>
<td className="text-center">
<XIcon className="inline-block w-6 h-6 text-red-600" />
</td>
</tr>
<p className="text-3xl font-light mt-4 leading-normal mb-8">
{item.text}
</p>
<div>
<Image
src={item.screenshot.src}
alt={item.title}
width={item.screenshot.width}
height={item.screenshot.height}
></Image>
</div>
</li>
))}
</tbody>
</table>
</ul>
</Element>
<Element name={`Why ${APP_NAME}`}>
<div className="pt-28 text-4xl font-bold">Why {APP_NAME}</div>
<div className="my-10 text-zinc-500">
Trusted by these awesome teams and geeks
<ul className="mt-4 space-x-4">
<li className="inline-flex w-20 align-middle items-center">
<UniLink
href={getSiteLink({
subdomain: "rss3",
})}
>
<Image
src="/RSS3.png"
alt="RSS3"
width="2518"
height="629"
></Image>
</UniLink>
</li>
<li className="inline-flex w-12 align-middle items-center">
<UniLink
href={getSiteLink({
subdomain: "crossbell-blog",
})}
>
<Image
src="/Crossbell.svg"
alt="Crossbell"
width="1000"
height="1000"
></Image>
</UniLink>
</li>
<li className="inline-flex h-5 align-middle items-center">
<UniLink className="inline-block" href="#">
<DotsHorizontalIcon className="w-4 h-4" />
</UniLink>
</li>
</ul>
</div>
<table className="w-full table-fixed border-y-2 border-zinc-800">
<tbody>
<tr className="text-xl">
<th className="text-center w-60"></th>
<th className="text-center py-3">{APP_NAME}</th>
<th className="text-center">Mirror.xyz</th>
</tr>
{comparing.map((item, index) => (
<tr className="" key={index}>
<td className="text-center py-3">{item}</td>
<td className="text-center">
<span className="i-bxs:check-circle inline-block text-green-600 text-lg"></span>
</td>
<td className="text-center">
<span className="i-bxs:x-circle inline-block text-red-600 text-lg"></span>
</td>
</tr>
))}
</tbody>
</table>
</Element>
</div>
<div className="mt-10 text-center">
<div className="my-20 text-center">
<div className="w-20 h-20 mx-auto mb-8">
<Image alt="logo" src="/logo.svg" width={100} height={100} />
</div>