@t2ca/gatsby-theme-showcase 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +40 -0
- package/.prettierrc +7 -0
- package/gatsby-config.js +29 -0
- package/gatsby-node.js +91 -0
- package/index.js +3 -0
- package/package.json +63 -0
- package/src/assets/moon.png +0 -0
- package/src/assets/sun.png +0 -0
- package/src/components/button.js +25 -0
- package/src/components/footer.js +11 -0
- package/src/components/header.js +90 -0
- package/src/components/layout.js +132 -0
- package/src/components/map-styles.js +136 -0
- package/src/components/menu-button.js +44 -0
- package/src/components/nav-link.js +37 -0
- package/src/components/project-list.js +21 -0
- package/src/components/project.js +25 -0
- package/src/components/sidebar.js +41 -0
- package/src/components/switch.js +19 -0
- package/src/components/tiles.js +32 -0
- package/src/gatsby-plugin-theme-ui/index.js +46 -0
- package/src/gatsby-plugin-theme-ui/styles.js +30 -0
- package/src/templates/project.js +32 -0
- package/src/templates/projects.js +39 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"eslint:recommended",
|
|
4
|
+
"plugin:import/errors",
|
|
5
|
+
"plugin:react/recommended",
|
|
6
|
+
"plugin:jsx-a11y/recommended",
|
|
7
|
+
"prettier",
|
|
8
|
+
"prettier/react"
|
|
9
|
+
],
|
|
10
|
+
"plugins": ["react", "react-hooks", "import", "jsx-a11y", "emotion"],
|
|
11
|
+
"parser": "babel-eslint",
|
|
12
|
+
"parserOptions": {
|
|
13
|
+
"ecmaVersion": 2018,
|
|
14
|
+
"sourceType": "module",
|
|
15
|
+
"ecmaFeatures": {
|
|
16
|
+
"jsx": true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"env": {
|
|
20
|
+
"es6": true,
|
|
21
|
+
"browser": true,
|
|
22
|
+
"node": true
|
|
23
|
+
},
|
|
24
|
+
"settings": {
|
|
25
|
+
"react": {
|
|
26
|
+
"version": "detect"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"rules": {
|
|
30
|
+
"react-hooks/rules-of-hooks": "error",
|
|
31
|
+
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
|
|
32
|
+
"jsx-a11y/anchor-is-valid": ["error", { "components": ["Link"], "specialLink": ["to"] }],
|
|
33
|
+
"no-console": "off",
|
|
34
|
+
"react/prop-types": [0],
|
|
35
|
+
"react/display-name": [0]
|
|
36
|
+
},
|
|
37
|
+
"globals": {
|
|
38
|
+
"graphql": true
|
|
39
|
+
}
|
|
40
|
+
}
|
package/.prettierrc
ADDED
package/gatsby-config.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configure your Gatsby site with this file.
|
|
3
|
+
*
|
|
4
|
+
* See: https://www.gatsbyjs.org/docs/gatsby-config/
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
module.exports = ({ contentPath = "data", basePath = "/" }) => ({
|
|
8
|
+
plugins: [
|
|
9
|
+
{
|
|
10
|
+
resolve: `gatsby-source-filesystem`,
|
|
11
|
+
options: {
|
|
12
|
+
path: contentPath,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
resolve: `gatsby-transformer-yaml`,
|
|
17
|
+
options: {
|
|
18
|
+
// typeName: "",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
resolve: `gatsby-transformer-json`,
|
|
23
|
+
options: {
|
|
24
|
+
typeName: "Project",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
`gatsby-plugin-theme-ui`,
|
|
28
|
+
],
|
|
29
|
+
})
|
package/gatsby-node.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const fs = require("fs")
|
|
2
|
+
|
|
3
|
+
// 1. make sure data directory exists
|
|
4
|
+
exports.onPreBootstrap = ({ reporter }, options) => {
|
|
5
|
+
const contentPath = options.contentPath || "data"
|
|
6
|
+
|
|
7
|
+
if (!fs.existsSync(contentPath)) {
|
|
8
|
+
reporter.info(`creating the ${contentPath} directory`)
|
|
9
|
+
fs.mkdirSync(contentPath)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 2. define the project type
|
|
14
|
+
exports.sourceNodes = ({ actions }) => {
|
|
15
|
+
const { createTypes } = actions
|
|
16
|
+
|
|
17
|
+
const typeDefs = `
|
|
18
|
+
type Project implements Node @dontInfer {
|
|
19
|
+
id: ID!
|
|
20
|
+
title: String!
|
|
21
|
+
notes: String
|
|
22
|
+
address: String
|
|
23
|
+
date: Date @dateformat @proxy(from: "next_date")
|
|
24
|
+
dateTime: Date! @dateformat @proxy(from: "next_date_times")
|
|
25
|
+
slug: String!
|
|
26
|
+
}
|
|
27
|
+
`
|
|
28
|
+
createTypes(typeDefs)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 3. define resolvers for any custom fields (slug)
|
|
32
|
+
exports.createResolvers = ({ createResolvers }, options) => {
|
|
33
|
+
const basePath = options.basePath || "/"
|
|
34
|
+
|
|
35
|
+
const slugify = str => {
|
|
36
|
+
const slug = str
|
|
37
|
+
.toLowerCase()
|
|
38
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
39
|
+
.replace(/(^-|-$)+/g, "")
|
|
40
|
+
|
|
41
|
+
return `/${basePath}/${slug}/`.replace(/\/\/+/g, "/")
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
createResolvers({
|
|
45
|
+
Project: {
|
|
46
|
+
slug: {
|
|
47
|
+
resolve: source => slugify(source.title),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 4. query for projects and create pages
|
|
54
|
+
exports.createPages = async ({ actions, graphql, reporter }, options) => {
|
|
55
|
+
const basePath = options.basePath || "/"
|
|
56
|
+
actions.createPage({
|
|
57
|
+
path: basePath,
|
|
58
|
+
component: require.resolve("./src/templates/projects.js"),
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
const result = await graphql(`
|
|
62
|
+
query {
|
|
63
|
+
allProject(sort: { fields: date, order: ASC }) {
|
|
64
|
+
nodes {
|
|
65
|
+
id
|
|
66
|
+
slug
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
`)
|
|
71
|
+
|
|
72
|
+
if (result.errors) {
|
|
73
|
+
reporter.panic("error loading projects", reporter.errors)
|
|
74
|
+
return
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const projects = result.data.allProject.nodes
|
|
78
|
+
|
|
79
|
+
projects.forEach(project => {
|
|
80
|
+
const slug = project.slug
|
|
81
|
+
|
|
82
|
+
actions.createPage({
|
|
83
|
+
path: slug,
|
|
84
|
+
component: require.resolve("./src/templates/project.js"),
|
|
85
|
+
context: {
|
|
86
|
+
slug: project.slug,
|
|
87
|
+
projectID: project.id,
|
|
88
|
+
},
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
}
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@t2ca/gatsby-theme-showcase",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@hot-loader/react-dom": "^16.8.6",
|
|
8
|
+
"babel-eslint": "^10.0.2",
|
|
9
|
+
"eslint": "^6.0.1",
|
|
10
|
+
"eslint-config-prettier": "^6.0.0",
|
|
11
|
+
"eslint-plugin-emotion": "^10.0.14",
|
|
12
|
+
"eslint-plugin-graphql": "^3.0.3",
|
|
13
|
+
"eslint-plugin-import": "^2.18.0",
|
|
14
|
+
"eslint-plugin-jsx-a11y": "^6.2.3",
|
|
15
|
+
"eslint-plugin-prettier": "^3.1.0",
|
|
16
|
+
"eslint-plugin-react": "^7.14.2",
|
|
17
|
+
"eslint-plugin-react-hooks": "^1.6.1",
|
|
18
|
+
"gatsby": "^2.13.3",
|
|
19
|
+
"prettier": "^1.18.2",
|
|
20
|
+
"react": "^16.8.6",
|
|
21
|
+
"react-dom": "^16.8.6"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"gatsby": "^2.13.3",
|
|
25
|
+
"react": "^16.8.6",
|
|
26
|
+
"react-dom": "^16.8.6"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@emotion/core": "^10.0.14",
|
|
30
|
+
"@mdx-js/react": "^1.0.21",
|
|
31
|
+
"@theme-ui/presets": "^0.2.5",
|
|
32
|
+
"@theme-ui/typography": "^0.2.5",
|
|
33
|
+
"deepmerge": "^4.0.0",
|
|
34
|
+
"gatsby-plugin-theme-ui": "^0.2.5",
|
|
35
|
+
"gatsby-source-filesystem": "^2.1.4",
|
|
36
|
+
"gatsby-transformer-json": "^2.2.2",
|
|
37
|
+
"gatsby-transformer-yaml": "^2.2.1",
|
|
38
|
+
"react-google-maps": "^9.4.5",
|
|
39
|
+
"react-headroom": "^2.2.8",
|
|
40
|
+
"react-icons": "^3.7.0",
|
|
41
|
+
"react-switch": "^5.0.0",
|
|
42
|
+
"theme-ui": "^0.2.5"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "gatsby build",
|
|
46
|
+
"develop": "gatsby develop",
|
|
47
|
+
"clean": "gatsby clean",
|
|
48
|
+
"format": "prettier --write src/**/*.{js,jsx}",
|
|
49
|
+
"start": "npm run develop",
|
|
50
|
+
"serve": "gatsby serve",
|
|
51
|
+
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\""
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/t2ca/gatsby-theme-showcase.git"
|
|
56
|
+
},
|
|
57
|
+
"author": "",
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/t2ca/gatsby-theme-showcase/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://github.com/t2ca/gatsby-theme-showcase#readme",
|
|
62
|
+
"description": ""
|
|
63
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from 'theme-ui';
|
|
4
|
+
|
|
5
|
+
export default props => (
|
|
6
|
+
<button
|
|
7
|
+
{...props}
|
|
8
|
+
sx={{
|
|
9
|
+
appearance: 'none',
|
|
10
|
+
fontFamily: 'inherit',
|
|
11
|
+
fontSize: 1,
|
|
12
|
+
fontWeight: 'bold',
|
|
13
|
+
m: 0,
|
|
14
|
+
px: 2,
|
|
15
|
+
py: 2,
|
|
16
|
+
color: 'text',
|
|
17
|
+
bg: 'muted',
|
|
18
|
+
border: 0,
|
|
19
|
+
borderRadius: 2,
|
|
20
|
+
':focus': {
|
|
21
|
+
outline: '2px solid'
|
|
22
|
+
}
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from "react"
|
|
3
|
+
import { Link } from "gatsby"
|
|
4
|
+
import { jsx, Header, Container, useColorMode } from "theme-ui"
|
|
5
|
+
import NavLink from "./nav-link"
|
|
6
|
+
import Switch from "./switch"
|
|
7
|
+
import sun from "../assets/sun.png"
|
|
8
|
+
import moon from "../assets/moon.png"
|
|
9
|
+
|
|
10
|
+
export default props => {
|
|
11
|
+
const [colorMode, setColorMode] = useColorMode()
|
|
12
|
+
const isDark = colorMode === `dark`
|
|
13
|
+
const toggleColorMode = e => {
|
|
14
|
+
setColorMode(isDark ? `light` : `dark`)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const checkedIcon = (
|
|
18
|
+
<img
|
|
19
|
+
alt="moon indicating dark mode"
|
|
20
|
+
src={moon}
|
|
21
|
+
width="16"
|
|
22
|
+
height="16"
|
|
23
|
+
role="presentation"
|
|
24
|
+
css={{
|
|
25
|
+
pointerEvents: `none`,
|
|
26
|
+
margin: 4,
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
const uncheckedIcon = (
|
|
32
|
+
<img
|
|
33
|
+
alt="sun indicating light mode"
|
|
34
|
+
src={sun}
|
|
35
|
+
width="16"
|
|
36
|
+
height="16"
|
|
37
|
+
role="presentation"
|
|
38
|
+
css={{
|
|
39
|
+
pointerEvents: `none`,
|
|
40
|
+
margin: 4,
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Header sx={{ ...props.styles }}>
|
|
47
|
+
<Container sx={{ py: 0 }}>
|
|
48
|
+
<div
|
|
49
|
+
sx={{
|
|
50
|
+
display: `flex`,
|
|
51
|
+
justifyContent: `space-between`,
|
|
52
|
+
alignItems: `center`,
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
<Link to="/" sx={{ color: "inherit", textDecoration: "none" }}>
|
|
56
|
+
<span sx={{ fontSize: [`1.25rem`, `1.5rem`], fontWeight: 600 }}>
|
|
57
|
+
{props.name}
|
|
58
|
+
</span>
|
|
59
|
+
</Link>
|
|
60
|
+
<div
|
|
61
|
+
sx={{
|
|
62
|
+
display: `flex`,
|
|
63
|
+
justifyContent: `space-between`,
|
|
64
|
+
alignItems: `center`,
|
|
65
|
+
mb: 0,
|
|
66
|
+
p: 0,
|
|
67
|
+
height: 59,
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
<div sx={{ display: ["none", "initial"] }}>
|
|
71
|
+
<NavLink to="/projects/">Showcase</NavLink>
|
|
72
|
+
<NavLink to="/about/">About</NavLink>
|
|
73
|
+
<NavLink to="/contact/" sx={{ marginRight: "3rem" }}>
|
|
74
|
+
Contact
|
|
75
|
+
</NavLink>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<Switch
|
|
79
|
+
aria-label="Toggle dark mode"
|
|
80
|
+
checkedIcon={checkedIcon}
|
|
81
|
+
uncheckedIcon={uncheckedIcon}
|
|
82
|
+
checked={isDark}
|
|
83
|
+
onChange={toggleColorMode}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</Container>
|
|
88
|
+
</Header>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React, { useState, useRef } from "react"
|
|
3
|
+
import {
|
|
4
|
+
jsx,
|
|
5
|
+
css,
|
|
6
|
+
Layout as DefaultLayout,
|
|
7
|
+
Main,
|
|
8
|
+
Container,
|
|
9
|
+
Styled,
|
|
10
|
+
} from "theme-ui"
|
|
11
|
+
import { Global } from "@emotion/core"
|
|
12
|
+
import Headroom from "react-headroom"
|
|
13
|
+
import {
|
|
14
|
+
withGoogleMap,
|
|
15
|
+
withScriptjs,
|
|
16
|
+
GoogleMap,
|
|
17
|
+
Marker,
|
|
18
|
+
} from "react-google-maps"
|
|
19
|
+
import jsonMapStyles from "./map-styles"
|
|
20
|
+
|
|
21
|
+
import Header from "./header"
|
|
22
|
+
import Footer from "./footer"
|
|
23
|
+
// import MenuButton from "./menu-button"
|
|
24
|
+
// import Button from "./button"
|
|
25
|
+
// import Sidebar from "./sidebar"
|
|
26
|
+
|
|
27
|
+
const Layout = props => {
|
|
28
|
+
// const [menuOpen, setMenuOpen] = useState(false)
|
|
29
|
+
// const nav = useRef(null)
|
|
30
|
+
|
|
31
|
+
const Map = () => {
|
|
32
|
+
return (
|
|
33
|
+
<GoogleMap
|
|
34
|
+
defaultZoom={10}
|
|
35
|
+
defaultCenter={{ lat: 51.0486, lng: -114.0708 }}
|
|
36
|
+
defaultOptions={{
|
|
37
|
+
styles: jsonMapStyles,
|
|
38
|
+
disableDefaultUI: true,
|
|
39
|
+
zoomControl: false,
|
|
40
|
+
scaleControl: false,
|
|
41
|
+
scrollwheel: false,
|
|
42
|
+
disableDoubleClickZoom: true,
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
<Marker position={{ lat: 51.0486, lng: -114.0708 }} />
|
|
46
|
+
</GoogleMap>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const WrapperMap = withScriptjs(withGoogleMap(Map))
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<Styled.root>
|
|
54
|
+
<DefaultLayout>
|
|
55
|
+
<Global
|
|
56
|
+
styles={{
|
|
57
|
+
"*": {
|
|
58
|
+
boxSizing: "border-box",
|
|
59
|
+
},
|
|
60
|
+
body: {
|
|
61
|
+
margin: 0,
|
|
62
|
+
},
|
|
63
|
+
html: {
|
|
64
|
+
WebkitFontSmoothing: `antialiased`,
|
|
65
|
+
MozOsxFontSmoothing: `grayscale`,
|
|
66
|
+
},
|
|
67
|
+
".mapElement > div": {
|
|
68
|
+
backgroundColor: "transparent !important",
|
|
69
|
+
},
|
|
70
|
+
".headroom": {
|
|
71
|
+
top: 0,
|
|
72
|
+
left: 0,
|
|
73
|
+
right: 0,
|
|
74
|
+
zIndex: 1,
|
|
75
|
+
},
|
|
76
|
+
".headroom--unfixed": {
|
|
77
|
+
position: `relative`,
|
|
78
|
+
transform: `translateY(0)`,
|
|
79
|
+
},
|
|
80
|
+
".headroom--scrolled": {
|
|
81
|
+
transition: `transform 200ms ease-in-out`,
|
|
82
|
+
},
|
|
83
|
+
".headroom--unpinned": {
|
|
84
|
+
position: `fixed`,
|
|
85
|
+
transform: `translateY(-100%)`,
|
|
86
|
+
},
|
|
87
|
+
".headroom--pinned": {
|
|
88
|
+
position: `fixed`,
|
|
89
|
+
transform: `translateY(0%)`,
|
|
90
|
+
borderBottom: `1px solid transparent`,
|
|
91
|
+
...props.headRoomStyles,
|
|
92
|
+
},
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<Headroom disableInlineStyles={true}>
|
|
97
|
+
<Header styles={props.headerStyles} />
|
|
98
|
+
</Headroom>
|
|
99
|
+
|
|
100
|
+
<Main>
|
|
101
|
+
<div
|
|
102
|
+
sx={{
|
|
103
|
+
...props.mainStyles,
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
<Container>{props.children}</Container>
|
|
107
|
+
</div>
|
|
108
|
+
</Main>
|
|
109
|
+
|
|
110
|
+
<WrapperMap
|
|
111
|
+
googleMapURL={`https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,drawing,places&key=AIzaSyBOY0sT1quks122bprrLM_0wrWLDWyVnMQ`}
|
|
112
|
+
loadingElement={<div sx={{ height: `350px` }} />}
|
|
113
|
+
containerElement={
|
|
114
|
+
<div sx={{ height: `350px`, backgroundColor: "#f8f9fa" }} />
|
|
115
|
+
}
|
|
116
|
+
mapElement={
|
|
117
|
+
<div
|
|
118
|
+
sx={{
|
|
119
|
+
height: `100%`,
|
|
120
|
+
}}
|
|
121
|
+
className="mapElement"
|
|
122
|
+
/>
|
|
123
|
+
}
|
|
124
|
+
/>
|
|
125
|
+
|
|
126
|
+
<Footer />
|
|
127
|
+
</DefaultLayout>
|
|
128
|
+
</Styled.root>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export default Layout
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
const jsonMapStyles = [
|
|
2
|
+
{
|
|
3
|
+
featureType: "administrative",
|
|
4
|
+
elementType: "all",
|
|
5
|
+
stylers: [
|
|
6
|
+
{
|
|
7
|
+
saturation: "-100",
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
featureType: "administrative.province",
|
|
13
|
+
elementType: "all",
|
|
14
|
+
stylers: [
|
|
15
|
+
{
|
|
16
|
+
visibility: "off",
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
featureType: "landscape",
|
|
22
|
+
elementType: "all",
|
|
23
|
+
stylers: [
|
|
24
|
+
{
|
|
25
|
+
saturation: -100,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
lightness: 65,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
visibility: "on",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
featureType: "poi",
|
|
37
|
+
elementType: "all",
|
|
38
|
+
stylers: [
|
|
39
|
+
{
|
|
40
|
+
saturation: -100,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
lightness: "50",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
visibility: "simplified",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
featureType: "poi",
|
|
52
|
+
elementType: "labels.icon",
|
|
53
|
+
stylers: [
|
|
54
|
+
{
|
|
55
|
+
visibility: "off",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
featureType: "road",
|
|
61
|
+
elementType: "all",
|
|
62
|
+
stylers: [
|
|
63
|
+
{
|
|
64
|
+
saturation: "-100",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
featureType: "road.highway",
|
|
70
|
+
elementType: "all",
|
|
71
|
+
stylers: [
|
|
72
|
+
{
|
|
73
|
+
visibility: "simplified",
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
featureType: "road.arterial",
|
|
79
|
+
elementType: "all",
|
|
80
|
+
stylers: [
|
|
81
|
+
{
|
|
82
|
+
lightness: "30",
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
featureType: "road.local",
|
|
88
|
+
elementType: "all",
|
|
89
|
+
stylers: [
|
|
90
|
+
{
|
|
91
|
+
lightness: "40",
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
featureType: "transit",
|
|
97
|
+
elementType: "all",
|
|
98
|
+
stylers: [
|
|
99
|
+
{
|
|
100
|
+
saturation: -100,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
visibility: "simplified",
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
featureType: "water",
|
|
109
|
+
elementType: "geometry",
|
|
110
|
+
stylers: [
|
|
111
|
+
{
|
|
112
|
+
hue: "#ffff00",
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
lightness: -25,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
saturation: -97,
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
featureType: "water",
|
|
124
|
+
elementType: "labels",
|
|
125
|
+
stylers: [
|
|
126
|
+
{
|
|
127
|
+
lightness: -25,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
saturation: -100,
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
export default jsonMapStyles
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from 'theme-ui';
|
|
4
|
+
|
|
5
|
+
const Burger = ({ size = '1.5rem' }) => (
|
|
6
|
+
<svg
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
width={size}
|
|
9
|
+
height={size}
|
|
10
|
+
fill="currentcolor"
|
|
11
|
+
viewBox="0 0 24 24"
|
|
12
|
+
sx={{
|
|
13
|
+
display: 'block',
|
|
14
|
+
margin: 0
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export default props => (
|
|
22
|
+
<button
|
|
23
|
+
title="Toggle Menu"
|
|
24
|
+
{...props}
|
|
25
|
+
sx={{
|
|
26
|
+
fontFamily: 'inherit',
|
|
27
|
+
fontSize: 24,
|
|
28
|
+
color: '#333',
|
|
29
|
+
bg: 'transparent',
|
|
30
|
+
p: 0,
|
|
31
|
+
m: 0,
|
|
32
|
+
border: 0,
|
|
33
|
+
appearance: 'none',
|
|
34
|
+
':focus': {
|
|
35
|
+
outline: '0'
|
|
36
|
+
},
|
|
37
|
+
'@media screen and (min-width: 40em)': {
|
|
38
|
+
display: 'none'
|
|
39
|
+
}
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<Burger />
|
|
43
|
+
</button>
|
|
44
|
+
);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from "react"
|
|
3
|
+
import { jsx } from "theme-ui"
|
|
4
|
+
import { Link } from "gatsby"
|
|
5
|
+
import isAbsoluteURL from "is-absolute-url"
|
|
6
|
+
|
|
7
|
+
const styles = {
|
|
8
|
+
display: "inline-block",
|
|
9
|
+
px: 0,
|
|
10
|
+
py: 0,
|
|
11
|
+
color: "primary",
|
|
12
|
+
margin: "1rem",
|
|
13
|
+
textDecoration: "none",
|
|
14
|
+
borderBottom: `2px solid transparent`,
|
|
15
|
+
lineHeight: "2rem",
|
|
16
|
+
transition: `all .5s ease-in;`,
|
|
17
|
+
"&.active": {
|
|
18
|
+
color: "secondary",
|
|
19
|
+
cursor: "default",
|
|
20
|
+
},
|
|
21
|
+
"&:hover:not(.active)": {
|
|
22
|
+
borderColor: "primary",
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default ({ href, ...props }) => {
|
|
27
|
+
const isExternal = isAbsoluteURL(href || "")
|
|
28
|
+
if (isExternal) {
|
|
29
|
+
return (
|
|
30
|
+
<a href={href} sx={styles}>
|
|
31
|
+
{props}
|
|
32
|
+
</a>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
const to = props.to || href
|
|
36
|
+
return <Link {...props} to={to} sx={styles} activeClassName="active" />
|
|
37
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Link } from "gatsby"
|
|
3
|
+
import { Styled } from "theme-ui"
|
|
4
|
+
|
|
5
|
+
const ProjectList = ({ projects }) => (
|
|
6
|
+
<React.Fragment>
|
|
7
|
+
<Styled.h1>City of Calgary Events</Styled.h1>
|
|
8
|
+
<Styled.ul>
|
|
9
|
+
{projects.map(project => (
|
|
10
|
+
<Styled.li key={project.id}>
|
|
11
|
+
<Styled.a as={Link} to={project.slug}>
|
|
12
|
+
{project.title}
|
|
13
|
+
</Styled.a>
|
|
14
|
+
<p>{project.dateTime}</p>
|
|
15
|
+
</Styled.li>
|
|
16
|
+
))}
|
|
17
|
+
</Styled.ul>
|
|
18
|
+
</React.Fragment>
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
export default ProjectList
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from "react"
|
|
3
|
+
import { Styled, jsx } from "theme-ui"
|
|
4
|
+
import { Link } from "gatsby"
|
|
5
|
+
import { FaArrowLeft } from "react-icons/fa"
|
|
6
|
+
|
|
7
|
+
const Project = ({ title, address, notes }) => (
|
|
8
|
+
<div>
|
|
9
|
+
<div
|
|
10
|
+
sx={{ py: "9rem", px: "3rem", marginTop: "12rem", marginBottom: "3rem" }}
|
|
11
|
+
>
|
|
12
|
+
<Styled.a as={Link} to="/projects/">
|
|
13
|
+
<FaArrowLeft size={12} sx={{ marginRight: ".25rem" }} />
|
|
14
|
+
Back to showcase
|
|
15
|
+
</Styled.a>
|
|
16
|
+
|
|
17
|
+
<Styled.h1>
|
|
18
|
+
{title} - {address}
|
|
19
|
+
</Styled.h1>
|
|
20
|
+
<Styled.h6>{notes}</Styled.h6>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export default Project
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx, Box } from 'theme-ui';
|
|
4
|
+
|
|
5
|
+
import { MDXProvider } from '@mdx-js/react';
|
|
6
|
+
import NavLink from './nav-link';
|
|
7
|
+
|
|
8
|
+
const components = {
|
|
9
|
+
a: NavLink
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default React.forwardRef(({ fullwidth, ...props }, ref) => (
|
|
13
|
+
<>
|
|
14
|
+
{props.open ? (
|
|
15
|
+
<Box
|
|
16
|
+
{...props}
|
|
17
|
+
ref={ref}
|
|
18
|
+
sx={{
|
|
19
|
+
display: 'block',
|
|
20
|
+
position: 'fixed',
|
|
21
|
+
top: 87,
|
|
22
|
+
left: 0,
|
|
23
|
+
bottom: 0,
|
|
24
|
+
width: 256,
|
|
25
|
+
px: 2,
|
|
26
|
+
bg: 'background',
|
|
27
|
+
transition: 'transform .2s ease-out',
|
|
28
|
+
transform: props.open ? 'translateX(0)' : 'translateX(-100%)',
|
|
29
|
+
|
|
30
|
+
ul: {
|
|
31
|
+
listStyle: 'none',
|
|
32
|
+
m: 0,
|
|
33
|
+
p: 0
|
|
34
|
+
}
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<MDXProvider components={components}>Home</MDXProvider>
|
|
38
|
+
</Box>
|
|
39
|
+
) : null}
|
|
40
|
+
</>
|
|
41
|
+
));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import ReactSwitch from "react-switch"
|
|
3
|
+
import { css } from "theme-ui"
|
|
4
|
+
|
|
5
|
+
export const Switch = props => <ReactSwitch {...props} />
|
|
6
|
+
|
|
7
|
+
Switch.defaultProps = {
|
|
8
|
+
checkedIcon: false,
|
|
9
|
+
uncheckedIcon: false,
|
|
10
|
+
height: 24,
|
|
11
|
+
width: 48,
|
|
12
|
+
handleDiameter: 16,
|
|
13
|
+
offColor: `#00bfff`,
|
|
14
|
+
onColor: `#000`,
|
|
15
|
+
|
|
16
|
+
// boxShadow: `inset 0 0 0 1px #000`,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default Switch
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { ThemeProvider } from "theme-ui"
|
|
3
|
+
|
|
4
|
+
export default props => (
|
|
5
|
+
<ThemeProvider
|
|
6
|
+
theme={{
|
|
7
|
+
styles: {
|
|
8
|
+
ul: {
|
|
9
|
+
listStyle: `none`,
|
|
10
|
+
display: [`block`, `flex`],
|
|
11
|
+
margin: [`0`, `0 -16px`],
|
|
12
|
+
p: 0,
|
|
13
|
+
m: 0,
|
|
14
|
+
},
|
|
15
|
+
li: {
|
|
16
|
+
bg: `cBg`,
|
|
17
|
+
boxShadow: `0 1px 2px 0 rgba(34,36,38,.15)`,
|
|
18
|
+
borderRadius: `.125rem`,
|
|
19
|
+
border: `1px solid rgba(34,36,38,.15)`,
|
|
20
|
+
textAlign: `center`,
|
|
21
|
+
// fontSize: `.875rem`,
|
|
22
|
+
mx: [0, 3],
|
|
23
|
+
mb: 4,
|
|
24
|
+
mt: 2,
|
|
25
|
+
p: 3,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
<div {...props} />
|
|
31
|
+
</ThemeProvider>
|
|
32
|
+
)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import merge from "deepmerge"
|
|
2
|
+
import { bootstrap } from "@theme-ui/presets"
|
|
3
|
+
import styles from "./styles"
|
|
4
|
+
|
|
5
|
+
const overwriteMerge = (destinationArray, sourceArray, options) => sourceArray
|
|
6
|
+
|
|
7
|
+
export default merge(
|
|
8
|
+
bootstrap,
|
|
9
|
+
{
|
|
10
|
+
breakpoints: ["768px", "992px", "1200px"],
|
|
11
|
+
initialColorMode: `light`,
|
|
12
|
+
useCustomProperties: true,
|
|
13
|
+
textStyles: {
|
|
14
|
+
heading: {
|
|
15
|
+
fontFamily: "heading",
|
|
16
|
+
fontWeight: "heading",
|
|
17
|
+
lineHeight: "heading",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
colors: {
|
|
21
|
+
mBg: `#f8f9fa`,
|
|
22
|
+
cBg: `#ffffff`,
|
|
23
|
+
sBg: `#e2e8f0`,
|
|
24
|
+
modes: {
|
|
25
|
+
dark: {
|
|
26
|
+
background: `#333333`,
|
|
27
|
+
text: `#ffffff`,
|
|
28
|
+
mBg: `#333333`,
|
|
29
|
+
cBg: `#333333`,
|
|
30
|
+
sBg: `#333333`,
|
|
31
|
+
primary: `pink`,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
project: {
|
|
36
|
+
primary: {
|
|
37
|
+
bg: "cBg",
|
|
38
|
+
},
|
|
39
|
+
secondary: {
|
|
40
|
+
bg: "sBg",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
styles,
|
|
44
|
+
},
|
|
45
|
+
{ arrayMerge: overwriteMerge }
|
|
46
|
+
)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
Container: {
|
|
3
|
+
py: 3,
|
|
4
|
+
width: ["100%", "90%"],
|
|
5
|
+
maxWidth: "1168px",
|
|
6
|
+
},
|
|
7
|
+
Header: {
|
|
8
|
+
primary: {
|
|
9
|
+
bg: `cBg`,
|
|
10
|
+
borderBottom: `1px solid transparent`,
|
|
11
|
+
borderColor: `rgb(212, 212, 213)`,
|
|
12
|
+
},
|
|
13
|
+
secondary: {
|
|
14
|
+
bg: `cBg`,
|
|
15
|
+
borderBottom: `1px solid transparent`,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
p: {
|
|
19
|
+
fontSize: [2],
|
|
20
|
+
},
|
|
21
|
+
h1: {
|
|
22
|
+
variant: "textStyles.heading",
|
|
23
|
+
fontSize: [5, 6],
|
|
24
|
+
},
|
|
25
|
+
h2: {
|
|
26
|
+
variant: "textStyles.heading",
|
|
27
|
+
fontSize: [4, 5],
|
|
28
|
+
fontWeight: 500,
|
|
29
|
+
},
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { graphql } from "gatsby"
|
|
3
|
+
import Layout from "../components/layout"
|
|
4
|
+
import Project from "../components/project"
|
|
5
|
+
|
|
6
|
+
const ProjectTemplates = ({ data: { project } }) => {
|
|
7
|
+
const mainStyles = {
|
|
8
|
+
variant: "styles.Header.secondary",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const headRoomStyles = {
|
|
12
|
+
borderColor: `rgb(212, 212, 213)`,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Layout mainStyles={mainStyles} headRoomStyles={headRoomStyles}>
|
|
17
|
+
<Project {...project} />
|
|
18
|
+
</Layout>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default ProjectTemplates
|
|
23
|
+
|
|
24
|
+
export const query = graphql`
|
|
25
|
+
query($projectID: String!) {
|
|
26
|
+
project(id: { eq: $projectID }) {
|
|
27
|
+
title
|
|
28
|
+
notes
|
|
29
|
+
address
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { graphql, useStaticQuery } from "gatsby"
|
|
3
|
+
import Layout from "../components/layout"
|
|
4
|
+
import ProjectList from "../components/project-list"
|
|
5
|
+
|
|
6
|
+
const ProjectsTemplates = () => {
|
|
7
|
+
const data = useStaticQuery(graphql`
|
|
8
|
+
query {
|
|
9
|
+
allProject(
|
|
10
|
+
sort: { fields: date, order: ASC }
|
|
11
|
+
filter: { date: { ne: null } }
|
|
12
|
+
) {
|
|
13
|
+
nodes {
|
|
14
|
+
id
|
|
15
|
+
title
|
|
16
|
+
address
|
|
17
|
+
notes
|
|
18
|
+
date
|
|
19
|
+
dateTime
|
|
20
|
+
slug
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`)
|
|
25
|
+
|
|
26
|
+
const projects = data.allProject.nodes
|
|
27
|
+
|
|
28
|
+
const styles = {
|
|
29
|
+
variant: "styles.Header.primary",
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Layout headerStyles={styles}>
|
|
34
|
+
<ProjectList projects={projects} />
|
|
35
|
+
</Layout>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default ProjectsTemplates
|