diff --git a/src/components/Ai/index.tsx b/src/components/Ai/index.tsx new file mode 100644 index 00000000..e068240e --- /dev/null +++ b/src/components/Ai/index.tsx @@ -0,0 +1,20 @@ +import BashSnippet from "@site/src/components/BashSnippet"; +import styles from "./styles.module.scss"; + +export default function Build(): JSX.Element { + return ( +
+

+ Building with AI agents? +

+

+ Give them instant knowledge by installing skills. +

+ + +
+ ); +} diff --git a/src/components/Ai/styles.module.scss b/src/components/Ai/styles.module.scss new file mode 100644 index 00000000..3eb002db --- /dev/null +++ b/src/components/Ai/styles.module.scss @@ -0,0 +1,32 @@ +@use "../../mixins/fonts"; + +.section { + display: flex; + flex-direction: column; + align-items: center; +} + +.sub { + margin: 6rem 0 0.75rem; + text-align: center; + @include fonts.h2; +} + +.agents { + html[data-theme="light"] & { + text-decoration: underline; + text-underline-offset: 2px; + text-decoration-color: var(--ifm-color-primary); + text-decoration-style: wavy; + } +} + +.text { + max-width: 324px; + margin-bottom: 2rem; + text-align: center; + + @media screen and (min-width: 768px) { + max-width: 524px; + } +} diff --git a/src/components/BashSnippet/index.tsx b/src/components/BashSnippet/index.tsx new file mode 100644 index 00000000..caa0eb7f --- /dev/null +++ b/src/components/BashSnippet/index.tsx @@ -0,0 +1,49 @@ +import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +import { trackEvent } from "@site/src/providers/analytics.providers"; +import CodeBlock from "@theme/CodeBlock"; +import { useRef } from "react"; +import styles from "./styles.module.scss"; + +export default function BashSnippet({ + analyticsEventName, + cmd +}: { + analyticsEventName: string; + cmd: string; +}): JSX.Element { + const { siteConfig } = useDocusaurusContext(); + const container = useRef(null); + + const onClick = async ({ target }: MouseEvent) => { + const btn = container.current?.querySelector('button[title="Copy"]'); + + if (!btn?.contains(target)) { + return; + } + + await trackEvent({ + name: analyticsEventName, + siteConfig + }); + }; + + return ( +
onClick($event as unknown as MouseEvent)} + > + + + + {cmd} +
+ ); +} diff --git a/src/components/BashSnippet/styles.module.scss b/src/components/BashSnippet/styles.module.scss new file mode 100644 index 00000000..af7e9ccc --- /dev/null +++ b/src/components/BashSnippet/styles.module.scss @@ -0,0 +1,37 @@ +.code { + position: relative; + + :global(.code-npm) { + width: 340px; + box-shadow: none; + margin: 0; + + code { + padding: var(--ifm-pre-padding) var(--ifm-pre-padding) + var(--ifm-pre-padding) 2rem; + } + + span { + color: #00fff5; + } + + button { + opacity: 1; + border-color: transparent; + padding-top: 0.55rem; + } + + button[aria-label="Toggle word wrap"] { + display: none; + } + } +} + +.bash { + position: absolute; + left: 0.75rem; + top: 50%; + transform: translate(0, -50%); + + z-index: 1; +} diff --git a/src/pages/index.module.scss b/src/pages/index.module.scss index 303b5eaf..bf9f18a7 100644 --- a/src/pages/index.module.scss +++ b/src/pages/index.module.scss @@ -39,6 +39,16 @@ } } +.ai { + @include section.section; + + padding: 1rem 3rem 6rem; + + @media screen and (min-width: 1140px) { + padding: 1rem 3rem 6rem; + } +} + .block { @include section.section; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 142f3984..0522b687 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,5 +1,6 @@ import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; import { initOrbiter } from "@junobuild/analytics"; +import AI from "@site/src/components/Ai"; import Build from "@site/src/components/Build"; import Features from "@site/src/components/Features"; import Head from "@site/src/components/Head"; @@ -56,6 +57,10 @@ export default function Home(): JSX.Element { +
+ +
+