@t2ca/gatsby-theme-showcase 1.0.8 → 1.0.10

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/index.js CHANGED
@@ -5,3 +5,5 @@ export { default as Card } from "./src/components/card"
5
5
  export { default as Button } from "./src/components/button"
6
6
  export { default as LogoBanner } from "./src/components/logo-banner"
7
7
  export { default as Wave } from "./src/components/wave"
8
+ export { default as Hero } from "./src/components/hero"
9
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t2ca/gatsby-theme-showcase",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "devDependencies": {
@@ -28,6 +28,7 @@
28
28
  "@hot-loader/react-dom": "^16.9.0",
29
29
  "@mdx-js/mdx": "^1.4.0",
30
30
  "@mdx-js/react": "^1.4.0",
31
+ "@theme-ui/components": "^0.2.49",
31
32
  "@theme-ui/preset-bootstrap": "^0.2.25",
32
33
  "@theme-ui/preset-tailwind": "^0.2.30",
33
34
  "@theme-ui/sidenav": "^0.2.36",
@@ -46,7 +47,6 @@
46
47
  "gatsby-transformer-sharp": "^2.2.5",
47
48
  "gatsby-transformer-yaml": "^2.2.1",
48
49
  "react-google-maps": "^9.4.5",
49
- "react-headroom": "^2.2.8",
50
50
  "react-icons": "^3.7.0",
51
51
  "react-spring": "^8.0.27",
52
52
  "react-switch": "^5.0.0",
@@ -1,75 +1,111 @@
1
- /** @jsx jsx */
2
1
  import React from "react"
3
- import { jsx } from "theme-ui"
2
+ import styled from "@emotion/styled"
3
+ import { useColorMode } from "theme-ui"
4
4
 
5
- const ColorModeToggle = ({ isDark, toggle }) => (
6
- <React.Fragment>
7
- <button
8
- onClick={toggle}
9
- type="button"
10
- aria-label={isDark ? `Light Mode` : `Dark Mode`}
11
- title={isDark ? `Light Mode` : `Dark Mode`}
12
- sx={{
13
- opacity: 0.65,
14
- position: `relative`,
15
- borderRadius: `5px`,
16
- // width: `40px`,
17
- // height: `25px`,
18
- display: `flex`,
19
- alignItems: `center`,
20
- justifyContent: `center`,
21
- transition: `opacity 0.3s ease`,
22
- border: `none`,
23
- outline: `none`,
24
- background: `none`,
25
- cursor: `pointer`,
26
- "&:hover, &:focus": { opacity: 1 },
27
- }}
5
+ const IconWrapper = styled.button`
6
+ padding: 0;
7
+ appearance: none;
8
+ outline: none;
9
+ align-items: center;
10
+ background: transparent;
11
+ border-radius: 5px;
12
+ border: 0;
13
+ cursor: pointer;
14
+ display: inline-flex;
15
+ height: 40px;
16
+ justify-content: center;
17
+ opacity: 0.75;
18
+ overflow: hidden;
19
+ position: relative;
20
+ transform: scale(0.75);
21
+ transition: opacity 0.3s ease;
22
+ vertical-align: middle;
23
+ width: 40px;
24
+ &:hover {
25
+ opacity: 1;
26
+ }
27
+ `
28
+
29
+ const MoonOrSun = styled.div`
30
+ border: ${p => (p.isDark ? `4px` : `2px`)} solid
31
+ ${p => p.theme.colors.toggleIcon};
32
+ background: ${p => p.theme.colors.toggleIcon};
33
+ border-radius: 50%;
34
+ height: 24px;
35
+ overflow: ${p => (p.isDark ? `visible` : `hidden`)};
36
+ position: relative;
37
+ transform: scale(${p => (p.isDark ? 0.55 : 1)});
38
+ transition: all 0.45s ease;
39
+ width: 24px;
40
+ &::before {
41
+ border-radius: 50%;
42
+ border: 2px solid ${p => p.theme.colors.toggleIcon};
43
+ content: "";
44
+ height: 24px;
45
+ opacity: ${p => (p.isDark ? 0 : 1)};
46
+ position: absolute;
47
+ right: -9px;
48
+ top: -9px;
49
+ transform: translate(${p => (p.isDark ? `14px, -14px` : `0, 0`)});
50
+ transition: transform 0.45s ease;
51
+ width: 24px;
52
+ }
53
+ &::after {
54
+ border-radius: 50%;
55
+ box-shadow: 0 -23px 0 ${p => p.theme.colors.toggleIcon},
56
+ 0 23px 0 ${p => p.theme.colors.toggleIcon},
57
+ 23px 0 0 ${p => p.theme.colors.toggleIcon},
58
+ -23px 0 0 ${p => p.theme.colors.toggleIcon},
59
+ 15px 15px 0 ${p => p.theme.colors.toggleIcon},
60
+ -15px 15px 0 ${p => p.theme.colors.toggleIcon},
61
+ 15px -15px 0 ${p => p.theme.colors.toggleIcon},
62
+ -15px -15px 0 ${p => p.theme.colors.toggleIcon};
63
+ content: "";
64
+ height: 8px;
65
+ left: 50%;
66
+ margin: -4px 0 0 -4px;
67
+ position: absolute;
68
+ top: 50%;
69
+ width: 8px;
70
+ transform: scale(${p => (p.isDark ? 1 : 0)});
71
+ transition: all 0.35s ease;
72
+ }
73
+ `
74
+
75
+ const MoonMask = styled.div`
76
+ background: ${p => p.theme.colors.white};
77
+ border-radius: 50%;
78
+ border: 0;
79
+ height: 24px;
80
+ opacity: ${p => (p.isDark ? 0 : 1)};
81
+ position: absolute;
82
+ right: 0;
83
+ top: 0;
84
+ transform: translate(${p => (p.isDark ? `14px, -14px` : `0, 0`)});
85
+ transition: background 0.25s ease, transform 0.45s ease;
86
+ width: 24px;
87
+ `
88
+
89
+ const ColorModeToggle = () => {
90
+ const [colorMode, setColorMode] = useColorMode()
91
+ const isDark = colorMode === `dark`
92
+
93
+ const toggleColorMode = e => {
94
+ e.preventDefault()
95
+ setColorMode(isDark ? `light` : `dark`)
96
+ }
97
+
98
+ return (
99
+ <IconWrapper
100
+ isDark={isDark}
101
+ onClick={toggleColorMode}
102
+ aria-label={isDark ? `Activate light mode` : `Activate dark mode`}
103
+ title={isDark ? `Activate light mode` : `Activate dark mode`}
28
104
  >
29
- <div
30
- sx={{
31
- position: `relative`,
32
- width: `24px`,
33
- height: `24px`,
34
- borderRadius: `50%`,
35
- border: t => (isDark ? `4px solid ${t.colors.toggleIcon}` : `none`),
36
- backgroundColor: isDark ? `toggleIcon` : `transparent`,
37
- transform: isDark ? `scale(0.40)` : `scale(0.80)`,
38
- transition: `all 0.45s ease`,
39
- overflow: isDark ? `visible` : `hidden`,
40
- boxShadow: t =>
41
- isDark ? `none` : `inset 8px -8px 0px 0px ${t.colors.toggleIcon}`,
42
- "&:before": {
43
- content: `""`,
44
- position: `absolute`,
45
- right: `-9px`,
46
- top: `-9px`,
47
- height: `24px`,
48
- width: `24px`,
49
- border: t => (isDark ? `2px solid ${t.colors.toggleIcon}` : `none`),
50
- borderRadius: `50%`,
51
- transform: isDark ? `translate(14px, -14px)` : `translate(0, 0)`,
52
- opacity: isDark ? 0 : 1,
53
- transition: `transform 0.45s ease`,
54
- },
55
- "&:after": {
56
- content: `""`,
57
- width: `8px`,
58
- height: `8px`,
59
- borderRadius: `50%`,
60
- margin: `-4px 0 0 -4px`,
61
- position: `absolute`,
62
- top: `50%`,
63
- left: `50%`,
64
- boxShadow: t =>
65
- `0 -23px 0 ${t.colors.toggleIcon}, 0 23px 0 ${t.colors.toggleIcon}, 23px 0 0 ${t.colors.toggleIcon}, -23px 0 0 ${t.colors.toggleIcon}, 15px 15px 0 ${t.colors.toggleIcon}, -15px 15px 0 ${t.colors.toggleIcon}, 15px -15px 0 ${t.colors.toggleIcon}, -15px -15px 0 ${t.colors.toggleIcon}`,
66
- transform: isDark ? `scale(1)` : `scale(0)`,
67
- transition: `all 0.35s ease`,
68
- },
69
- }}
70
- />
71
- </button>
72
- </React.Fragment>
73
- )
105
+ <MoonOrSun isDark={isDark} />
106
+ <MoonMask isDark={isDark} />
107
+ </IconWrapper>
108
+ )
109
+ }
74
110
 
75
111
  export default ColorModeToggle
@@ -7,24 +7,11 @@ import MenuButton from "./menu-button"
7
7
  import NavLink from "./nav-link"
8
8
  import ColorModeToggle from "./color-mode-toggle"
9
9
 
10
- export default ({
11
- setColorMode,
12
- setMenuOpen,
13
- isDark,
14
- styles,
15
- menuOpen,
16
- nav,
17
- name,
18
- menuList,
19
- type,
20
- }) => {
21
- const toggleColorMode = e => {
22
- e.preventDefault()
23
- setColorMode(isDark ? `light` : `dark`)
24
- }
25
-
10
+ export default ({ setMenuOpen, styles, menuOpen, nav, name, menuList }) => {
26
11
  return (
27
- <Header sx={{ ...styles }}>
12
+ <Header
13
+ sx={{ ...styles, position: `fixed`, zIndex: `100`, width: `100%`, py: 2 }}
14
+ >
28
15
  <Container sx={{ py: 0 }}>
29
16
  <div
30
17
  sx={{
@@ -73,7 +60,7 @@ export default ({
73
60
  ))}
74
61
  </div>
75
62
 
76
- <ColorModeToggle isDark={isDark} toggle={toggleColorMode} />
63
+ <ColorModeToggle />
77
64
  </div>
78
65
  </div>
79
66
  </Container>
@@ -2,9 +2,13 @@
2
2
  import React from "react"
3
3
  import { jsx, Styled, Container } from "theme-ui"
4
4
  import { useSpring, animated } from "react-spring"
5
- import Wave from "./wave"
6
5
 
7
- export default props => {
6
+ export default ({
7
+ headingTop,
8
+ headingMiddle,
9
+ headingBottom,
10
+ minHeight = `100vh`,
11
+ }) => {
8
12
  const titleProps = useSpring({
9
13
  from: { opacity: 0, transform: "translate3d(0, -200px, 0)" },
10
14
  to: { opacity: 1, transform: "translate3d(0, 0, 0)" },
@@ -18,19 +22,19 @@ export default props => {
18
22
  px: [4, 5],
19
23
  position: "relative",
20
24
  bg: `MainHero`,
21
- minHeight: `75vh`, // screenHeight
25
+ minHeight: minHeight, // screenHeight
22
26
  }}
23
27
  >
24
28
  <Container>
25
29
  <animated.div style={titleProps}>
26
30
  <Styled.h1 sx={{ fontSize: [6, 7], fontWeight: `extrabold` }}>
27
- {props.headingTop}
31
+ {headingTop}
28
32
  </Styled.h1>
29
33
  <Styled.h1 sx={{ fontSize: [6, 7], fontWeight: `extrabold` }}>
30
- {props.headingMiddle}
34
+ {headingMiddle}
31
35
  </Styled.h1>
32
36
  <Styled.h1 sx={{ fontSize: [6, 7], fontWeight: `extrabold` }}>
33
- {props.headingBottom}
37
+ {headingBottom}
34
38
  </Styled.h1>
35
39
  <div sx={{ width: [`5/6`, `2/3`] }}>
36
40
  <Styled.p sx={{ fontSize: [1, 2], py: 4, lineHeight: 2.5 }}>
@@ -43,8 +47,6 @@ export default props => {
43
47
  </animated.div>
44
48
  </Container>
45
49
  </div>
46
-
47
- <Wave background="Menu" />
48
50
  </React.Fragment>
49
51
  )
50
52
  }
@@ -2,15 +2,13 @@
2
2
  import React, { useState, useRef } from "react"
3
3
  import {
4
4
  jsx,
5
- css,
6
5
  Layout as DefaultLayout,
7
6
  Main,
8
- Container,
9
7
  Styled,
10
8
  useColorMode,
11
9
  } from "theme-ui"
12
10
  import { Global } from "@emotion/core"
13
- import Headroom from "react-headroom"
11
+
14
12
  import {
15
13
  withGoogleMap,
16
14
  withScriptjs,
@@ -24,20 +22,13 @@ import jsonMapStylesDark from "./map-styles-dark"
24
22
  import MobileNavigation from "./navigation-mobile"
25
23
  import Header from "./header"
26
24
  import Footer from "./footer"
27
- // import MenuButton from "./menu-button"
28
- // import Button from "./button"
29
25
  import Sidebar from "./sidebar"
30
- import Hero from "./hero"
31
26
 
32
- const Layout = props => {
27
+ const Layout = ({ header, main, location, children }) => {
33
28
  const [menuOpen, setMenuOpen] = useState(false)
34
29
  const nav = useRef(null)
35
30
 
36
- const [colorMode, setColorMode] = useColorMode()
37
- const isDark = colorMode === `dark`
38
- // const toggleColorMode = e => {
39
- // setColorMode(isDark ? `light` : `dark`)
40
- // }
31
+ const [colorMode] = useColorMode()
41
32
 
42
33
  const Map = () => {
43
34
  return (
@@ -45,7 +36,7 @@ const Layout = props => {
45
36
  defaultZoom={10}
46
37
  defaultCenter={{ lat: 51.0486, lng: -114.0708 }}
47
38
  defaultOptions={{
48
- styles: isDark ? jsonMapStylesDark : jsonMapStyles,
39
+ styles: colorMode === "light" ? jsonMapStyles : jsonMapStylesDark,
49
40
  disableDefaultUI: true,
50
41
  zoomControl: false,
51
42
  scaleControl: false,
@@ -88,9 +79,7 @@ const Layout = props => {
88
79
  />
89
80
 
90
81
  <Header
91
- styles={props.header}
92
- setColorMode={setColorMode}
93
- isDark={isDark}
82
+ styles={header}
94
83
  menuOpen={menuOpen}
95
84
  setMenuOpen={setMenuOpen}
96
85
  nav={nav}
@@ -116,55 +105,44 @@ const Layout = props => {
116
105
  }}
117
106
  />
118
107
  </div>
119
- {/* <div
120
- id="content"
121
- sx={{
122
- width: "100%",
123
- minWidth: 0,
124
- }}
125
- >
126
- {props.children}
127
-
128
-
129
-
130
- </div>*/}
131
-
132
- {props.location.pathname === "/" ? <Hero isDark={isDark} /> : null}
133
108
 
134
109
  <div
135
110
  sx={{
136
- ...props.main,
111
+ ...main,
112
+ pt: `4.75rem`,
137
113
  }}
138
114
  >
139
- {props.children}
115
+ {children}
140
116
  </div>
141
117
  </Main>
142
118
 
143
- {/* <div sx={{ display: ["none", "initial"] }}>
144
- <WrapperMap
145
- googleMapURL={`https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,drawing,places&key=AIzaSyBOY0sT1quks122bprrLM_0wrWLDWyVnMQ`}
146
- loadingElement={<div sx={{ height: `350px` }} />}
147
- containerElement={
148
- <div
149
- sx={{
150
- height: `350px`,
151
- backgroundColor: isDark ? "#333" : "#f8f9fa",
152
- }}
153
- />
154
- }
155
- mapElement={
156
- <div
157
- sx={{
158
- height: `100%`,
159
- }}
160
- className="mapElement"
161
- />
162
- }
163
- />
164
- </div>*/}
119
+ {location && location.pathname === "/contact/" ? (
120
+ <div sx={{ display: ["none", "initial"] }}>
121
+ <WrapperMap
122
+ googleMapURL={`https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,drawing,places&key=AIzaSyBOY0sT1quks122bprrLM_0wrWLDWyVnMQ`}
123
+ loadingElement={<div sx={{ height: `350px` }} />}
124
+ containerElement={
125
+ <div
126
+ sx={{
127
+ height: `350px`,
128
+ backgroundColor: colorMode === "light" ? "#f8f9fa" : "#333",
129
+ }}
130
+ />
131
+ }
132
+ mapElement={
133
+ <div
134
+ sx={{
135
+ height: `100%`,
136
+ }}
137
+ className="mapElement"
138
+ />
139
+ }
140
+ />
141
+ </div>
142
+ ) : null}
165
143
 
166
144
  <Footer />
167
- <MobileNavigation isDark={isDark} />
145
+ <MobileNavigation />
168
146
  </DefaultLayout>
169
147
  </Styled.root>
170
148
  )
@@ -1,23 +1,24 @@
1
1
  /** @jsx jsx */
2
2
  import React from "react"
3
- import { jsx } from "theme-ui"
3
+ import { jsx, useColorMode } from "theme-ui"
4
4
  import { Link } from "gatsby"
5
- import { css } from "@emotion/core"
6
5
 
7
6
  import Icon from "./icon"
8
7
 
9
8
  const MobileNavItem = ({ linkTo, label, icon, isDark }) => {
9
+ const [colorMode] = useColorMode()
10
+
10
11
  const linkStyles = {
11
- borderRadius: "2px",
12
- color: "text",
13
- fontSize: "0.75rem",
14
- flexShrink: "0",
15
- lineHeight: "1",
12
+ borderRadius: 1,
13
+ color: `text`,
14
+ fontSize: `0.75rem`,
15
+ flexShrink: 0,
16
+ lineHeight: `none`,
16
17
  // width: "64",
17
- textDecoration: "none",
18
- textAlign: "center",
19
- padding: "0.75rem",
20
- "&:hover": { textDecoration: "none" },
18
+ textDecoration: `none`,
19
+ textAlign: `center`,
20
+ p: `0.75rem`,
21
+ "&:hover": { textDecoration: `none` },
21
22
  }
22
23
 
23
24
  return (
@@ -25,7 +26,7 @@ const MobileNavItem = ({ linkTo, label, icon, isDark }) => {
25
26
  to={linkTo}
26
27
  sx={linkStyles}
27
28
  partiallyActive={linkTo === "/" ? false : true}
28
- activeStyle={{ color: isDark ? "pink" : `#2b6cb0` }}
29
+ activeStyle={{ color: colorMode === "light" ? `#2b6cb0` : `pink` }}
29
30
  >
30
31
  <span>{icon}</span>
31
32
  <div>{label}</div>
@@ -37,19 +38,19 @@ const MobileNavigation = ({ isDark, menuList }) => (
37
38
  <React.Fragment>
38
39
  <div
39
40
  sx={{
40
- position: "fixed",
41
- display: "flex",
42
- justifyContent: "space-around",
43
- bottom: "0",
44
- left: "0",
45
- right: "0",
46
- zIndex: "50",
47
- borderTop: "1px solid transparent",
48
- borderColor: "MenuBorder",
49
- bg: "Menu",
50
- height: "3.75rem",
51
- paddingBottom: "env(safe-area-inset-bottom)",
52
- "@media (min-width: 640px)": { display: "none" },
41
+ position: `fixed`,
42
+ display: [`flex`, `none`],
43
+ justifyContent: `space-around`,
44
+ bottom: 0,
45
+ left: 0,
46
+ right: 0,
47
+ zIndex: 50,
48
+ bg: `Menu`,
49
+ borderColor: `MenuBorder`,
50
+ borderTopStyle: `solid`,
51
+ borderTopWidth: `1px`,
52
+ height: `3.75rem`,
53
+ pb: `env(safe-area-inset-bottom)`,
53
54
  }}
54
55
  >
55
56
  {menuList &&
@@ -29,6 +29,7 @@ const Project = data => {
29
29
  px: ["1.5rem", "3rem"],
30
30
  zIndex: "1",
31
31
  position: "relative",
32
+ minHeight: `75vh`, // screenHeight
32
33
  }}
33
34
  >
34
35
  <animated.div style={titleProps}>
@@ -55,6 +56,14 @@ const Project = data => {
55
56
  </Container>
56
57
 
57
58
  <Wave background="cBg" />
59
+
60
+ <div sx={{ bg: `mBg` }}>
61
+ <Container>
62
+ <div sx={{ width: `2/3`, m: `0 auto` }}>
63
+ <Image fluid={data.laptop.childImageSharp.fluid} sx={{}} />
64
+ </div>
65
+ </Container>
66
+ </div>
58
67
  </React.Fragment>
59
68
  )
60
69
  }
@@ -7,13 +7,12 @@ export default {
7
7
  Header: {
8
8
  primary: {
9
9
  bg: `Menu`,
10
- // borderBottom: `1px solid transparent`,
10
+ borderBottom: `1px solid transparent`,
11
11
  // position: "fixed",
12
12
  // top: 0,
13
13
  // width: "100%",
14
14
  // zIndex: 10,
15
15
  // borderColor: `rgb(212, 212, 213)`,
16
-
17
16
  // borderColor: `rgb(212, 212, 213)`,
18
17
  },
19
18
  secondary: {
@@ -3,17 +3,13 @@ import { graphql } from "gatsby"
3
3
  import Layout from "../components/layout"
4
4
  import Project from "../components/project"
5
5
 
6
- const ProjectTemplates = ({ data: { projectYaml }, location }) => {
6
+ const ProjectTemplates = ({ data: { projectYaml } }) => {
7
7
  const styles = {
8
8
  variant: "styles.Header.secondary",
9
9
  }
10
10
 
11
11
  return (
12
- <Layout
13
- main={{ ...styles, borderBottom: `inherit` }}
14
- header={styles}
15
- location={location}
16
- >
12
+ <Layout main={{ ...styles, borderBottom: `inherit` }} header={styles}>
17
13
  <Project {...projectYaml} />
18
14
  </Layout>
19
15
  )
@@ -32,6 +28,13 @@ export const query = graphql`
32
28
  }
33
29
  }
34
30
  }
31
+ laptop {
32
+ childImageSharp {
33
+ fluid {
34
+ ...GatsbyImageSharpFluid_withWebp_tracedSVG
35
+ }
36
+ }
37
+ }
35
38
  }
36
39
  }
37
40
  `