From d924f1d86a87b1a217cf07fcd0c400a8db9c20ee Mon Sep 17 00:00:00 2001 From: Kevin Kandlbinder Date: Tue, 22 Dec 2020 10:37:03 +0100 Subject: [PATCH] Add Social Module --- content/socials/unsplash.json | 6 +++++ locales/en/translation.json | 6 ++++- package.json | 2 +- src/pages/social.js | 42 ++++++++++++++++++++++++++++---- src/pages/social.module.scss | 45 +++++++++++++++++++++++++++++++++++ 5 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 content/socials/unsplash.json create mode 100644 src/pages/social.module.scss diff --git a/content/socials/unsplash.json b/content/socials/unsplash.json new file mode 100644 index 0000000..8416f89 --- /dev/null +++ b/content/socials/unsplash.json @@ -0,0 +1,6 @@ +{ + "platformName": "Unsplash", + "platformHandle": "@Unkn0wnCat", + "url": "https://unsplash.com/@unkn0wncat", + "image": "https://source.unsplash.com/user/unkn0wncat/300x300" +} \ No newline at end of file diff --git a/locales/en/translation.json b/locales/en/translation.json index c6db5b4..0335114 100644 --- a/locales/en/translation.json +++ b/locales/en/translation.json @@ -21,5 +21,9 @@ "projectViewGitHub": "View on GitHub", "projectViewWebsite": "View Project-Website", "projectsDescription": "This is what I am working on or have worked on.", - "projectView": "View" + "projectView": "View", + "socialDescriptionWithLink": "Find me on other platforms or <1>visit my friends!", + "socialDescription": "Find me on other platforms!", + "friends": "Friends", + "friendsDescription": "In this list you can find friends of mine and this site. Feel free to check them out for more interesting projects." } \ No newline at end of file diff --git a/package.json b/package.json index ccb929f..ad61a8c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "kevin-k.dev", + "name": "kevink.dev", "version": "1.0.0", "private": true, "description": "KevinK.dev", diff --git a/src/pages/social.js b/src/pages/social.js index 1e6bf6d..a8d845d 100644 --- a/src/pages/social.js +++ b/src/pages/social.js @@ -1,17 +1,51 @@ import React from "react" import Layout from "../layouts/default"; import { Trans, Link, useI18next } from "gatsby-plugin-react-i18next" +import { graphql } from 'gatsby' -export default function SocialPage() { +import styles from "./social.module.scss"; + +export const query = graphql` +query AllSocialsQuery { + allSocialsJson { + nodes { + image + platformHandle + platformName + url + } + } + } +` + +export default function SocialPage({data}) { const {t} = useI18next(); return ( - +
-
+

social

-
+

socialDescriptionWithLink

+ +
+ { + data.allSocialsJson.nodes.map((social) => { + return ( + +
+ {social.platformName} + {social.platformHandle} +
+
+ ); + }) + } +
+ + {/*
{JSON.stringify(data, null, 2)}
*/} +
); diff --git a/src/pages/social.module.scss b/src/pages/social.module.scss new file mode 100644 index 0000000..913db1c --- /dev/null +++ b/src/pages/social.module.scss @@ -0,0 +1,45 @@ +@import "../variables"; + +.socialList { + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +.socialCard { + max-width: 300px; + width: 100%; + border-radius: 5px; + overflow: hidden; + box-shadow: -1px 11px 33px -10px rgba(127,127,127,0.3); + transition: transform .25s; + display: flex; + flex-direction: column; + margin: 20px; + color: white; + text-decoration: none; +} + +.socialImage { + width: 100%; + height: 300px; + background-position: center; + background-size: cover; + display: flex; + padding: 10px; + flex-direction: column-reverse; + text-shadow: 0 0 10px black, 0 0 10px black, 0 0 20px black; +} + +.socialName { + font-size: 2em; + margin-top: -5px; +} + +.socialUsername { + margin-top: auto; +} + +.socialCard:hover, .socialCard:focus { + transform: scale(1.05); +} \ No newline at end of file