Skip to content

Commit

Permalink
Implement landing and doc page for "Nord highlight.js"
Browse files Browse the repository at this point in the history
This includes the initial sections for features and basic documentation
pages.

GH-188
  • Loading branch information
arcticicestudio committed Dec 20, 2019
1 parent d4a1ae6 commit afe3be3
Show file tree
Hide file tree
Showing 18 changed files with 625 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com>
* Copyright (C) 2018-present Sven Greb <development@svengreb.de>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

import React from "react";

import { WaveFooter } from "atoms/core/vectors/divider";
import Section, { Content } from "containers/core/Section";
import { BookOpen, Zap } from "atoms/core/vectors/icons";
import { ROUTE_DOCS_PORTS_HIGHLIGHTJS } from "config/routes/mappings";
import { topicsGettingStarted, topicsReferences } from "data/components/organisms/page/docs/ports/highlightjs/topics";
import { sectionIdFor } from "utils";
import { colors } from "styles/theme";

import { ContentsCard, CardGrid } from "../../../shared";

const SECTION_ID = sectionIdFor(ROUTE_DOCS_PORTS_HIGHLIGHTJS, 1);

/**
* The component that represents the contents section of the docs page for the "Nord highlight.js" port project.
*
* @author Arctic Ice Studio <development@arcticicestudio.com>
* @author Sven Greb <development@svengreb.de>
* @since 0.23.0
*/
const SectionContents = () => (
<Section id={SECTION_ID} variant="tertiary">
<Content centered>
<CardGrid>
<ContentsCard
accentColor={colors.nord8}
logoComponent={Zap}
svgType="stroke"
title="Getting Started"
topics={topicsGettingStarted}
>
Learn how to install and use the theme.
</ContentsCard>
<ContentsCard accentColor={colors.nord10} logoComponent={BookOpen} title="References" topics={topicsReferences}>
Learn about supported languages and how to deal with occurring problems.
</ContentsCard>
</CardGrid>
</Content>
<WaveFooter />
</Section>
);

export default SectionContents;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com>
* Copyright (C) 2018-present Sven Greb <development@svengreb.de>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

export { default } from "./SectionContents";
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com>
* Copyright (C) 2018-present Sven Greb <development@svengreb.de>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

import React from "react";

import Section, { Content } from "containers/core/Section";
import { ROUTE_DOCS_PORTS_HIGHLIGHTJS } from "config/routes/mappings";
import { sectionIdFor } from "utils";

import { Headline, Subline } from "../../../shared";

const SECTION_ID = sectionIdFor(ROUTE_DOCS_PORTS_HIGHLIGHTJS, 0);

/**
* The component that represents the hero section of the docs page for the "Nord highlight.js" port project.
*
* @author Arctic Ice Studio <development@arcticicestudio.com>
* @author Sven Greb <development@svengreb.de>
* @since 0.23.0
*/
const SectionHero = () => (
<Section id={SECTION_ID} variant="tertiary">
<Content centered>
<Headline>Nord highlight.js</Headline>
<Subline>
Documentations to get to know the theme, supported features, how to use it and find solution for possible
problems.
</Subline>
</Content>
</Section>
);

export default SectionHero;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com>
* Copyright (C) 2018-present Sven Greb <development@svengreb.de>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

export { default } from "./SectionHero";
13 changes: 13 additions & 0 deletions src/components/organisms/page/docs/ports/highlightjs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com>
* Copyright (C) 2018-present Sven Greb <development@svengreb.de>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

import SectionContents from "./SectionContents";
import SectionHero from "./SectionHero";

export { SectionContents, SectionHero };
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,25 @@
*/

import React from "react";
import { css } from "styled-components";

import { WaveFooter } from "atoms/core/vectors/divider";
import { P } from "atoms/core/html-elements";
import Button from "atoms/core/Button";
import Link from "atoms/core/Link";
import Section, { Content } from "containers/core/Section";
import EmptyState from "molecules/core/EmptyState";
import { Image } from "atoms/core/mdx-elements";
import { Content } from "containers/core/Section";
import FeatureDuo, { Actions, Headline, Subline, Text, Visualization } from "molecules/page/shared/FeatureDuo";
import {
ROUTE_DOCS_PORTS_HIGHLIGHTJS,
ROUTE_DOCS_PORTS_HIGHLIGHTJS_INSTALLATION,
ROUTE_PORTS_HIGHLIGHTJS
} from "config/routes/mappings";
import { usePortsMetadata } from "hooks";
import { usePortsAssetsPropTypes } from "hooks/shared/propTypes";
import { sectionIdFor } from "utils";

import { emptyStateIllustrationStyles } from "../../../shared/styles";
import { Section } from "../../../shared";
import WaveDivider from "./styled/WaveDivider";

const SECTION_ID = sectionIdFor(ROUTE_PORTS_HIGHLIGHTJS, 0);

/**
* The component that represents the hero section for the landing page of the "Nord highlight.js" port project.
Expand All @@ -26,32 +35,42 @@ import { emptyStateIllustrationStyles } from "../../../shared/styles";
* @author Sven Greb <development@svengreb.de>
* @since 0.9.0
*/
export default function SectionHero() {
const SectionHero = ({ assets }) => {
const portMetadata = usePortsMetadata();
const { gitHubRepositoryUrl } = portMetadata.find(port => port.name === "nord-highlightjs");
const { gitHubRepositoryUrl, projectUrl } = portMetadata.find(port => port.name === "nord-highlightjs");

return (
<Section>
<Content centered>
<EmptyState
headline="Oh, there's nothing here yet"
illustrationStyles={emptyStateIllustrationStyles}
illustrationVariant="iglooHemisphere"
subline="Please check back later, we're working hard on this page!"
/>
<P
css={css`
text-align: center;
`}
>
In the meantime, please see the official{" "}
<Link href={gitHubRepositoryUrl} target="_blank" variant="minimal">
repository on GitHub
</Link>{" "}
for information about Nord highlight.js.
</P>
<Section id={SECTION_ID}>
<Content centered decorated>
<FeatureDuo verticalOnly>
<Text verticalOnly>
<Headline large>Nord highlight.js</Headline>
<Subline>
An arctic, north-bluish clean and elegant <Link href={projectUrl}>highlight.js</Link> theme.
</Subline>
<Subline>Designed for a fluent and clear workflow with support for many languages.</Subline>
<Actions>
<Button to={ROUTE_DOCS_PORTS_HIGHLIGHTJS_INSTALLATION} variant="primary">
Get Started
</Button>
<Button ghost outlined quiet to={ROUTE_DOCS_PORTS_HIGHLIGHTJS} variant="primary">
Documentation
</Button>
<Button ghost href={gitHubRepositoryUrl} outlined quiet variant="primary">
GitHub
</Button>
</Actions>
</Text>
<Visualization>
<Image alt="Screenshot showing a Go function" dropShadow fluid={assets.images["overview.png"]} rounded />
</Visualization>
</FeatureDuo>
</Content>
<WaveFooter />
<WaveDivider />
</Section>
);
}
};

SectionHero.propTypes = usePortsAssetsPropTypes;

export default SectionHero;
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com>
* Copyright (C) 2018-present Sven Greb <development@svengreb.de>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

import styled from "styled-components";

import { WaveSmooth2 } from "atoms/core/vectors/divider";
import { colors, motion, themedMode, MODE_BRIGHT_SNOW_FLURRY, MODE_DARK_NIGHT_FROST } from "styles/theme";

const fillColor = themedMode({
[MODE_BRIGHT_SNOW_FLURRY]: colors.background.sectioning.secondary[MODE_BRIGHT_SNOW_FLURRY],
[MODE_DARK_NIGHT_FROST]: colors.background.sectioning.secondary[MODE_DARK_NIGHT_FROST]
});

/**
* A "smooth" vector wave to render a visual differentiation to the next section.
*
* @author Arctic Ice Studio <development@arcticicestudio.com>
* @author Sven Greb <development@svengreb.de>
* @since 0.23.0
*/
const WaveDivider = styled(WaveSmooth2)`
fill: ${fillColor};
transition: fill ${motion.speed.duration.transition.base.themeModeSwitch}ms ease-in-out;
`;

export default WaveDivider;
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com>
* Copyright (C) 2018-present Sven Greb <development@svengreb.de>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

import React from "react";

import Button from "atoms/core/Button";
import { WaveFooter } from "atoms/core/vectors/divider";
import { Content } from "containers/core/Section";
import FeatureDuo, { Actions, Headline, Subline, Text, Visualization } from "molecules/page/shared/FeatureDuo";
import { ROUTE_DOCS_PORTS_HIGHLIGHTJS, ROUTE_PORTS_HIGHLIGHTJS } from "config/routes/mappings";
import { sectionIdFor } from "utils";
import { Code } from "atoms/core/html-elements";
import { usePortsMetadata } from "hooks";
import { usePortsAssetsPropTypes } from "hooks/shared/propTypes";

import { Section } from "../../../shared";

const SECTION_ID = sectionIdFor(ROUTE_PORTS_HIGHLIGHTJS, 2);

/**
* The component that represents the setup section for the landing page of the "Nord highlight.js" port project.
*
* @author Arctic Ice Studio <development@arcticicestudio.com>
* @author Sven Greb <development@svengreb.de>
* @since 0.23.0
*/
const SectionSetup = () => {
const portMetadata = usePortsMetadata();
const { gitHubRepositoryUrl } = portMetadata.find(port => port.name === "nord-highlightjs");

return (
<Section id={SECTION_ID}>
<Content centered decorated>
<FeatureDuo verticalOnly>
<Text verticalOnly>
<Headline>Installation in one line of code.</Headline>
<Subline>Use Nord in one line of code added to your site.</Subline>
<Subline>
<Code>
&#x3C;link href=&#x22;nord.css&#x22; rel=&#x22;stylesheet&#x22; type=&#x22;text/css&#x22; /&#x3E;
</Code>
</Subline>
<Actions>
<Button to={ROUTE_DOCS_PORTS_HIGHLIGHTJS} variant="primary">
Get Started
</Button>
<Button ghost href={gitHubRepositoryUrl} outlined quiet variant="primary">
GitHub
</Button>
</Actions>
</Text>
<Visualization />
</FeatureDuo>
</Content>
<WaveFooter />
</Section>
);
};

SectionSetup.propTypes = usePortsAssetsPropTypes;

export default SectionSetup;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com>
* Copyright (C) 2018-present Sven Greb <development@svengreb.de>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

export { default } from "./SectionSetup";
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com>
* Copyright (C) 2018-present Sven Greb <development@svengreb.de>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

import styled from "styled-components";

import { WaveSmooth2 } from "atoms/core/vectors/divider";
import { colors, motion, themedMode, MODE_BRIGHT_SNOW_FLURRY, MODE_DARK_NIGHT_FROST } from "styles/theme";

const fillColor = themedMode({
[MODE_BRIGHT_SNOW_FLURRY]: colors.background.sectioning.secondary[MODE_BRIGHT_SNOW_FLURRY],
[MODE_DARK_NIGHT_FROST]: colors.background.sectioning.secondary[MODE_DARK_NIGHT_FROST]
});

/**
* A "smooth" vector wave to render a visual differentiation to the next section.
*
* @author Arctic Ice Studio <development@arcticicestudio.com>
* @author Sven Greb <development@svengreb.de>
* @since 0.23.0
*/
const WaveDivider = styled(WaveSmooth2)`
fill: ${fillColor};
transition: fill ${motion.speed.duration.transition.base.themeModeSwitch}ms ease-in-out;
`;

export default WaveDivider;
Loading

0 comments on commit afe3be3

Please sign in to comment.