diff --git a/README.md b/README.md index 4a4bdae..2a86dee 100644 --- a/README.md +++ b/README.md @@ -1,99 +1,8 @@ - -

- - Gatsby - -

-

- Gatsby's default starter -

+# dawid-wysokinski.pl -Kick off your project with this default boilerplate. This starter ships with the main Gatsby configuration files you might need to get up and running blazing fast with the blazing fast app generator for React. +## How to run locally -_Have another more specific idea? You may want to check out our vibrant collection of [official and community-created starters](https://www.gatsbyjs.org/docs/gatsby-starters/)._ - -## 🚀 Quick start - -1. **Create a Gatsby site.** - - Use the Gatsby CLI to create a new site, specifying the default starter. - - ```shell - # create a new Gatsby site using the default starter - gatsby new my-default-starter https://github.com/gatsbyjs/gatsby-starter-default - ``` - -1. **Start developing.** - - Navigate into your new site’s directory and start it up. - - ```shell - cd my-default-starter/ - gatsby develop - ``` - -1. **Open the source code and start editing!** - - Your site is now running at `http://localhost:8000`! - - _Note: You'll also see a second link: _`http://localhost:8000/___graphql`_. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby tutorial](https://www.gatsbyjs.org/tutorial/part-five/#introducing-graphiql)._ - - Open the `my-default-starter` directory in your code editor of choice and edit `src/pages/index.js`. Save your changes and the browser will update in real time! - -## 🧐 What's inside? - -A quick look at the top-level files and directories you'll see in a Gatsby project. - - . - ├── node_modules - ├── src - ├── .gitignore - ├── .prettierrc - ├── gatsby-browser.js - ├── gatsby-config.js - ├── gatsby-node.js - ├── gatsby-ssr.js - ├── LICENSE - ├── package-lock.json - ├── package.json - └── README.md - -1. **`/node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed. - -2. **`/src`**: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template. `src` is a convention for “source code”. - -3. **`.gitignore`**: This file tells git which files it should not track / not maintain a version history for. - -4. **`.prettierrc`**: This is a configuration file for [Prettier](https://prettier.io/). Prettier is a tool to help keep the formatting of your code consistent. - -5. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://www.gatsbyjs.org/docs/browser-apis/) (if any). These allow customization/extension of default Gatsby settings affecting the browser. - -6. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the [config docs](https://www.gatsbyjs.org/docs/gatsby-config/) for more detail). - -7. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby Node APIs](https://www.gatsbyjs.org/docs/node-apis/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. - -8. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://www.gatsbyjs.org/docs/ssr-apis/) (if any). These allow customization of default Gatsby settings affecting server-side rendering. - -9. **`LICENSE`**: This Gatsby starter is licensed under the 0BSD license. This means that you can see this file as a placeholder and replace it with your own license. - -10. **`package-lock.json`** (See `package.json` below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. **(You won’t change this file directly).** - -11. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project. - -12. **`README.md`**: A text file containing useful reference information about your project. - -## 🎓 Learning Gatsby - -Looking for more guidance? Full documentation for Gatsby lives [on the website](https://www.gatsbyjs.org/). Here are some places to start: - -- **For most developers, we recommend starting with our [in-depth tutorial for creating a site with Gatsby](https://www.gatsbyjs.org/tutorial/).** It starts with zero assumptions about your level of ability and walks through every step of the process. - -- **To dive straight into code samples, head [to our documentation](https://www.gatsbyjs.org/docs/).** In particular, check out the _Guides_, _API Reference_, and _Advanced Tutorials_ sections in the sidebar. - -## 💫 Deploy - -[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/gatsbyjs/gatsby-starter-default) - -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/gatsbyjs/gatsby-starter-default) - - +1. Clone repo. +2. Navigate to the right directory. +3. yarn install +4. yarn develop diff --git a/package.json b/package.json index 594522a..f59be2e 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "babel-plugin-transform-imports": "^2.0.0", "classnames": "^2.2.6", "gatsby": "^2.23.12", + "gatsby-background-image": "^1.1.1", "gatsby-image": "^2.4.9", "gatsby-plugin-manifest": "^2.4.14", "gatsby-plugin-offline": "^3.2.13", diff --git a/src/components/Layout/Navbar.js b/src/components/Layout/Navbar.js index 8fa25b0..923f4b8 100644 --- a/src/components/Layout/Navbar.js +++ b/src/components/Layout/Navbar.js @@ -1,7 +1,11 @@ import React, { useState } from "react" import classnames from "classnames" import * as routes from "@config/routes" +import useSmoothScroll from "@libs/useSmoothScroll" import logo from "@images/logo.svg" +import { HEADER_ID } from "@features/HomePage/components/Header" +import { SECTION_ID as PROJECTS_SECTION_ID } from "@features/HomePage/components/Projects/Projects" +import { SECTION_ID as CONTACT_SECTION_ID } from "@features/HomePage/components/Contact" import { makeStyles } from "@material-ui/core/styles" import { @@ -11,9 +15,10 @@ import { Hidden, Menu, MenuItem, + Link, } from "@material-ui/core" import { Menu as MenuIcon } from "@material-ui/icons" -import { Link, IconButton } from "gatsby-theme-material-ui" +import { Link as GatsbyLink, IconButton } from "gatsby-theme-material-ui" const useStyles = makeStyles(theme => ({ appBar: { @@ -55,6 +60,7 @@ const useStyles = makeStyles(theme => ({ function Navbar({ className, ...rest }) { const [anchorEl, setAnchorEl] = useState(null) const classes = useStyles() + const handleLinkClick = useSmoothScroll() const open = Boolean(anchorEl) const handleMenuOpen = event => { @@ -75,19 +81,37 @@ function Navbar({ className, ...rest }) {
- + logo - +
- - Strona główna + + Start - + Projekty + + Kontakt + - Strona główna + Start @@ -130,11 +155,24 @@ function Navbar({ className, ...rest }) { color="inherit" underline="none" className={classes.link} - to={routes.PROJECTS} + href={"#" + PROJECTS_SECTION_ID} + onClick={handleLinkClick(PROJECTS_SECTION_ID)} > Projekty + + + Kontakt + +
diff --git a/src/components/Section.js b/src/components/Section.js index 97bca61..8574833 100644 --- a/src/components/Section.js +++ b/src/components/Section.js @@ -34,7 +34,7 @@ export const SIZE = { MEDIUM: "medium", } -function Section({ children, className, bgColor, component, size }) { +function Section({ children, className, bgColor, component, size, ...rest }) { const classes = useStyles() const Component = component || "section" return ( @@ -44,6 +44,7 @@ function Section({ children, className, bgColor, component, size }) { "is-black": bgColor === BG_COLOR.BLACK, "is-small": size === SIZE.SMALL, })} + {...rest} > {children} diff --git a/src/config/routes.js b/src/config/routes.js index a7a8317..b75c8cb 100644 --- a/src/config/routes.js +++ b/src/config/routes.js @@ -1,2 +1 @@ export const HOME = "/" -export const PROJECTS = "/" diff --git a/src/features/HomePage/components/Contact.js b/src/features/HomePage/components/Contact.js index 59a23ac..6a9c504 100644 --- a/src/features/HomePage/components/Contact.js +++ b/src/features/HomePage/components/Contact.js @@ -11,13 +11,9 @@ import Section from "@components/Section" const useStyles = makeStyles(theme => { return { - container: { - textAlign: "center", - }, typography: { display: "flex", alignItems: "center", - justifyContent: "center", wordBreak: "break-all", "& > *:not(:last-child)": { marginRight: theme.spacing(1), @@ -31,6 +27,8 @@ const useStyles = makeStyles(theme => { } }) +export const SECTION_ID = "contact" + function Contact() { const classes = useStyles() @@ -40,13 +38,15 @@ function Contact() { } return ( -
- +
+ - - Kontakt + + + Kontakt + - +
diff --git a/src/features/HomePage/components/Header.js b/src/features/HomePage/components/Header.js index e8a8e14..fc82b80 100644 --- a/src/features/HomePage/components/Header.js +++ b/src/features/HomePage/components/Header.js @@ -1,7 +1,9 @@ import React from "react" +import useSmoothScroll from "@libs/useSmoothScroll" +import { SECTION_ID } from "./Contact" import { makeStyles } from "@material-ui/core/styles" -import { Container, Typography, Button } from "@material-ui/core" +import { Container, Typography, Button, Link } from "@material-ui/core" import bg from "./header-bg.jpg" const useStyles = makeStyles(theme => ({ @@ -35,10 +37,13 @@ const useStyles = makeStyles(theme => ({ }, })) +export const HEADER_ID = "start" + function Header() { const classes = useStyles() + const handleLinkClick = useSmoothScroll() return ( -
+
@@ -52,9 +57,15 @@ function Header() { Masz projekt, pomysł lub problem, który chcesz ze mną omówić?
- + + +
diff --git a/src/features/HomePage/components/Projects/Project.js b/src/features/HomePage/components/Projects/Project.js index d9674f0..b07098d 100644 --- a/src/features/HomePage/components/Projects/Project.js +++ b/src/features/HomePage/components/Projects/Project.js @@ -13,6 +13,7 @@ import { Chip, Link, } from "@material-ui/core" +import BackgroundImage from "gatsby-background-image" const useStyles = makeStyles(theme => ({ card: { @@ -79,6 +80,7 @@ function Project({ github, live, img, + fluid, }) { const classes = useStyles() return ( @@ -87,7 +89,15 @@ function Project({ reverse, })} > - + {fluid ? ( + + ) : ( + + )}
diff --git a/src/features/HomePage/components/Projects/Projects.js b/src/features/HomePage/components/Projects/Projects.js index 49f3a8d..c4bc273 100644 --- a/src/features/HomePage/components/Projects/Projects.js +++ b/src/features/HomePage/components/Projects/Projects.js @@ -1,4 +1,5 @@ import React from "react" +import { useStaticQuery, graphql } from "gatsby" import { makeStyles } from "@material-ui/core/styles" import { Typography, Container } from "@material-ui/core" @@ -24,20 +25,56 @@ const useStyles = makeStyles(theme => ({ }, })) +export const SECTION_ID = "projects" + function Projects() { const classes = useStyles() + const data = useStaticQuery(graphql` + { + allCoverImages: allFile( + filter: { absolutePath: { regex: "/projects/" } } + ) { + edges { + node { + relativePath + childImageSharp { + id + fluid(maxWidth: 1000) { + ...GatsbyImageSharpFluid + } + } + } + } + } + } + `) return ( -
+
Projekty
{projects.map((project, index) => { + let fluid = undefined + if (project.fluid) { + const edge = data.allCoverImages.edges.find( + img => img.node.relativePath === project.fluid + ) + if (edge) { + fluid = edge.node.childImageSharp.fluid + } + } + return ( ) @@ -85,6 +122,7 @@ const projects = [ "React Native", ], github: "", + fluid: "projects/zdam.png", live: "https://zdamegzaminzawodowy.pl/", }, { @@ -93,6 +131,7 @@ const projects = [ technologies: ["React", "Next.JS", "Bulma", "Ghost"], github: "https://github.com/Kichiyaki/matura-z-informatyki.pl", live: "https://matura-z-informatyki.pl/", + fluid: "projects/maturazinf.png", }, { title: "dawid-wysokinski.pl", @@ -100,12 +139,28 @@ const projects = [ technologies: ["React", "Gatsby", "Material-UI"], github: "https://github.com/Kichiyaki/dawid-wysokinski.pl", live: "https://dawid-wysokinski.pl", + fluid: "projects/dw.png", }, { title: "tribalbooster.pl", description: "", technologies: ["React", "Gatsby", "Material-UI"], live: "http://tribalbooster.pl/", + fluid: "projects/tribalbooster.png", + }, + { + title: "OLX Crawler", + description: + "Program służący do automatycznego przeglądania ogłoszeń na portalu olx.", + technologies: [ + "React", + "Material-UI", + "Golang", + "Colly", + "SQLite3", + "Echo", + ], + github: "https://github.com/Kichiyaki/olx-crawler", }, { title: "Instaling.pl Bot", @@ -125,12 +180,14 @@ const projects = [ description: "", technologies: ["HTML", "CSS", "Bootstrap"], live: "https://dawid-wysokinski.pl/podglad/akademia/", + fluid: "projects/amz.png", }, { title: "Freshline", description: "", technologies: ["Wordpress", "CSS", "Bootstrap"], live: "http://fresh-line.pl/", + fluid: "projects/freshline.png", }, ] diff --git a/src/images/projects/amz.png b/src/images/projects/amz.png new file mode 100644 index 0000000..6aab0ae Binary files /dev/null and b/src/images/projects/amz.png differ diff --git a/src/images/projects/dw.png b/src/images/projects/dw.png new file mode 100644 index 0000000..00e0e33 Binary files /dev/null and b/src/images/projects/dw.png differ diff --git a/src/images/projects/freshline.png b/src/images/projects/freshline.png new file mode 100644 index 0000000..7ae283c Binary files /dev/null and b/src/images/projects/freshline.png differ diff --git a/src/images/projects/maturazinf.png b/src/images/projects/maturazinf.png new file mode 100644 index 0000000..c4e6873 Binary files /dev/null and b/src/images/projects/maturazinf.png differ diff --git a/src/images/projects/tribalbooster.png b/src/images/projects/tribalbooster.png new file mode 100644 index 0000000..9fdd2d6 Binary files /dev/null and b/src/images/projects/tribalbooster.png differ diff --git a/src/images/projects/zdam.png b/src/images/projects/zdam.png new file mode 100644 index 0000000..9aff205 Binary files /dev/null and b/src/images/projects/zdam.png differ diff --git a/src/libs/useSmoothScroll.js b/src/libs/useSmoothScroll.js new file mode 100644 index 0000000..5c6ddb0 --- /dev/null +++ b/src/libs/useSmoothScroll.js @@ -0,0 +1,14 @@ +import isSmoothScrollSupported from "@utils/isSmoothScrollSupported" + +export default () => { + return id => e => { + if (isSmoothScrollSupported()) { + e.preventDefault() + document.querySelector("#" + id).scrollIntoView({ + behavior: "smooth", + block: "start", + inline: "nearest", + }) + } + } +} diff --git a/src/pages/404.js b/src/pages/404.js index a1c5962..b689ae9 100644 --- a/src/pages/404.js +++ b/src/pages/404.js @@ -23,7 +23,7 @@ const NotFoundPage = ({ location }) => { const classes = useStyles() return ( - + "scrollBehavior" in document.documentElement.style diff --git a/yarn.lock b/yarn.lock index 4437329..c6eb8c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -939,7 +939,7 @@ core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.7": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.10.4.tgz#a6724f1a6b8d2f6ea5236dbfe58c7d7ea9c5eb99" integrity sha512-UpTN5yUJr9b4EX2CnGNWIvER7Ab83ibv0pcvvHc4UOdrBI5jb8bj+32cCwPX6xu0mt2daFNjYhoi+X7beH0RSw== @@ -5696,6 +5696,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +filter-invalid-dom-props@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/filter-invalid-dom-props/-/filter-invalid-dom-props-2.0.0.tgz#527f1494cb3c4f282a73c43804153eb80c42dc2c" + integrity sha1-Un8UlMs8Tygqc8Q4BBU+uAxC3Cw= + dependencies: + html-attributes "1.1.0" + finalhandler@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" @@ -5935,6 +5942,17 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +gatsby-background-image@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/gatsby-background-image/-/gatsby-background-image-1.1.1.tgz#491ae4966fe573d67d34bb04f765b51bbf5f74ed" + integrity sha512-W56ETGF6zz35JlXZPmRq0HWuuYQ2wFFDC/DDHyRWuZ/uRSwpg9ZTOHiTW9EQI5Si9FSfD8U5ePnW+do/ToZPtA== + dependencies: + "@babel/runtime" "^7.9.2" + filter-invalid-dom-props "^2.0.0" + global "^4.4.0" + short-uuid "^3.1.1" + sort-media-queries "^0.2.2" + gatsby-cli@^2.12.52: version "2.12.52" resolved "https://registry.yarnpkg.com/gatsby-cli/-/gatsby-cli-2.12.52.tgz#127a8e6cf0802289ad3a233c52ca8aa23c0dc73b" @@ -6644,7 +6662,7 @@ global-prefix@^1.0.1: is-windows "^1.0.1" which "^1.2.14" -global@^4.3.0: +global@^4.3.0, global@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== @@ -7142,6 +7160,11 @@ hsla-regex@^1.0.0: resolved "https://registry.yarnpkg.com/hsla-regex/-/hsla-regex-1.0.0.tgz#c1ce7a3168c8c6614033a4b5f7877f3b225f9c38" integrity sha1-wc56MWjIxmFAM6S194d/OyJfnDg= +html-attributes@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/html-attributes/-/html-attributes-1.1.0.tgz#82027a4fac7a6070ea6c18cc3886aea18d6dea09" + integrity sha1-ggJ6T6x6YHDqbBjMOIauoY1t6gk= + html-comment-regex@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7" @@ -12087,6 +12110,14 @@ shell-quote@1.6.1: array-reduce "~0.0.0" jsonify "~0.0.0" +short-uuid@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/short-uuid/-/short-uuid-3.1.1.tgz#3ff427074b5fa7822c3793994d18a7a82e2f73a4" + integrity sha512-7dI69xtJYpTIbg44R6JSgrbDtZFuZ9vAwwmnF/L0PinykbFrhQ7V8omKsQcVw1TP0nYJ7uQp1PN6/aVMkzQFGQ== + dependencies: + any-base "^1.1.0" + uuid "^3.3.2" + side-channel@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" @@ -12322,6 +12353,13 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" +sort-media-queries@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/sort-media-queries/-/sort-media-queries-0.2.2.tgz#fddfc1e70d662759091b6a23776f4488683dca1e" + integrity sha1-/d/B5w1mJ1kJG2ojd29EiGg9yh4= + dependencies: + xtend "^4.0.0" + source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"