Skip to content

Commit

Permalink
Implement initial version of the top half of the new design (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
damianstasik authored Aug 31, 2023
1 parent 17c99d6 commit dd4c7cd
Show file tree
Hide file tree
Showing 25 changed files with 4,960 additions and 74 deletions.
31 changes: 30 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const config = {
],

plugins: [
async function tailwindPlugin() {
function tailwindPlugin() {
return {
name: "tailwindcss",
configurePostCss(postcssOptions) {
Expand Down Expand Up @@ -142,6 +142,35 @@ const config = {
additionalLanguages: ["hcl"],
},
}),
customFields: {
companiesWithLogos: [
{
name: "Gruntwork",
logo: "/logos/gruntwork.png",
pledge: "Development; open-source community efforts",
},
{
name: "Spacelift",
logo: "/logos/spacelift.svg",
pledge: "Cover the cost of 5 FTEs for at least 5 years",
},
{
name: "env0",
logo: "/logos/env0.svg",
pledge: "Cover the cost of 5 FTEs for at least 5 years",
},
{
name: "Scalr",
logo: "/logos/scalr.svg",
pledge: "Cover the cost of 3 FTEs for at least 5 years",
},
{
name: "Harness",
logo: "/logos/harness.svg",
pledge: "Cover the cost of 5 FTEs for at least 5 years",
},
],
},
};

module.exports = config;
5 changes: 4 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
]
},
"engines": {
"node": ">=16.14"
"node": ">=18.17.1"
},
"devDependencies": {
"cheerio": "^1.0.0-rc.12"
}
}
53 changes: 53 additions & 0 deletions src/components/Goals/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from "react";
import ExpandIcon from "../../icons/expand.svg";
import DotsIcon from "../../icons/dots.svg";
import ScaleIcon from "../../icons/scale.svg";
import LayersIcon from "../../icons/layers.svg";
import HumidityIcon from "../../icons/humidity.svg";

function Goal({ icon: Icon, title, description }) {
return (
<div className="bg-dark2 p-6">
<Icon className="w-12 mb-4" />
<h4 className="text-xl mb-2">{title}</h4>
<p className="text-[#818995]">{description}</p>
</div>
);
}

export default function Goals() {
return (
<section className="py-6 md:py-12 mx-auto container">
<h3 className="text-center text-3xl md:text-5xl font-bold mb-6 md:mb-12">
Our Goals
</h3>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Goal
icon={ExpandIcon}
title="Truly open-source"
description="under a well-known and widely-accepted license that companies can trus, that won’t suddenly change in the future, and isn’t subhect to the whims of a singe vendor."
/>
<Goal
icon={DotsIcon}
title="Community-driven"
description="so that the community governs the project for the community, where pull requests are regularly reviewed and accepted on their merit."
/>
<Goal
icon={ScaleIcon}
title="Impartial"
description="so that valuable features and fixes are accepted based on their value to the community, regardless of their impact on any particular vendor."
/>
<Goal
icon={LayersIcon}
title="Layered and modular"
description="with a programmer-friendly project structure to encourage building on top, enabling a new vibrant ecosystem of tools and integrations."
/>
<Goal
icon={HumidityIcon}
title="Backwards-compatibile"
description="so that the existing code can drive value for years to come."
/>
</div>
</section>
);
}
51 changes: 51 additions & 0 deletions src/components/Hero/index.tsx

Large diffs are not rendered by default.

29 changes: 0 additions & 29 deletions src/components/HomePage/index.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/Pattern/index.module.css

This file was deleted.

24 changes: 0 additions & 24 deletions src/components/Pattern/index.tsx

This file was deleted.

125 changes: 125 additions & 0 deletions src/components/Supporters/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import React, { useState } from "react";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import supporters from "../../../supporters.json";
import Link from "@docusaurus/Link";

type SupporterTypeProps = {
children: React.ReactNode;
count?: number;
withSeparator?: boolean;
};

function SupporterType({ children, withSeparator, count }: SupporterTypeProps) {
return (
<li className=" text-white h-12 flex items-center">
{children}
{count && (
<sup className="ml-1 mt-2 text-brandLight text-base font-bold">
{count}
</sup>
)}
{withSeparator && <span className="mx-4 text-white/50"></span>}
</li>
);
}

function groupSupportersByType(supporters) {
const groupedSupporters = {};
for (const supporter of supporters) {
let { type } = supporter;

switch (true) {
case type.includes("Individual"):
type = "Individuals";
break;
case type === "Company":
type = "Companies";
break;
case type === "Project":
type = "Projects";
break;
case type === "Foundation":
type = "Foundations";
break;
}

if (!groupedSupporters[type]) {
groupedSupporters[type] = [];
}
groupedSupporters[type].push(supporter);
}
return groupedSupporters;
}

export default function Supporters() {
const { siteConfig } = useDocusaurusContext();
const [showAll, setShowAll] = useState(false);
const groupedSupporters = groupSupportersByType(supporters);
const types = Object.keys(groupedSupporters);

const truncatedSupporters = showAll ? supporters : supporters.slice(0, 5);

return (
<section className="py-12 mx-auto container items-center flex flex-col">
<h3 className="text-center text-3xl md:text-5xl font-bold mb-4 md:mb-7">
Supporters
</h3>
<ol className="inline-flex" role="list">
{types.map((type, index) => (
<SupporterType
key={type}
count={groupedSupporters[type].length}
withSeparator={index < types.length - 1}
>
{type}
</SupporterType>
))}
</ol>
<table className="w-full mt-6 md:mt-12 mb-6 border-0 sm:max-w-2xl md:max-w-3xl lg:max-w-4xl table">
<tbody>
{siteConfig.customFields.companiesWithLogos.map((supporter) => (
<tr
className="even:bg-transparent border-t-0 border-b border-white/20 w-full"
key={supporter.name}
>
<td className="py-3 md:py-6 border-0 w-2/6 md:w-1/6 px-6">
<Link
href={supporter.url}
target="_blank"
rel="noopener noreferrer"
>
<img
src={supporter.logo}
alt={supporter.name}
className="min-w-[100px]"
/>
</Link>
</td>
<td className="py-3 md:py-6 border-0 w-2/6 text-center text-[#9DA6B5]">
Company
</td>
<td className="py-3 md:py-6 border-0 w-2/6 md:w-3/6 text-right text-[#9DA6B5] px-6">
{supporter.pledge}
</td>
</tr>
))}
</tbody>
</table>
<div className="flex gap-6 justify-center">
<button
type="button"
className="border text-white h-12 px-6 flex items-center hover:no-underline border-white/20"
onClick={() => setShowAll((value) => !value)}
>
{showAll ? "Show Less" : "Show More"}
</button>
<Link
href="/support"
className="bg-brand text-white h-12 px-6 flex items-center hover:no-underline hover:text-white hover:bg-brand/80 transition-colors"
>
Support Us
</Link>
</div>
</section>
);
}
17 changes: 14 additions & 3 deletions src/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,[email protected],300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap");

@tailwind base;
@tailwind components;
@tailwind utilities;
Expand All @@ -10,13 +12,22 @@ html[data-theme="dark"] {
--ifm-color-primary-light: #c698ff;
--ifm-color-primary-lighter: #d0aaff;
--ifm-color-primary-lightest: #efe2ff;
--ifm-background-color: #21252b;
--ifm-navbar-background-color: #2c3036;
--ifm-background-color: theme("colors.dark1");
--ifm-navbar-background-color: transparent;
--ifm-heading-font-family: theme("fontFamily.sans");
}

.navbar {
height: 96px;
border-top: 2px solid #923dfe;
padding: 0;
}

.navbar__inner {
@apply px-6 md:px-0 container mx-auto;
}

.navbar--fixed-top {
position: static;
}

.navbar__logo {
Expand Down
3 changes: 3 additions & 0 deletions src/icons/dots.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/icons/expand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/icons/humidity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/icons/layers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/icons/scale.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import React from "react";
import Layout from "@theme/Layout";

import Pattern from "../components/Pattern";
import HomePage from "../components/HomePage";
import Hero from "../components/Hero";
import Goals from "../components/Goals";
import Supporters from "../components/Supporters";

export default function Home() {
return (
<Layout>
<Pattern />
<HomePage />
<Hero />
<Goals />
<Supporters />
</Layout>
);
}
1 change: 1 addition & 0 deletions static/logos/env0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/logos/gruntwork.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit dd4c7cd

Please sign in to comment.