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

Improve landing page #128

Merged
merged 14 commits into from
Jan 2, 2025
Binary file added frontend/public/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions frontend/src/app/faqs/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use client';

import localFont from 'next/font/local';
import Footer from '../../components/Footer';
import { FAQ } from '../../components/FAQ';

const geistSans = localFont({
src: '../fonts/GeistMonoVF.woff',
variable: '--font-geist-sans',
weight: '100 900',
});

export default function App() {
return (
<div
className={`from-backgroundLight to-backgroundDark flex min-h-screen flex-col items-center justify-between bg-gradient-to-b ${geistSans.variable}`}
>
<FAQ />
<Footer />
</div>
);
}
81 changes: 9 additions & 72 deletions frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,75 +1,12 @@
'use client';

import { LoaderCircle } from 'lucide-react';
import { type LiteralUnion, signIn } from 'next-auth/react';
import { useCallback, useMemo, useState } from 'react';
import { GoogleIcon } from '../components/common/GoogleIcon';
import { DiscordIcon } from '../components/common/DiscordIcon';
import type { BuiltInProviderType } from 'next-auth/providers/index';
import { Metadata } from 'next';
import { Home } from '../views/Home';

export default function App() {
const [isLoading, setIsLoading] = useState(false);

const handleAuth = useCallback(
(provider: LiteralUnion<BuiltInProviderType>) => () => {
setIsLoading(true);
signIn(provider);
},
[],
);

const handleGoogleAuth = useMemo(() => handleAuth('google'), [handleAuth]);
const handleDiscordAuth = useMemo(() => handleAuth('discord'), [handleAuth]);

return (
<div className='flex min-h-screen items-center justify-center bg-gradient-to-r from-blue-500 to-purple-600'>
<div className='w-full max-w-md rounded-lg bg-white p-8 shadow-2xl'>
<h1 className='mb-6 text-center text-3xl font-bold text-gray-800'>
Welcome to Auto-Drive
</h1>
<p className='mb-8 text-center text-gray-600'>
Sign in with your Google account to start using our decentralized
storage service
</p>
<div className='flex flex-col items-center justify-center gap-4'>
<button
onClick={handleGoogleAuth}
disabled={isLoading}
className='flex w-full max-w-xs transform items-center justify-center rounded-full border-2 border-transparent bg-black px-6 py-3 font-bold text-white transition duration-300 ease-in-out hover:-translate-y-1 hover:scale-105 hover:border-white hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2'
aria-label='Sign in with Google'
>
{isLoading ? (
<div className='flex items-center justify-center'>
<LoaderCircle className='mr-2 h-4 w-4 animate-spin' />
Redirecting...
</div>
) : (
<>
<GoogleIcon />
Sign in with Google
</>
)}
</button>
<button
onClick={handleDiscordAuth}
disabled={isLoading}
className='flex w-full max-w-xs transform items-center justify-center rounded-full border-2 border-transparent bg-black px-6 py-3 font-bold text-white transition duration-300 ease-in-out hover:-translate-y-1 hover:scale-105 hover:border-white hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2'
aria-label='Sign in with Google'
>
{isLoading ? (
<div className='flex items-center justify-center'>
<LoaderCircle className='mr-2 h-4 w-4 animate-spin' />
Redirecting...
</div>
) : (
<>
<DiscordIcon />
Sign in with Discord
</>
)}
</button>
</div>
</div>
</div>
);
return <Home />;
}

export const metadata: Metadata = {
title: 'Auto-Drive',
description:
'Store, share, and download your files securely with autonomys decentralized permanent storage.',
};
45 changes: 45 additions & 0 deletions frontend/src/components/FAQ/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'use client';

import { FC, useCallback, useState } from 'react';
import { LandingHeader } from '../common/LandingHeader';
import { faqs } from '../../constants/faqs';

export const FAQ: FC = () => {
const [openIndex, setOpenIndex] = useState<number | null>(null);
const toggleFAQ = useCallback(
(index: number) => setOpenIndex(openIndex === index ? null : index),
[openIndex],
);

return (
<div className='min-h-full w-full'>
<LandingHeader />
<div className='mt-8 flex w-full flex-col items-center justify-center'>
<div className='mt-4 w-[60%]'>
{faqs.map((question, index) => (
<div key={index} className='m-4'>
<button
className='dark:bg-boxDark w-full rounded-lg bg-white p-8 text-left text-gray-900 shadow-md dark:border-none dark:text-white'
onClick={() => toggleFAQ(index)}
>
<span className='font-semibold'>
{index + 1}. {question.question}
</span>
<span className='float-right'>
{openIndex === index ? '▲' : '▼'}
</span>
</button>
{openIndex === index && (
<div className='mt-2 rounded-lg bg-gray-100 p-4 dark:bg-gray-700'>
<p className='whitespace-pre-line text-gray-700 dark:text-white'>
{question.answer}
</p>
</div>
)}
</div>
))}
</div>
</div>
</div>
);
};
162 changes: 162 additions & 0 deletions frontend/src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
import { EXTERNAL_ROUTES } from '../../constants/routes';
import type { FC } from 'react';
import { currentYear } from '../../utils/time';
import { LogoIcon } from '../common/LogoIcon';

const Footer: FC = () => {
return (
<footer className='container mb-[50px] px-4 sm:mx-auto xl:px-0'>
<div className='body-font rounded-xl bg-backgroundDarker p-10 text-white dark:bg-backgroundDark'>
<div className='md:grid md:grid-cols-2'>
<div className='mb-20 flex justify-center md:mb-0 md:justify-start'>
<div className='flex flex-col md:justify-between'>
<div className='shrink-0 text-center md:mx-0 md:text-left'>
<LogoIcon fillColor='white' />
</div>
<div className='container mx-auto hidden flex-col flex-wrap pb-1 pr-5 pt-20 sm:flex sm:flex-row'>
<p className='text-center text-xs text-whiteOpaque sm:text-left'>
© {currentYear()} Autonomys Labs, Inc. All Rights Reserved
</p>
</div>
</div>
</div>
<div className='grid grid-cols-1 gap-8 sm:grid-cols-2 sm:gap-6'>
<div>
<h2 className='title-font mb-6 text-xs font-semibold uppercase text-white'>
Links:
</h2>
<ul className='text-whiteOpaque dark:text-gray-400'>
<li key='academy' className='mb-4'>
<a
target='_blank'
href={EXTERNAL_ROUTES.academy}
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
Academy
</a>
</li>
<li key='forum' className='mb-4'>
<a
href={EXTERNAL_ROUTES.forum}
target='_blank'
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
Forum
</a>
</li>
<li key='docs' className='mb-4'>
<a
href={EXTERNAL_ROUTES.docs}
target='_blank'
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
Docs
</a>
</li>
<li key='autonomys'>
<a
target='_blank'
href={EXTERNAL_ROUTES.autonomys}
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
Website
</a>
</li>
</ul>
</div>
<div className='grid grid-cols-2 gap-x-6'>
<h2 className='title-font col-span-2 mb-6 text-xs font-semibold uppercase text-white'>
Social:
</h2>
<ul className='space-y-4 text-gray-600 dark:text-gray-400'>
<li key='twitter'>
<a
target='_blank'
href={EXTERNAL_ROUTES.social.twitter}
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
X / Twitter
</a>
</li>
<li key='discord'>
<a
target='_blank'
href={EXTERNAL_ROUTES.social.discord}
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
Discord
</a>
</li>
<li key='telegram'>
<a
target='_blank'
href={EXTERNAL_ROUTES.social.telegram}
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
Telegram
</a>
</li>
<li key='github'>
<a
target='_blank'
href={EXTERNAL_ROUTES.social.github}
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
GitHub
</a>
</li>
</ul>
<ul className='space-y-4 text-gray-600 dark:text-gray-400'>
<li key='medium'>
<a
target='_blank'
href={EXTERNAL_ROUTES.social.medium}
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
Medium
</a>
</li>
<li key='youtube'>
<a
target='_blank'
href={EXTERNAL_ROUTES.social.youtube}
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
YouTube
</a>
</li>
<li key='linkedin'>
<a
target='_blank'
href={EXTERNAL_ROUTES.social.linkedin}
className='hover:text-primaryAccent text-xs text-whiteOpaque'
rel='noreferrer'
>
LinkedIn
</a>
</li>
</ul>
</div>
</div>
</div>
<div className='container mx-auto flex flex-col flex-wrap pb-1 pr-5 pt-20 sm:hidden sm:flex-row'>
<p className='text-center text-sm text-whiteOpaque sm:text-left'>
© {currentYear()} Autonomys Network, Inc. All Rights Reserved
</p>
</div>
</div>
</footer>
);
};

export default Footer;
8 changes: 6 additions & 2 deletions frontend/src/components/common/DiscordIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export const DiscordIcon = () => {
export const DiscordIcon = ({
fillColor = '#5865F2',
}: {
fillColor?: string;
}) => {
return (
<svg
width='800px'
Expand All @@ -13,7 +17,7 @@ export const DiscordIcon = () => {
<g>
<path
d='M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z'
fill='#5865F2'
fill={fillColor}
fillRule='nonzero'
></path>
</g>
Expand Down
45 changes: 39 additions & 6 deletions frontend/src/components/common/GoogleIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,47 @@
export const GoogleIcon = () => {
return (
<svg
className='mr-2 h-6 w-6'
viewBox='0 0 24 24'
className='aspect-square h-6 w-6'
viewBox='-0.5 0 48 48'
version='1.1'
xmlns='http://www.w3.org/2000/svg'
xmlnsXlink='http://www.w3.org/1999/xlink'
>
<path
fill='#ffffff'
d='M12.24 10.285V14.4h6.806c-.275 1.765-2.056 5.174-6.806 5.174-4.095 0-7.439-3.389-7.439-7.574s3.345-7.574 7.439-7.574c2.33 0 3.891.989 4.785 1.849l3.254-3.138C18.189 1.186 15.479 0 12.24 0c-6.635 0-12 5.365-12 12s5.365 12 12 12c6.926 0 11.52-4.869 11.52-11.726 0-.788-.085-1.39-.189-1.989H12.24z'
/>
<title>Google-color</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g
id='Icons'
stroke='none'
strokeWidth='1'
fill='none'
fillRule='evenodd'
>
<g id='Color-' transform='translate(-401.000000, -860.000000)'>
<g id='Google' transform='translate(401.000000, 860.000000)'>
<path
d='M9.82727273,24 C9.82727273,22.4757333 10.0804318,21.0144 10.5322727,19.6437333 L2.62345455,13.6042667 C1.08206818,16.7338667 0.213636364,20.2602667 0.213636364,24 C0.213636364,27.7365333 1.081,31.2608 2.62025,34.3882667 L10.5247955,28.3370667 C10.0772273,26.9728 9.82727273,25.5168 9.82727273,24'
id='Fill-1'
fill='#FBBC05'
></path>
<path
d='M23.7136364,10.1333333 C27.025,10.1333333 30.0159091,11.3066667 32.3659091,13.2266667 L39.2022727,6.4 C35.0363636,2.77333333 29.6954545,0.533333333 23.7136364,0.533333333 C14.4268636,0.533333333 6.44540909,5.84426667 2.62345455,13.6042667 L10.5322727,19.6437333 C12.3545909,14.112 17.5491591,10.1333333 23.7136364,10.1333333'
id='Fill-2'
fill='#EB4335'
></path>
<path
d='M23.7136364,37.8666667 C17.5491591,37.8666667 12.3545909,33.888 10.5322727,28.3562667 L2.62345455,34.3946667 C6.44540909,42.1557333 14.4268636,47.4666667 23.7136364,47.4666667 C29.4455,47.4666667 34.9177955,45.4314667 39.0249545,41.6181333 L31.5177727,35.8144 C29.3995682,37.1488 26.7323182,37.8666667 23.7136364,37.8666667'
id='Fill-3'
fill='#34A853'
></path>
<path
d='M46.1454545,24 C46.1454545,22.6133333 45.9318182,21.12 45.6113636,19.7333333 L23.7136364,19.7333333 L23.7136364,28.8 L36.3181818,28.8 C35.6879545,31.8912 33.9724545,34.2677333 31.5177727,35.8144 L39.0249545,41.6181333 C43.3393409,37.6138667 46.1454545,31.6490667 46.1454545,24'
id='Fill-4'
fill='#4285F4'
></path>
</g>
</g>
</g>
</svg>
);
};
Loading
Loading