diff --git a/packages/website/src/components/asset-img/asset-img.module.css b/packages/website/src/components/asset-img/asset-img.module.css new file mode 100644 index 0000000000..878bd763c0 --- /dev/null +++ b/packages/website/src/components/asset-img/asset-img.module.css @@ -0,0 +1,3 @@ +.img { + display: block; +} diff --git a/packages/website/src/components/asset-img/asset-img.tsx b/packages/website/src/components/asset-img/asset-img.tsx new file mode 100644 index 0000000000..16630687af --- /dev/null +++ b/packages/website/src/components/asset-img/asset-img.tsx @@ -0,0 +1,15 @@ +import useBaseUrl from "@docusaurus/useBaseUrl"; +import style from "./asset-img.module.css"; + +export interface AssetImgProps { + src: string; + className?: string; +} + +/** + * Component for rendering an image resolving the relative path. + */ +export const AssetImg = ({ src, ...props }: AssetImgProps) => { + const fullSrc = useBaseUrl(`/img/${src}`); + return ; +}; diff --git a/packages/website/src/components/fluent-img.tsx b/packages/website/src/components/fluent-img.tsx index aa161cbd95..6c27a869cc 100644 --- a/packages/website/src/components/fluent-img.tsx +++ b/packages/website/src/components/fluent-img.tsx @@ -7,13 +7,17 @@ export interface FluentImgProps { } export type FluentImageName = - | "checkmark" | "chat" + | "checkmark" + | "design-layout" | "design" + | "document-add" + | "document-cloud" | "editor" | "eye-dev" | "firework" - | "people-shield"; + | "people-shield" + | "shield-blue"; /** * Component for rendering a Fluent image. diff --git a/packages/website/src/components/homepage/homepage.module.css b/packages/website/src/components/homepage/homepage.module.css index c378b494e1..4f76e423cc 100644 --- a/packages/website/src/components/homepage/homepage.module.css +++ b/packages/website/src/components/homepage/homepage.module.css @@ -1,6 +1,6 @@ .intro-container { background-repeat: no-repeat; - width: 100vw; + width: 100%; background-size: 100vw 94%; display: flex; diff --git a/packages/website/src/components/homepage/homepage.tsx b/packages/website/src/components/homepage/homepage.tsx index f20437350b..44eb96d864 100644 --- a/packages/website/src/components/homepage/homepage.tsx +++ b/packages/website/src/components/homepage/homepage.tsx @@ -5,6 +5,7 @@ import { SectionedLayout } from "../sectioned-layout/sectioned-layout"; import { Feature, FeatureGroup } from "./feature/feature"; import style from "./homepage.module.css"; import { Section } from "./section/section"; +import { Links } from "@site/src/constants"; const useFluentStyles = makeStyles({ bg: { backgroundColor: tokens.colorNeutralBackground3 }, @@ -93,18 +94,19 @@ const OpenAPISection = () => { header="Productivity" title="Streamline your OpenAPI workflow" description="Benefit from a huge ecosystem of OpenAPI tools for configuring API gateways, generating code, and validating your data." + image="illustrations/openapi3.png" items={[ { title: "TypeSpec for OpenAPI developers", - description: "Description todo", + description: "Get started with using TypeSpec coming from OpenAPI.", image: "design", - link: "/openapi", + link: Links.gettingStartedOpenAPI, }, { - title: "Title", - description: "Description todo", - image: "checkmark", - link: "todo", + title: "OpenAPI emitter reference", + description: "Reference documentation for the OpenAPI 3.0 emitter.", + image: "document-add", + link: "/docs/standard-library/openapi3/reference", }, ]} /> @@ -117,6 +119,7 @@ const EcoSystemSection = () => { header="Ecosystem" title="Test API endpoints as you code" description="Build a complete JSON RPC interface for your service, call it from your web browser, and test out endpoints in a breeze." + image="illustrations/openapi3.png" items={[ { title: "TypeSpec for JSON RPC developer", @@ -124,6 +127,12 @@ const EcoSystemSection = () => { image: "design", link: "/json-rpc", }, + { + title: "Validate messages with JSON Schema", + description: "Generate the JSON Schema for your JSON RPC message.", + image: "people-shield", + link: "/docs/standard-library/json-schema/reference", + }, ]} /> ); @@ -135,6 +144,7 @@ const FlexibilitySection = () => { header="Ecosystem" title="Action-oriented title todo" description="With TypeSpec, align your team around a common type vocabulary. " + image="illustrations/openapi3.png" items={[ { title: "Title todo", diff --git a/packages/website/src/components/homepage/section/section.module.css b/packages/website/src/components/homepage/section/section.module.css index 35e5cbd2ef..e115283032 100644 --- a/packages/website/src/components/homepage/section/section.module.css +++ b/packages/website/src/components/homepage/section/section.module.css @@ -55,19 +55,28 @@ .illustration { width: 80vw; - height: 70vw; + padding: 0; + overflow: hidden; } @media only screen and (min-width: 1200px) { .illustration { width: 50vw; - height: 40vw; } } .item-card { width: 100%; + display: flex; + flex-direction: column; + gap: 10px; +} + +.item { + display: flex; + gap: 12px } + .item-image { width: 52px; height: 52px; diff --git a/packages/website/src/components/homepage/section/section.tsx b/packages/website/src/components/homepage/section/section.tsx index 7a4e93747c..4bf40ea571 100644 --- a/packages/website/src/components/homepage/section/section.tsx +++ b/packages/website/src/components/homepage/section/section.tsx @@ -1,6 +1,5 @@ import { Caption1, - CardHeader, Divider, Link, Subtitle2, @@ -11,6 +10,7 @@ import { } from "@fluentui/react-components"; import { FluentImageName, FluentImg } from "../../fluent-img"; +import { AssetImg } from "../../asset-img/asset-img"; import { Card } from "../../card/card"; import style from "./section.module.css"; @@ -25,6 +25,7 @@ interface SectionProps { header: string; title: string; description: string; + image: string; items: SectionItem[]; layout?: "text-left" | "text-right"; } @@ -34,7 +35,7 @@ const useFluentStyles = makeStyles({ descriptionText: { color: tokens.colorNeutralForeground3 }, }); -export const Section = ({ header, title, description, items, layout }: SectionProps) => { +export const Section = ({ header, title, description, items, layout, image }: SectionProps) => { const fluentStyles = useFluentStyles(); return (
- + + + ); }; @@ -75,17 +78,15 @@ const SectionItem = ({ title, description, image, link }: SectionItem) => { const fluentStyles = useFluentStyles(); return ( - } - header={{title}} - description={ -
- - {description} - - Learn more -
- } - >
+
+ +
+ {title} + + {description} + + Learn more → +
+
); }; diff --git a/packages/website/src/components/sectioned-layout/sectioned-layout.module.css b/packages/website/src/components/sectioned-layout/sectioned-layout.module.css index 035739cf90..4a32404be7 100644 --- a/packages/website/src/components/sectioned-layout/sectioned-layout.module.css +++ b/packages/website/src/components/sectioned-layout/sectioned-layout.module.css @@ -1,4 +1,8 @@ .layout { + overflow-x: hidden; +} + +.layout-inner { display: flex; padding: 48px 0px 60px 0px; margin: auto; diff --git a/packages/website/src/components/sectioned-layout/sectioned-layout.tsx b/packages/website/src/components/sectioned-layout/sectioned-layout.tsx index 4a2509ef71..6efff15c5f 100644 --- a/packages/website/src/components/sectioned-layout/sectioned-layout.tsx +++ b/packages/website/src/components/sectioned-layout/sectioned-layout.tsx @@ -1,5 +1,9 @@ import style from "./sectioned-layout.module.css"; export const SectionedLayout = ({ children }) => { - return
{children}
; + return ( +
+
{children}
+
+ ); }; diff --git a/packages/website/src/constants.ts b/packages/website/src/constants.ts new file mode 100644 index 0000000000..7ff8551465 --- /dev/null +++ b/packages/website/src/constants.ts @@ -0,0 +1,5 @@ +export const Links = { + gettingStartedOpenAPI: "/docs/getting-started/typespec-for-openapi-dev", + gettingStartedWithHttp: "/docs/getting-started/getting-started-http", + spectral: "https://stoplight.io/open-source/spectral", +}; diff --git a/packages/website/src/pages/data-validation.tsx b/packages/website/src/pages/data-validation.tsx index 7262105c80..2e63546a53 100644 --- a/packages/website/src/pages/data-validation.tsx +++ b/packages/website/src/pages/data-validation.tsx @@ -49,6 +49,7 @@ const DataValidationContent = () => { header="Ecosystem" title="Test API endpoints as you code" description="Build a complete JSON RPC interface for your service, call it from your web browser, and test out endpoints in a breeze." + image="illustrations/openapi3.png" items={[ { title: "TypeSpec for JSON RPC developer", @@ -64,6 +65,7 @@ const DataValidationContent = () => { header="Ecosystem" title="Test API endpoints as you code" description="Build a complete JSON RPC interface for your service, call it from your web browser, and test out endpoints in a breeze." + image="illustrations/openapi3.png" items={[ { title: "TypeSpec for JSON RPC developer", diff --git a/packages/website/src/pages/json-rpc.tsx b/packages/website/src/pages/json-rpc.tsx index 98bce82161..6cfae67af4 100644 --- a/packages/website/src/pages/json-rpc.tsx +++ b/packages/website/src/pages/json-rpc.tsx @@ -49,6 +49,7 @@ const JsonRpcContent = () => { header="Ecosystem" title="Test API endpoints as you code" description="Build a complete JSON RPC interface for your service, call it from your web browser, and test out endpoints in a breeze." + image="illustrations/openapi3.png" items={[ { title: "TypeSpec for JSON RPC developer", @@ -64,6 +65,7 @@ const JsonRpcContent = () => { header="Ecosystem" title="Test API endpoints as you code" description="Build a complete JSON RPC interface for your service, call it from your web browser, and test out endpoints in a breeze." + image="illustrations/openapi3.png" items={[ { title: "TypeSpec for JSON RPC developer", diff --git a/packages/website/src/pages/openapi.tsx b/packages/website/src/pages/openapi.tsx index 78aa48d226..99b4f715ee 100644 --- a/packages/website/src/pages/openapi.tsx +++ b/packages/website/src/pages/openapi.tsx @@ -1,3 +1,4 @@ +import { Links } from "@site/src/constants"; import { FluentLayout } from "../components/fluent-layout"; import { Section } from "../components/homepage/section/section"; import { SectionedLayout } from "../components/sectioned-layout/sectioned-layout"; @@ -19,17 +20,17 @@ const OpenApiContent = () => { return (
{ />
@@ -64,6 +78,7 @@ const OpenApiContent = () => { header="Ecosystem" title="Test API endpoints as you code" description="Build a complete JSON RPC interface for your service, call it from your web browser, and test out endpoints in a breeze." + image="illustrations/openapi3.png" items={[ { title: "TypeSpec for JSON RPC developer", diff --git a/packages/website/static/img/fluent/design-layout-d-standard-128x128.png b/packages/website/static/img/fluent/design-layout-d-standard-128x128.png new file mode 100644 index 0000000000..9c17ee22d1 Binary files /dev/null and b/packages/website/static/img/fluent/design-layout-d-standard-128x128.png differ diff --git a/packages/website/static/img/fluent/design-layout-l-standard-128x128.png b/packages/website/static/img/fluent/design-layout-l-standard-128x128.png new file mode 100644 index 0000000000..82287113e0 Binary files /dev/null and b/packages/website/static/img/fluent/design-layout-l-standard-128x128.png differ diff --git a/packages/website/static/img/fluent/document-add-d-standard-128x128.png b/packages/website/static/img/fluent/document-add-d-standard-128x128.png new file mode 100644 index 0000000000..90b80800ce Binary files /dev/null and b/packages/website/static/img/fluent/document-add-d-standard-128x128.png differ diff --git a/packages/website/static/img/fluent/document-add-l-standard-128x128.png b/packages/website/static/img/fluent/document-add-l-standard-128x128.png new file mode 100644 index 0000000000..81f661a5bc Binary files /dev/null and b/packages/website/static/img/fluent/document-add-l-standard-128x128.png differ diff --git a/packages/website/static/img/fluent/document-cloud-d-standard-128x128.png b/packages/website/static/img/fluent/document-cloud-d-standard-128x128.png new file mode 100644 index 0000000000..02ab7d792e Binary files /dev/null and b/packages/website/static/img/fluent/document-cloud-d-standard-128x128.png differ diff --git a/packages/website/static/img/fluent/document-cloud-l-standard-128x128.png b/packages/website/static/img/fluent/document-cloud-l-standard-128x128.png new file mode 100644 index 0000000000..2cfd3d1312 Binary files /dev/null and b/packages/website/static/img/fluent/document-cloud-l-standard-128x128.png differ diff --git a/packages/website/static/img/fluent/shield-blue-d-standard-128x128.png b/packages/website/static/img/fluent/shield-blue-d-standard-128x128.png new file mode 100644 index 0000000000..8e1f048d24 Binary files /dev/null and b/packages/website/static/img/fluent/shield-blue-d-standard-128x128.png differ diff --git a/packages/website/static/img/fluent/shield-blue-l-standard-128x128.png b/packages/website/static/img/fluent/shield-blue-l-standard-128x128.png new file mode 100644 index 0000000000..66a837da59 Binary files /dev/null and b/packages/website/static/img/fluent/shield-blue-l-standard-128x128.png differ diff --git a/packages/website/static/img/illustrations/openapi3.png b/packages/website/static/img/illustrations/openapi3.png new file mode 100644 index 0000000000..fe682c56fb Binary files /dev/null and b/packages/website/static/img/illustrations/openapi3.png differ