Skip to content

Commit

Permalink
Updated CodePen & Spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
bntnam committed Apr 25, 2020
1 parent 885076a commit ae3ae2c
Show file tree
Hide file tree
Showing 19 changed files with 285 additions and 64 deletions.
15 changes: 8 additions & 7 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ module.exports = {
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
name: 'bntnam',
short_name: 'bntnam',
start_url: '/',
background_color: '#F19066',
theme_color: '#F19066',
display: 'standalone',
icon: 'src/images/logo.png', // This path is relative to the root of the site.
include_favicon: false,
},
},
`gatsby-plugin-less`,
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
"node-sass": "^4.14.0",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-codepen-embed": "^1.0.1",
"react-dom": "^16.12.0",
"react-helmet": "^6.0.0",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^0.88.2",
"styled-components": "^5.1.0",
"styled-media-query": "^2.1.2",
"styled-system": "^5.1.5",
Expand Down
81 changes: 81 additions & 0 deletions src/components/codepen/CodePen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import React, { useState, useEffect } from "react";
import styled from "styled-components";
import Codepen from "react-codepen-embed";

import { Spinner } from "../../components";
import { media } from "../../utils";

const Container = styled.div`
margin-top: 50px;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-column-gap: 100px;
grid-row-gap: 100px;
${media.lessThan("tablet")`
grid-template-columns: 1fr 1fr;
grid-column-gap: 50px;
grid-row-gap: 50px;
`}
${media.lessThan("mobile")`
grid-template-columns: 1fr;
grid-row-gap: 50px;
`}
`;

export const CodePen = () => {
const [isLoading, setIsLoading] = useState(true);

useEffect(() => {
setTimeout(() => setIsLoading(false), 3000);
}, []);

return (
<Container>
{isLoading && <Spinner />}
<Codepen
hash="ZEbKzPj"
user="bntnam"
title="3Circles"
defaultTab="result"
preview="true"
/>
<Codepen
hash="ZEbKzPj"
user="bntnam"
title="3Circles"
defaultTab="result"
preview="true"
/>
<Codepen
hash="ZEbKzPj"
user="bntnam"
title="3Circles"
defaultTab="result"
preview="true"
/>
<Codepen
hash="ZEbKzPj"
user="bntnam"
title="3Circles"
defaultTab="result"
preview="true"
/>
<Codepen
hash="ZEbKzPj"
user="bntnam"
title="3Circles"
defaultTab="result"
preview="true"
/>
<Codepen
hash="ZEbKzPj"
user="bntnam"
title="3Circles"
defaultTab="result"
preview="true"
/>
</Container>
);
};
1 change: 1 addition & 0 deletions src/components/codepen/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./CodePen";
1 change: 1 addition & 0 deletions src/components/common/Head.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const Head = ({ description, lang, meta, title }) => {
}}
title={title}
titleTemplate={`%s | ${site.siteMetadata.title}`}
link={[{ rel: 'shortcut icon', href: '/logo.ico' }]}
meta={[
{
name: `description`,
Expand Down
58 changes: 40 additions & 18 deletions src/components/gallery/Gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,56 @@ import React from "react";
import styled from "styled-components";

import { Subheading, Text } from "../../utils";
import { Heart } from "../../components";
import { Heart, CodePen } from "../../components";

const Container = styled.div`
background: ${props => props.theme.colors.tolopea};
height: 800px;
background: ${(props) => props.theme.colors.tolopea};
padding: 80px 50px;
display: flex;
flex-direction: column;
align-items: center;
`;

const Box = styled.div`
background: ${props => props.theme.colors.blackcurrant};
background: ${(props) => props.theme.colors.blackcurrant};
height: 60px;
width: 100vw;
position: relative;
`
`;

export const Gallery = () => (
<>
<Box>
<Heart />
</Box>
<Container>
<Subheading>Welcome to my CSS Galary!</Subheading>
<Text pt={"10px"}>The Galary consists of various CSS images from my <a href="https://codepen.io/bntnam" target="_blank">CodePen</a>.</Text>
<Text pt={"5px"}>If you have any idea or feedback, feel free to get in touch at my <a href="mailto:[email protected]" target="_blank">email</a>. :)</Text>
<Text pt={"5px"}>Now, hope you have fun. Cheers! &hearts;</Text>
</Container>
</>
);
export const Gallery = () => {
return (
<>
<Box>
<Heart />
</Box>
<Container>
<Subheading>Welcome to my CSS Galary!</Subheading>
<Text pt={"10px"}>
The Galary consists of various CSS images from my{" "}
<a
href="https://codepen.io/bntnam"
target="_blank"
rel="noopener noreferrer"
>
CodePen
</a>
.
</Text>
<Text pt={"5px"}>
If you have any idea or feedback, feel free to get in touch at my{" "}
<a
href="mailto:[email protected]"
target="_blank"
rel="noopener noreferrer"
>
email
</a>
.
</Text>
<Text pt={"5px"}>Now, hope you have fun. Cheers! &hearts;</Text>
<CodePen />
</Container>
</>
);
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 0 additions & 32 deletions src/components/image.js

This file was deleted.

4 changes: 3 additions & 1 deletion src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ export * from "./common";
export * from "./header";
export * from "./gallery"
export * from "./footer";
export * from "./walking";
export * from "./heart";
export * from "./codepen";
export * from "./spinner";
42 changes: 42 additions & 0 deletions src/components/spinner/Spinner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from "react";
import styled from "styled-components";

const Loading = styled.div`
position: fixed;
width: 100%;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.8);
z-index: 9999;
display: block;
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
:after {
content: "";
display: block;
position: absolute;
left: 48%;
top: 40%;
width: 40px;
height: 40px;
border-style: solid;
border-color: white;
border-top-color: transparent;
border-width: 4px;
border-radius: 50%;
-webkit-animation: spin 0.8s linear infinite;
animation: spin 0.8s linear infinite;
}
`;

export const Spinner = () => <Loading />;
1 change: 1 addition & 0 deletions src/components/spinner/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Spinner";
Binary file removed src/images/gatsby-astronaut.png
Binary file not shown.
Binary file removed src/images/gatsby-icon.png
Binary file not shown.
Binary file added src/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/utils/token/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./media";
export { default as media } from "./media";
export * from "./style";
export * from "./theme";
export * from "./typography";
Binary file added static/logo.ico
Binary file not shown.
Loading

0 comments on commit ae3ae2c

Please sign in to comment.