Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<br>
<a href="https://nodejs.dev">
<img src="./src/images/nodejslogo.png" width="200"/>
<img src="./src/images/nodejs-logo-light-mode.svg" width="200"/>
</a>
</p>

Expand Down
74 changes: 42 additions & 32 deletions src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,57 @@
import { Link } from 'gatsby';
import React from 'react';
import { css, SerializedStyles } from '@emotion/core';
import logoLight from '../images/logos/nodejs-logo-light-mode.svg';
import logoDark from '../images/logos/nodejs-logo-dark-mode.svg';

/* eslint-disable-next-line @typescript-eslint/no-var-requires */
const logo = require('../images/logo.svg');
const activeStyleTab = {
fontWeight: 'var(--font-weight-semibold)',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting this for myself later – it'd be nice to have a typescript tokens file we can import so we get a nice in-IDE typeahead instead of putting strings everywhere! So fontWeight: var(--font-weight-semibold) could become:

import tokens from 'nodejs/design-tokens';
const activeStyleTab = { fontWeight: tokens.fontWeightSemibold };

Or something.

color: 'var(--color-text-accent)',
borderBottom: 'var(--space-04) inset var(--color-text-accent)',
};

const ulStyles: SerializedStyles = css`
@media (max-width: 380px) {
padding: 0;
}
margin: 0 auto;
padding: 0 4.8rem;
display: flex;
align-items: center;
list-style: none;
`;

const Header = (): JSX.Element => (
const Header = () => (
<nav className="nav">
<ul css={ulStyles}>
<li>
<Link to="/" style={{ display: 'block' }}>
<img src={logo} alt="Node.js" className="nav__logo" />
</Link>
</li>
<li className="nav__tabs">
<Link to="/learn">Learn</Link>
</li>
<div className="logo">
<Link to="/">
<img
src={logoLight}
alt="Node.js"
className="nav__logo light-mode-only"
/>
<img
src={logoDark}
alt="Node.js"
className="nav__logo dark-mode-only"
/>
</Link>
</div>

<ul className="nav__tabs__container">
<li className="nav__tabs">
<Link to="/docs">Docs</Link>
<Link to="/learn" activeStyle={activeStyleTab} partiallyActive>
Learn
</Link>
</li>
<li className="nav__tabs">
<Link to="/community">Community</Link>
<Link to="/docs" activeStyle={activeStyleTab} partiallyActive>
Documentation
</Link>
</li>
<li className="nav__tabs">
<Link to="/download">Download</Link>
<Link to="/download" activeStyle={activeStyleTab} partiallyActive>
Download
</Link>
</li>
<li style={{ flexGrow: 1 }} />
</ul>

<div style={{ flexGrow: 1 }}></div>

<ul className="right-container">
<li className="nav__tabs nav__tabs--right">
<button
type="button"
className="dark-mode-toggle"
onClick={(): boolean => document.body.classList.toggle('dark-mode')}
onClick={() => document.body.classList.toggle('dark-mode')}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch.... dirty trick

Copy link
Contributor Author

@ogonzal87 ogonzal87 Sep 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @alexandrtovmach ! Totally agree with you. My coding skills only take me so far 😬(I'm a designer) But as Adam said, I think we can totally iterate and computerize the elements. 👍

>
<span className="sr-only">Toggle Dark Mode</span>
<i className="material-icons light-mode-only">nights_stay</i>
Expand All @@ -52,13 +62,13 @@ const Header = (): JSX.Element => (
<li className="nav__tabs">
<a
target="_blank"
rel="noreferrer noopener"
href="https://github.com/nodejs/nodejs.dev"
rel="noopener noreferrer"
>
<span className="sr-only">GitHub</span>
<svg
width="2.0rem"
height="2.0rem"
width="2.4rem"
height="2.4rem"
viewBox="0 0 438.549 438.549"
style={{ fill: 'var(--color-text-accent)' }}
>
Expand Down
28 changes: 21 additions & 7 deletions src/components/hero.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
import React from 'react';
import { Link } from 'gatsby';

interface Props {
title: string;
subTitle: string;
}

const Hero = ({ title }: Props): JSX.Element => (
<div className="hero">
const NodeVersion = 'Version 10.15.3';

const Hero = ({ title, subTitle }: Props) => (
<div className="home-page-hero">
<h1>{title}</h1>
<div className="diagonal-hero-bg">
<div className="stars">
<div className="small" />
<div className="medium" />
<div className="big" />
<h2 className="sub-title t-subheading">{subTitle}</h2>
<div className="btn-ctas">
<div className="download-lts-container">
<button className="download-lts-cta t-body1" type="button">
Download Node (LTS)
</button>
<p className="links t-caption">
{NodeVersion} - <Link to="/download">What’s new</Link> /{' '}
<Link to="/download">Get Current</Link>
</p>
</div>
<Link to="/learn">
<button className="learn-cta t-body1" type="button">
Learn Node
</button>
</Link>
</div>
</div>
);
Expand Down
11 changes: 9 additions & 2 deletions src/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@ interface Props {
title?: string;
description?: string;
img?: string;
href: string;
}

const Layout = ({ children, title, description, img }: Props): JSX.Element => {
const Layout = ({
children,
title,
description,
img,
location,
}: Props): JSX.Element => {
return (
<React.Fragment>
<SEO title={title} description={description} img={img} />
<Header />
<main>{children}</main>
{children}
</React.Fragment>
);
};
Expand Down
5 changes: 5 additions & 0 deletions src/images/illustrations/beginners-guide-illustration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/images/illustrations/do-more-illustration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions src/images/illustrations/dots.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/images/illustrations/leafs-back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/images/illustrations/leafs-front.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/images/illustrations/leafs-illustration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading