diff --git a/src/public/gatsby-config.js b/src/public/gatsby-config.js index 4d01f3d..19c17e9 100644 --- a/src/public/gatsby-config.js +++ b/src/public/gatsby-config.js @@ -37,6 +37,13 @@ module.exports = { ], display: 'swap' } + }, + + { + resolve: `gatsby-plugin-layout`, + options: { + component: require.resolve(`./src/layouts/main.tsx`), + }, } ] } diff --git a/src/public/package.json b/src/public/package.json index 26e02c5..7d921eb 100644 --- a/src/public/package.json +++ b/src/public/package.json @@ -33,6 +33,7 @@ "gatsby-image": "^2.2.39", "gatsby-plugin-alias-imports": "^1.0.5", "gatsby-plugin-google-fonts": "^1.0.1", + "gatsby-plugin-layout": "^1.1.22", "gatsby-plugin-react-helmet": "^3.1.21", "gatsby-plugin-sharp": "^2.4.3", "gatsby-plugin-styled-components": "^3.1.18", @@ -44,19 +45,22 @@ "react-dom": "^16.12.0", "react-helmet": "^5.2.1", "react-hook-form": "^4.8.0", + "react-syntax-highlighter": "^12.2.1", + "react-transition-group": "^4.3.0", "styled-components": "^5.0.0", "yup": "^0.28.1" }, "devDependencies": { - "serverless": "^1.63.0", - "serverless-finch": "^2.5.2", - "serverless-plugin-include-dependencies": "^4.0.1", "@types/node": "^13.5.0", "@types/react": "^16.9.19", "@types/react-dom": "^16.9.5", "@types/react-helmet": "^5.0.15", + "@types/react-transition-group": "^4.2.3", "@types/styled-components": "^4.4.2", - "@types/yup": "^0.26.29" + "@types/yup": "^0.26.29", + "serverless": "^1.63.0", + "serverless-finch": "^2.5.2", + "serverless-plugin-include-dependencies": "^4.0.1" }, "browserslist": [ ">0.2%", diff --git a/src/public/src/api/APIRequest.tsx b/src/public/src/api/APIRequest.tsx index 45eeb86..fbff0a6 100644 --- a/src/public/src/api/APIRequest.tsx +++ b/src/public/src/api/APIRequest.tsx @@ -2,6 +2,7 @@ export const APIRequest = (url:string, body?:object) => { return fetch(`https://api.domsplace.com/v1/${url}`, { method: body ? 'POST' : 'GET', body: body ? JSON.stringify(body) : null, + mode: 'no-cors', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' diff --git a/src/public/src/components/Layout.tsx b/src/public/src/components/Layout.tsx deleted file mode 100644 index fbc0d01..0000000 --- a/src/public/src/components/Layout.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import * as React from 'react'; -import { Header } from '@components/navigation/Header'; -import { Background } from './layout/Background'; -import { Footer } from './navigation/Footer'; -import styled, { createGlobalStyle } from 'styled-components'; -import { Colors, Fonts, FontWeights, FontSizes, Gutters } from '@settings/all'; -import { graphql } from 'gatsby'; -import { BodyStyles, AllElementStyles } from '@styles'; -import { AnchorStyles } from '@styles/anchor'; - -const GlobalStyles = createGlobalStyle` - ${AllElementStyles} - ${BodyStyles} - ${AnchorStyles} -`; - -const LayoutMain = styled.main` - margin-top: ${Gutters.extraExtraLarge}; -`; - -export const Layout = (props:{children:React.ReactNode}) => ( -
- - -
- - { props.children } - -
-); \ No newline at end of file diff --git a/src/public/src/components/navigation/Header.tsx b/src/public/src/components/navigation/Header.tsx index a3e50ed..a2beb73 100644 --- a/src/public/src/components/navigation/Header.tsx +++ b/src/public/src/components/navigation/Header.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import styled from 'styled-components'; -import { ZIndex, Gutters } from '@settings/all'; +import { ZIndex, Gutters, MediaQueries, Colors } from '@settings/all'; import { Boundary } from '../layout/Boundary'; import { Logo } from '../../objects/branding/Logo'; @@ -8,8 +8,8 @@ const HeaderWrapper = styled.header` position: fixed; z-index: ${ZIndex.header}; width: 100%; - top: 0; pointer-events: none; + top: 0; `; const HeaderInner = styled(Boundary)` diff --git a/src/public/src/components/page/PageWrapper.tsx b/src/public/src/components/page/PageWrapper.tsx new file mode 100644 index 0000000..c786da3 --- /dev/null +++ b/src/public/src/components/page/PageWrapper.tsx @@ -0,0 +1,23 @@ +import * as React from 'react'; +import Helmet from 'react-helmet'; + +export interface PageWrapperProps { + children:React.ReactNode; + title:string|null; +} + +export const PageWrapper = ({ title, children }:PageWrapperProps) => { + if(!title) { + title = 'domsPlace | Dominic Masters\' Personal Website'; + } else { + title = `${title} | domsPlace` + } + + return <> + + + { title } + + {children} + ; +} \ No newline at end of file diff --git a/src/public/src/components/sections/SplitFrames.tsx b/src/public/src/components/sections/SplitFrames.tsx index c16829e..e0a5d36 100644 --- a/src/public/src/components/sections/SplitFrames.tsx +++ b/src/public/src/components/sections/SplitFrames.tsx @@ -83,7 +83,7 @@ export const SplitFrames = (props:SplitFramesProps) => { } return ( - + { header } diff --git a/src/public/src/layouts/main.tsx b/src/public/src/layouts/main.tsx new file mode 100644 index 0000000..48ee4b5 --- /dev/null +++ b/src/public/src/layouts/main.tsx @@ -0,0 +1,65 @@ +import * as React from 'react'; +import { Header } from '@components/navigation/Header'; +import { Background } from '../components/layout/Background'; +import { Footer } from '../components/navigation/Footer'; +import styled, { createGlobalStyle } from 'styled-components'; +import { Gutters, Easings, Durations } from '@settings/all'; +import { BodyStyles, AllElementStyles, AnchorStyles } from '@styles/index'; +import { TransitionGroup, Transition } from "react-transition-group" +import { TransitionStatus } from 'react-transition-group/Transition'; + +//Load Global Styles +const GlobalStyles = createGlobalStyle` + ${AllElementStyles} + ${BodyStyles} + ${AnchorStyles} +`; + +//Transition +const Timeouts = { enter: Durations.timeMedium * 1000, exit: Durations.timeMedium * 1000 }; +const LayoutTransition = styled.div(({ status }:{ status:TransitionStatus }) => { + return ` + transition: transform ${Timeouts.enter}ms ${Easings.easeOut}; + ${ status == 'entering' ? ` + position: absolute; + opacity: 0; + transform: translateY(-${Gutters.extraExtraLarge}); + `: status == 'entered' ? ` + opacity: 1; + transform: translateY(0em); + `: status == 'exiting' ? ` + opacity: 0; + transform: translateY(${Gutters.extraExtraLarge}); + `:''} + `; +}); + + +//Main area +const LayoutMain = styled.main` + margin-top: ${Gutters.extraExtraLarge}; +`; + +export interface LayoutProps { + children:React.ReactNode; + location:any; +}; +export const Layout = ({ location, children, ...props }:LayoutProps) => ( +
+ + +
+ + + + {status => + { children } + } + + + +
+
+); + +export default Layout; \ No newline at end of file diff --git a/src/public/src/objects/code/CodeBlock.tsx b/src/public/src/objects/code/CodeBlock.tsx new file mode 100644 index 0000000..51bfe5e --- /dev/null +++ b/src/public/src/objects/code/CodeBlock.tsx @@ -0,0 +1,12 @@ +import * as React from 'react'; +import SyntaxHighlighter, { SyntaxHighlighterProps } from 'react-syntax-highlighter'; +import test from 'react-syntax-highlighter/dist/esm/styles/hljs/tomorrow-night-eighties'; +import styled from 'styled-components'; + +export type CodeBlockProps = SyntaxHighlighterProps; + +export const CodeBlock = styled((props:CodeBlockProps) => { + return +})` + font-size: 12px; +` \ No newline at end of file diff --git a/src/public/src/pages/404.tsx b/src/public/src/pages/404.tsx new file mode 100644 index 0000000..71e3da5 --- /dev/null +++ b/src/public/src/pages/404.tsx @@ -0,0 +1,53 @@ +import * as React from 'react'; +import { PageWrapper } from '@components/page/PageWrapper'; +import { Title, Subtitle } from '@objects/typography/Title'; +import { SplitFrames } from '@components/sections/SplitFrames'; +import { CodeBlock } from '@objects/code/CodeBlock'; +import { Heading3 } from '@objects/typography/Heading'; +import { Button } from '@objects/interactive/Button'; +import { Link } from 'gatsby'; + +const FAKE_CODE = `import { usePageData } from '@data/page'; + +const thisPage = usePageData(data => { + if(!data) return + return +}); + +const MyCool404Page = () => <> + 404 - Not Found + + The error... not the internet + joke about the error. + + + + \${require(__filename).toString()} + + +; +` + +export default () => { + return + 404 - Not Found} + subtitle={() => The error... Not the joke about the error.} + left={() => + {FAKE_CODE} + } + leftOptions={{ padded: true }} + + right={() => <> + Have no fear +

+ Just because we don't have what you're looking for this time, doesn't + mean we don't offer other cool things. +

+ + } + rightOptions={{ padded: false }} + /> +
+} \ No newline at end of file diff --git a/src/public/src/pages/contact.tsx b/src/public/src/pages/contact.tsx index fa94524..2cf488b 100644 --- a/src/public/src/pages/contact.tsx +++ b/src/public/src/pages/contact.tsx @@ -1,12 +1,12 @@ import * as React from 'react'; -import { Layout } from '@components/Layout'; +import { PageWrapper } from '@components/page/PageWrapper'; import { Title } from '@objects/typography/Title'; import { SplitFrames } from '@components/sections/SplitFrames'; import { Heading2 } from '@objects/typography/Heading'; import { ContactForm } from '@components/forms/ContactForm'; export default () => ( - + Contact Me} @@ -33,5 +33,5 @@ export default () => ( rightOptions={{padded: true}} right={() => } /> - + ); \ No newline at end of file diff --git a/src/public/src/pages/index.tsx b/src/public/src/pages/index.tsx index 90fb42e..dd3fa89 100644 --- a/src/public/src/pages/index.tsx +++ b/src/public/src/pages/index.tsx @@ -1,12 +1,12 @@ import * as React from 'react'; -import { Layout } from '@components/Layout'; +import { PageWrapper } from '@components/page/PageWrapper'; import { BannerImageSection } from '@components/sections/BannerImage'; import { Title, Subtitle } from '@objects/typography/Title'; import { SplitFrames } from '@components/sections/SplitFrames'; import { Heading1, Heading2 } from '@objects/typography/Heading'; import { Mosaic } from '@components/sections/Mosaic'; -import { graphql, Link } from 'gatsby'; -import { FluidImage, fluidImage } from '@objects/media/Image'; +import { graphql } from 'gatsby'; +import { FluidImage } from '@objects/media/Image'; import { StackedMosaic } from '@components/sections/StackedMosaic'; import { IconGrid } from '@components/sections/IconGrid'; import { ButtonTitle } from '@components/sections/ButtonTitle'; @@ -36,9 +36,9 @@ export interface IndexPageProps { } export default ({ data }:IndexPageProps) => { - return + return Dominic Masters} + title={() => Dominic Masters} subtitle={() => Developer, nerd, occasionally funny.} body={() =>

I'm just a nerd with a passion for coding, coffee, and video games. @@ -103,7 +103,7 @@ export default ({ data }:IndexPageProps) => { images={[ { to: "//www.kopalife.com/products/kube-customise", image: data.kopaImage.childImageSharp, delay: 'short' }, { to: "//earjobs.com.au", image: data.earjobsImage.childImageSharp, delay: 'medium' }, - { to: "//sol-invictus.com", image: data.solImage.childImageSharp, delay: 'long' } + { to: "//www.solinvictus.com.au", image: data.solImage.childImageSharp, delay: 'long' } ]} title={() => Full-Stack Web Dev} body={() => <> @@ -121,6 +121,7 @@ export default ({ data }:IndexPageProps) => { } /> Platforms I work with} icons={[ /* First Row */ @@ -170,5 +171,5 @@ export default ({ data }:IndexPageProps) => {

} buttons={() => } /> -
+ } \ No newline at end of file diff --git a/src/public/src/pages/legal/privacy.tsx b/src/public/src/pages/legal/privacy.tsx index ee19559..7952863 100644 --- a/src/public/src/pages/legal/privacy.tsx +++ b/src/public/src/pages/legal/privacy.tsx @@ -1,11 +1,11 @@ import * as React from 'react'; -import { Layout } from '@components/Layout'; +import { PageWrapper } from '@components/page/PageWrapper'; import { Boundary } from '@components/layout/Boundary'; import { Title } from '@objects/typography/Title'; import { Heading4, Heading3, Heading2 } from '@objects/typography/Heading'; export default () => ( - + Privacy Policy

Effective date: June 27, 2018

@@ -160,5 +160,5 @@ export default () => ( website: https://domsplace.com/contact

-
-) \ No newline at end of file + +); \ No newline at end of file diff --git a/src/public/src/styles/index.tsx b/src/public/src/styles/index.tsx index 05b7518..71cb973 100644 --- a/src/public/src/styles/index.tsx +++ b/src/public/src/styles/index.tsx @@ -1,2 +1,3 @@ export * from './all'; -export * from './body'; \ No newline at end of file +export * from './body'; +export * from './anchor'; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..4cded13 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,28 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/prop-types@*": + version "15.7.3" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" + integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + +"@types/react-syntax-highlighter@^11.0.4": + version "11.0.4" + resolved "https://registry.yarnpkg.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-11.0.4.tgz#d86d17697db62f98046874f62fdb3e53a0bbc4cd" + integrity sha512-9GfTo3a0PHwQeTVoqs0g5bS28KkSY48pp5659wA+Dp4MqceDEa8EHBqrllJvvtyusszyJhViUEap0FDvlk/9Zg== + dependencies: + "@types/react" "*" + +"@types/react@*": + version "16.9.19" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.19.tgz#c842aa83ea490007d29938146ff2e4d9e4360c40" + integrity sha512-LJV97//H+zqKWMms0kvxaKYJDG05U2TtQB3chRLF8MPNs+MQh/H1aGlyDUxjaHvu08EAGerdX2z4LTBc7ns77A== + dependencies: + "@types/prop-types" "*" + csstype "^2.2.0" + +csstype@^2.2.0: + version "2.6.8" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.8.tgz#0fb6fc2417ffd2816a418c9336da74d7f07db431" + integrity sha512-msVS9qTuMT5zwAGCVm4mxfrZ18BNc6Csd0oJAtiFMZ1FAx1CCvy2+5MDmYoix63LM/6NDbNtodCiGYGmFgO0dA==