From fb6896019a999e939dd7f12196722e55bf852e1b Mon Sep 17 00:00:00 2001 From: Nick Tchayka Date: Tue, 5 Sep 2023 13:20:16 +0100 Subject: Add features --- src/components/CodeFrame.tsx | 15 +--- src/components/HomepageFeatures/index.tsx | 89 +++++++++++++++++------ src/components/HomepageFeatures/styles.module.css | 11 --- 3 files changed, 69 insertions(+), 46 deletions(-) (limited to 'src/components') diff --git a/src/components/CodeFrame.tsx b/src/components/CodeFrame.tsx index 957eb5b..22cff25 100644 --- a/src/components/CodeFrame.tsx +++ b/src/components/CodeFrame.tsx @@ -19,18 +19,11 @@ const widthClasses = { "1/3": "w-1/3", }; -const dimensionClasses = ["border-4"]; +const dimensionClasses = ["border-4", "flex", "flex-row", "items-center"]; -const lightModeClasses = ["bg-white", "text-black", "border-black"]; +const lightModeClasses = ["bg-codeBg", "text-black", "border-black"]; -const darkModeClasses = [ - "bg-slate-950", - "text-white", - "border-white", - "shadow-neowhite", -].map((className) => `dark:${className}`); - -const classes = [...dimensionClasses, ...lightModeClasses, ...darkModeClasses]; +const classes = [...dimensionClasses, ...lightModeClasses]; const Frame = ({ rainbow, @@ -47,7 +40,7 @@ const Frame = ({ return (
diff --git a/src/components/HomepageFeatures/index.tsx b/src/components/HomepageFeatures/index.tsx index 91ef460..2191ea1 100644 --- a/src/components/HomepageFeatures/index.tsx +++ b/src/components/HomepageFeatures/index.tsx @@ -1,53 +1,94 @@ -import React from 'react'; -import clsx from 'clsx'; -import styles from './styles.module.css'; +import React from "react"; +import clsx from "clsx"; +import styles from "./styles.module.css"; +import CodeFrame from "../CodeFrame"; + +type ShowCase = + | { code: string; language: string } + | { img: React.ComponentType> }; type FeatureItem = { title: string; - Svg: React.ComponentType>; description: JSX.Element; + showcase: ShowCase; }; const FeatureList: FeatureItem[] = [ { - title: 'Easy to Use', - Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, + title: "Beautiful, Ready-to-Use Tools", + description: ( + <> + NeoHaskell offers a clean and intuitive language design, complemented by + a core library that provides all the tools you need to start creating + amazing software right away. +
+ START CODING + + ), + showcase: { + language: "haskell", + code: `processLogs rawLogs = + rawLogs + |> map parseLogs + |> collect + |> andThen (filter isImportant) + |> andThen (map toStructuredLog)`, + }, + }, + { + title: "Hassle-Free Development Environment", description: ( <> - Docusaurus was designed from the ground up to be easily installed and - used to get your website up and running quickly. + NeoHaskell's CLI tool installs all required utilities and makes + multi-platform support a breeze. Whether you're compiling to native code + or generating WebAssembly for browser compatibility, you'll enjoy error + messages that guide, not hinder. +
+ EMPOWER YOUR DEVELOPMENT ), + showcase: { code: "", language: "" }, }, { - title: 'Focus on What Matters', - Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, + title: "Focus-Driven, Event-Driven", description: ( <> - Docusaurus lets you focus on your docs, and we'll do the chores. Go - ahead and move your docs into the docs directory. + In NeoHaskell, you work directly events and functions that react to + them. Say goodbye to the cognitive overhead of managing state or + wrestling with dependency injection. Your focus stays where it belongs: + on solving problems and crafting solutions. +
+ BEGIN YOUR JOURNEY ), + showcase: { code: "", language: "" }, }, { - title: 'Powered by React', - Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, + title: "Naturally Full-Stack", description: ( <> - Extend or customize your website layout by reusing React. Docusaurus can - be extended while reusing the same header and footer. + Relish the ease of crafting full-stack applications in a unified + language environment. NeoHaskell takes care of frontend-backend + communication, allowing you to focus solely on your application's logic. +
+ EXPERIENCE NATURAL FULL-STACK DEVELOPMENT ), + showcase: { code: "", language: "" }, }, ]; -function Feature({title, Svg, description}: FeatureItem) { +function Feature({ title, showcase, description }: FeatureItem) { + const showcaseComponent = + "code" in showcase ? ( + {showcase.code} + ) : ( + + ); return ( -
-
- -
-
+
+ {showcaseComponent} +

{title}

{description}

@@ -57,9 +98,9 @@ function Feature({title, Svg, description}: FeatureItem) { export default function HomepageFeatures(): JSX.Element { return ( -
+
-
+
{FeatureList.map((props, idx) => ( ))} diff --git a/src/components/HomepageFeatures/styles.module.css b/src/components/HomepageFeatures/styles.module.css index b248eb2..e69de29 100644 --- a/src/components/HomepageFeatures/styles.module.css +++ b/src/components/HomepageFeatures/styles.module.css @@ -1,11 +0,0 @@ -.features { - display: flex; - align-items: center; - padding: 2rem 0; - width: 100%; -} - -.featureSvg { - height: 200px; - width: 200px; -} -- cgit