This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
Feat/home page #325
Merged
Merged
Feat/home page #325
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cddcad2
feat: Added home page
ogonzal87 6119cb3
feat: More tweaks to the home page
ogonzal87 e87d357
fix: Fixing the errors after running the format command
ogonzal87 220495f
fix: Refined the illustration and the header
ogonzal87 773a66e
fix: Fixed formating errors
ogonzal87 88aea2b
feat: Modifying illustrations
ogonzal87 6449c92
Merge branch 'staging' into feat/home-page
amiller-gh 2b0255b
fix: Fixed illustration and logo assets with the right formats
ogonzal87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)', | ||
| 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')} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ouch.... dirty trick
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
|
|
@@ -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)' }} | ||
| > | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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:Or something.