Skip to content

Commit

Permalink
Merge pull request #95 from NillionNetwork/feat/mini-refactor-one-pager
Browse files Browse the repository at this point in the history
Feat: One Pager HomePage for Docs
  • Loading branch information
crypblizz8 authored Sep 18, 2024
2 parents b5ebe95 + 38668e8 commit 97fb819
Show file tree
Hide file tree
Showing 9 changed files with 412 additions and 42 deletions.
4 changes: 0 additions & 4 deletions docs/welcome.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
slug: /
---

import LinkButton from '@site/src/components/LinkButton/index';

# Welcome to Nillion's Docs
Expand Down
18 changes: 14 additions & 4 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
colorMode: {
defaultMode: 'dark',
respectPrefersColorScheme: true,
},
image: 'img/nillion-banner.jpeg',
navbar: {
logo: {
Expand All @@ -89,14 +93,20 @@ const config = {
{
type: 'doc',
position: 'left',
docId: 'welcome',
label: 'Docs',
docId: 'what-is-nillion',
label: 'Learn',
},
{
type: 'doc',
position: 'left',
docId: 'nada-by-example',
label: 'Nada by Example',
docId: 'start-building',
label: 'Build',
},
{
type: 'doc',
position: 'left',
docId: 'community-and-support',
label: 'Community',
},
{
href: 'https://github.com/NillionNetwork',
Expand Down
8 changes: 6 additions & 2 deletions src/components/LinkButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ import React from 'react';
import styles from './styles.module.css'; // Import CSS module for styling
import Link from '@docusaurus/Link';

const LinkButton = ({ text, link }) => {
const LinkButton = ({ text, link, small }) => {
return (
<Link to={link}>
<button className={styles.customButton}>{text}</button>
<button
className={small ? styles.smallCustomButton : styles.customButton}
>
{text}
</button>
</Link>
);
};
Expand Down
27 changes: 27 additions & 0 deletions src/components/LinkButton/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,30 @@
cursor: pointer;
text-decoration: none;
}

.smallCustomButton {
border: none;
text-align: center;
text-decoration: none;
font-size: 20px;
box-sizing: border-box;
cursor: pointer;
border-radius: 32px;
padding: 15px;
width: 25%;
align-items: center;
font-weight: 400;
background: rgb(0, 33, 245);
color: white !important;
}

@media screen and (max-width: 768px) {
.smallCustomButton {
width: 50%;
}
}

.smallCustomButton:hover {
cursor: pointer;
text-decoration: none;
}
49 changes: 36 additions & 13 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

@font-face {
font-family: 'TWKEverett';
src: url('../../static/fonts/TWKEverett-Medium-web.woff') format('woff');
font-family: "TWKEverett";
src: url("../../static/fonts/TWKEverett-Medium-web.woff") format("woff");
}

/* You can override the default Infima variables here. */
Expand All @@ -19,20 +19,22 @@
--ifm-color-primary-lighter: #4d4dff;
--ifm-color-primary-lightest: #ccccff;
--ifm-code-font-size: 95%;
--ifm-card-primary-grey: #f7f7f7;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
--feedback-primary-color: blue;
--feedback-font-family: 'TWKEverett';
--feedback-font-family: "TWKEverett";
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
[data-theme="dark"] {
--ifm-color-primary: #b7d8f7;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;
--ifm-color-primary-darkest: #1a8870;
--ifm-color-primary-light: #29d5b0;
--ifm-color-primary-lighter: #32d8b4;
--ifm-color-primary-lightest: #4fddbf;
--ifm-card-primary-grey: #646464;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}

Expand All @@ -59,18 +61,22 @@ h1,
h2,
h3,
h4 {
font-family: 'TWKEverett';
}

.navbar {
background: rgb(0, 33, 245);
font-family: "TWKEverett";
}

.navbar .clean-btn svg,
.navbar .navbar__title,
.navbar .navbar__item {
color: white !important;
}
[data-theme="light"] .navbar .navbar__item {
color: white !important;
filter: invert(0.8);
}

[data-theme="light"] .navbar .clean-btn svg {
filter: invert(0.8);
}

.navbar__title {
font-size: 30px;
Expand All @@ -81,7 +87,7 @@ h4 {
}

.header-github:before {
content: '';
content: "";
width: 24px;
height: 24px;
display: flex;
Expand All @@ -91,17 +97,34 @@ h4 {

/* Dark mode css */

[data-theme='dark'] .header-github:hover {
filter: invert(0.8);
[data-theme="dark"] .header-github:hover {
filter: invert(1);
}

[data-theme='dark'] .sidebar-title {
[data-theme="dark"] .sidebar-title {
border-bottom: solid rgb(96, 103, 112) 1px;
}

@media (min-width: 768px) {
.main-wrapper .container {
padding-left: 2em;
}
}

.divider {
width: 100%;
height: 1px;
background-color: #ccc;
margin: 20px 0;
}

.theme-doc-sidebar-menu.menu__list {
padding-top: 1em !important;
padding-bottom: 3em !important;
}

.theme-doc-sidebar-menu .menu__list {
padding-top: 0 !important;
padding-bottom: 0 !important;
}

96 changes: 96 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import React from "react";
import Layout from "@theme/Layout";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import styles from "./index.module.css";
import Link from "@docusaurus/Link";
import LinkButton from "../components/LinkButton";

function HeroSection() {
const { siteConfig } = useDocusaurusContext();

return (
<header className={styles.heroBanner}>
<div className={styles.heroContent}>
<h1 className={styles.heroTitle}>{siteConfig.title}</h1>
<h2 className={styles.heroSubtitle}>
Humanity's first blind computer.
</h2>
<p className={styles.heroDescription}>
Nillion is a secure computation network that decentralizes trust for
high value data in the same way that blockchains decentralized
transactions.
</p>
<div className={styles.getStartedButton}>
<LinkButton text="Get Started" link="/quickstart" small={true} />
</div>
</div>
<div className={styles.heroImageContainer}>
<img
src="https://nillion.com/wp-content/themes/nillion/assets/images/index/web-summit.svg"
alt="Nillion Network Illustration"
className={styles.spinningImage}
/>
</div>
</header>
);
}

function FeatureItem({ title, description, href, icon }) {
return (
<Link to={href} className={styles.featureItem}>
<div className={styles.featureIcon}>{icon}</div>
<h3>{title}</h3>
<p>{description}</p>
</Link>
);
}

function FeaturesSection() {
const features = [
{
title: "Learn",
description:
"Nillion is a secure computation network that decentralizes trust for high value data in the same way that blockchains decentralized transactions.",
icon: "🎓",
href: "./what-is-nillion",
},
{
title: "Build",
description:
"Start building on Nillion with one of our developer quickstart guides. Create fullstack Python and Javscript applications with Nada.",
icon: "👷",
href: "./start-building",
},
{
title: "Community",
description:
"Join the Nillion community to connect, collaborate, and contribute to the future of blind computation.",
icon: "🌐",
href: "./community-and-support",
},
];

return (
<section className={styles.features}>
{features.map((props, idx) => (
<FeatureItem key={idx} {...props} />
))}
</section>
);
}

export default function Home() {
return (
<Layout
title="Home"
description="Nillion Builder Docs - Humanity's first blind computer"
noFooter={true}
wrapperClassName="homepage"
>
<main className={styles.main}>
<HeroSection />
<FeaturesSection />
</main>
</Layout>
);
}
Loading

0 comments on commit 97fb819

Please sign in to comment.