-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
153 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import { FourOhFour } from 'gatsby-theme-carbon'; | ||
|
||
const links = [ | ||
{ href: '/components/markdown', text: 'Markdown' }, | ||
{ href: '/components/aside', text: 'Aside' }, | ||
{ href: '/components/demo', text: 'Demo' }, | ||
]; | ||
|
||
const Custom404 = () => <FourOhFour links={links} />; | ||
|
||
export default Custom404; |
This file contains 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import { FourOhFour } from 'gatsby-theme-carbon'; | ||
|
||
const links = [ | ||
{ href: '/components/markdown', text: 'Markdown' }, | ||
{ href: '/components/aside', text: 'Aside' }, | ||
{ href: '/components/demo', text: 'Demo' }, | ||
]; | ||
|
||
const Custom404 = () => <FourOhFour links={links} />; | ||
|
||
export default Custom404; |
This file contains 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
45 changes: 45 additions & 0 deletions
45
packages/gatsby-theme-carbon/src/components/FourOhFour/FourOhFour.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from 'react'; | ||
import { Link } from 'gatsby'; | ||
import Layout from '../Layout'; | ||
import styles, { | ||
container, | ||
fourOhFour, | ||
paragraph, | ||
heading, | ||
link, | ||
list, | ||
} from './FourOhFour.module.scss'; | ||
|
||
console.log(styles); | ||
const whoops = ({ links }) => { | ||
const getLinks = () => ( | ||
<> | ||
<br /> | ||
Maybe some of these most visited links will help you? | ||
<ul className={list}> | ||
{links.map(({ href, text }, i) => ( | ||
<li key={i}> | ||
<Link className={link} to={href}> | ||
{text} | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
</> | ||
); | ||
|
||
return ( | ||
<Layout homepage> | ||
<div className={container}> | ||
<span className={fourOhFour}>404</span> | ||
<h2 className={heading}>Something's gone wrong...</h2> | ||
<p className={paragraph}> | ||
Sorry, we can't find the page you are looking for. | ||
{links && getLinks()} | ||
</p> | ||
</div> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default whoops; |
68 changes: 68 additions & 0 deletions
68
packages/gatsby-theme-carbon/src/components/FourOhFour/FourOhFour.module.scss
This file contains 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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
@import '~carbon-components/scss/globals/scss/vars'; | ||
@import '~@carbon/elements/scss/type/type'; | ||
|
||
.four-oh-four { | ||
@include carbon--type-style('display-02'); | ||
font-size: 20vw; | ||
background: linear-gradient(35deg, #92eeee, #a66efa); | ||
display: inline-block; | ||
background-size: 200% 200%; | ||
-webkit-text-fill-color: transparent; | ||
-webkit-background-clip: text; | ||
margin-bottom: 6rem; | ||
@include carbon--breakpoint('lg') { | ||
font-size: 300px; | ||
} | ||
animation: gradient 2s ease infinite; | ||
} | ||
|
||
.paragraph { | ||
@include carbon--type-style('body-long-01'); | ||
font-size: 1.25rem; | ||
line-height: 1.5; | ||
} | ||
|
||
.heading { | ||
@include carbon--type-style('expressive-heading-04', true); | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.list { | ||
margin-top: 2rem; | ||
} | ||
|
||
.link { | ||
@include carbon--type-style('body-short-01'); | ||
display: inline-block; | ||
font-size: 1.25rem; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.container { | ||
margin: 0; | ||
margin-top: 4rem; | ||
max-width: 100%; | ||
min-height: calc(100vh - 500px); | ||
|
||
@include carbon--breakpoint('lg') { | ||
padding-left: calc( | ||
25% + 2rem | ||
); //2rem to account for 2rem left padding default on grid | ||
} | ||
|
||
@include carbon--breakpoint('max') { | ||
padding-left: 400px; | ||
} | ||
} | ||
|
||
@keyframes gradient { | ||
0% { | ||
background-position: 0% 50%; | ||
} | ||
50% { | ||
background-position: 100% 50%; | ||
} | ||
100% { | ||
background-position: 0% 50%; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/gatsby-theme-carbon/src/components/FourOhFour/index.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import FourOhFour from './FourOhFour'; | ||
|
||
export default FourOhFour; |
This file contains 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@keyframes gradient { | ||
0% { | ||
background-position: 0% 50%; | ||
} | ||
50% { | ||
background-position: 100% 50%; | ||
} | ||
100% { | ||
background-position: 0% 50%; | ||
} | ||
} |
This file contains 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