diff --git a/src/Assets/Images/alien.png b/src/Assets/Images/alien.png deleted file mode 100644 index c516f4d3..00000000 Binary files a/src/Assets/Images/alien.png and /dev/null differ diff --git a/src/Assets/Images/blinky.png b/src/Assets/Images/blinky.png deleted file mode 100644 index 262beb3b..00000000 Binary files a/src/Assets/Images/blinky.png and /dev/null differ diff --git a/src/Assets/Images/burger-min.png b/src/Assets/Images/burger-min.png deleted file mode 100644 index 64882523..00000000 Binary files a/src/Assets/Images/burger-min.png and /dev/null differ diff --git a/src/Assets/Images/candy_1.png b/src/Assets/Images/candy_1.png deleted file mode 100644 index 427e12b7..00000000 Binary files a/src/Assets/Images/candy_1.png and /dev/null differ diff --git a/src/Assets/Images/candy_2.png b/src/Assets/Images/candy_2.png deleted file mode 100644 index 82af4b22..00000000 Binary files a/src/Assets/Images/candy_2.png and /dev/null differ diff --git a/src/Assets/Images/candy_3.png b/src/Assets/Images/candy_3.png deleted file mode 100644 index 29a07bfc..00000000 Binary files a/src/Assets/Images/candy_3.png and /dev/null differ diff --git a/src/Assets/Images/candy_4.png b/src/Assets/Images/candy_4.png deleted file mode 100644 index d3a860c8..00000000 Binary files a/src/Assets/Images/candy_4.png and /dev/null differ diff --git a/src/Assets/Images/candy_5.png b/src/Assets/Images/candy_5.png deleted file mode 100644 index b03193c1..00000000 Binary files a/src/Assets/Images/candy_5.png and /dev/null differ diff --git a/src/Assets/Images/candy_6.png b/src/Assets/Images/candy_6.png deleted file mode 100644 index 205d77bc..00000000 Binary files a/src/Assets/Images/candy_6.png and /dev/null differ diff --git a/src/Assets/Images/ccLogo-min.png b/src/Assets/Images/ccLogo-min.png deleted file mode 100644 index 8620033d..00000000 Binary files a/src/Assets/Images/ccLogo-min.png and /dev/null differ diff --git a/src/Assets/Images/clyde.png b/src/Assets/Images/clyde.png deleted file mode 100644 index b317afcb..00000000 Binary files a/src/Assets/Images/clyde.png and /dev/null differ diff --git a/src/Assets/Images/cpu-min.jpeg b/src/Assets/Images/cpu-min.jpeg deleted file mode 100644 index ce3ac71a..00000000 Binary files a/src/Assets/Images/cpu-min.jpeg and /dev/null differ diff --git a/src/Assets/Images/cupcake_bg.jpg b/src/Assets/Images/cupcake_bg.jpg deleted file mode 100644 index 7f238f42..00000000 Binary files a/src/Assets/Images/cupcake_bg.jpg and /dev/null differ diff --git a/src/Assets/Images/inky.png b/src/Assets/Images/inky.png deleted file mode 100644 index e29ec5f3..00000000 Binary files a/src/Assets/Images/inky.png and /dev/null differ diff --git a/src/Assets/Images/jet.png b/src/Assets/Images/jet.png deleted file mode 100644 index 2cececd4..00000000 Binary files a/src/Assets/Images/jet.png and /dev/null differ diff --git a/src/Assets/Images/keyboard-min.jpeg b/src/Assets/Images/keyboard-min.jpeg deleted file mode 100644 index 5bd06ada..00000000 Binary files a/src/Assets/Images/keyboard-min.jpeg and /dev/null differ diff --git a/src/Assets/Images/logo-min.png b/src/Assets/Images/logo-min.png deleted file mode 100644 index fb297933..00000000 Binary files a/src/Assets/Images/logo-min.png and /dev/null differ diff --git a/src/Assets/Images/mongoose-min.png b/src/Assets/Images/mongoose-min.png deleted file mode 100644 index dacf70f0..00000000 Binary files a/src/Assets/Images/mongoose-min.png and /dev/null differ diff --git a/src/Assets/Images/newLogo.png b/src/Assets/Images/newLogo.png deleted file mode 100644 index c02b64af..00000000 Binary files a/src/Assets/Images/newLogo.png and /dev/null differ diff --git a/src/Assets/Images/pinky.png b/src/Assets/Images/pinky.png deleted file mode 100644 index f737a0a9..00000000 Binary files a/src/Assets/Images/pinky.png and /dev/null differ diff --git a/src/Assets/Images/project-min.jpg b/src/Assets/Images/project-min.jpg deleted file mode 100644 index 747ae334..00000000 Binary files a/src/Assets/Images/project-min.jpg and /dev/null differ diff --git a/src/Assets/Images/project1-min.jpg b/src/Assets/Images/project1-min.jpg deleted file mode 100644 index 7bd5b101..00000000 Binary files a/src/Assets/Images/project1-min.jpg and /dev/null differ diff --git a/src/Assets/Images/projects-min.jpg b/src/Assets/Images/projects-min.jpg deleted file mode 100644 index c8d609f6..00000000 Binary files a/src/Assets/Images/projects-min.jpg and /dev/null differ diff --git a/src/Assets/Images/scared-ghost.png b/src/Assets/Images/scared-ghost.png deleted file mode 100644 index aedac37e..00000000 Binary files a/src/Assets/Images/scared-ghost.png and /dev/null differ diff --git a/src/Components/Games/Pacman/pacman.jsx b/src/Components/Games/Pacman/pacman.jsx index 869c9e42..d8efa801 100644 --- a/src/Components/Games/Pacman/pacman.jsx +++ b/src/Components/Games/Pacman/pacman.jsx @@ -2,13 +2,14 @@ import { Button, Grid, Result } from "../common"; import { layout, legends } from "./resource"; import React, { useEffect, useState } from "react"; import styled from "styled-components"; -import BlinkyImg from "../../../Assets/Images/blinky.png"; -import ClydeImg from "../../../Assets/Images/clyde.png"; -import InkyImg from "../../../Assets/Images/inky.png"; -import PinkyImg from "../../../Assets/Images/pinky.png"; -import GhostImg from "../../../Assets/Images/scared-ghost.png"; import PacmanImg from "../../../Assets/Gif/pacman.gif"; + +const ClydeImg = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/clyde.png"; +const BlinkyImg = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/blinky.png"; +const InkyImg = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/inky.png"; +const PinkyImg = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/pinky.png"; +const GhostImg = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/scared-ghost.png"; const Block = styled.div` display: flex; align-items: center; diff --git a/src/Components/Games/SpaceInvaders/spaceinvaders.jsx b/src/Components/Games/SpaceInvaders/spaceinvaders.jsx index c03d87c4..882ef816 100644 --- a/src/Components/Games/SpaceInvaders/spaceinvaders.jsx +++ b/src/Components/Games/SpaceInvaders/spaceinvaders.jsx @@ -1,11 +1,11 @@ import { Button, Grid, Result } from "../common"; import React, { useEffect, useState } from "react"; import styled, { css } from "styled-components"; -import AlienImage from "../../../Assets/Images/alien.png"; -import Jet from "../../../Assets/Images/jet.png"; import ExplosionGif from "../../../Assets/Gif/explosion.gif"; import Sound from "../../../Assets/Sounds/laser.mp3"; +const Jet = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/jet.png"; +const AlienImage = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/alien.png"; const Shooter = css` background-image: url(${Jet}); background-size: cover; diff --git a/src/Components/Games/SweetCrush/sweetcrush.jsx b/src/Components/Games/SweetCrush/sweetcrush.jsx index 4c304825..d1e172d0 100644 --- a/src/Components/Games/SweetCrush/sweetcrush.jsx +++ b/src/Components/Games/SweetCrush/sweetcrush.jsx @@ -1,15 +1,16 @@ import { Button, Grid } from "../common"; import React, { useEffect, useState } from "react"; -import Candy1 from "../../../Assets/Images/candy_1.png"; -import Candy2 from "../../../Assets/Images/candy_2.png"; -import Candy3 from "../../../Assets/Images/candy_3.png"; -import Candy4 from "../../../Assets/Images/candy_4.png"; -import Candy5 from "../../../Assets/Images/candy_5.png"; -import Candy6 from "../../../Assets/Images/candy_6.png"; -import BgImg from "../../../Assets/Images/cupcake_bg.jpg"; import Confetti from "../../../Assets/Gif/confetti.gif"; import styled, { css, keyframes } from "styled-components"; + +const Candy1 = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/candy_1.png"; +const Candy2 = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/candy_2.png"; +const Candy3 = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/candy_3.png"; +const Candy4 = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/candy_4.png"; +const Candy5 = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/candy_5.png"; +const Candy6 = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/candy_6.png"; +const BgImg = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/cupcake_bg.jpg"; const ShakeAnim = keyframes` 0% { transform: translateX(0px) } 10% { transform: translateX(2px) } diff --git a/src/Components/Loading/ProLoader.jsx b/src/Components/Loading/ProLoader.jsx index 5bd9d4f8..b90ef064 100644 --- a/src/Components/Loading/ProLoader.jsx +++ b/src/Components/Loading/ProLoader.jsx @@ -1,8 +1,8 @@ import React from 'react'; import './ProLoader.css'; -import logo from '../../Assets/Images/newLogo.png'; const ProLoader = () => { + const logo = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/newLogo.png"; return (
diff --git a/src/Components/NavBar/NavBar.jsx b/src/Components/NavBar/NavBar.jsx index 29f24c06..d8fecd61 100755 --- a/src/Components/NavBar/NavBar.jsx +++ b/src/Components/NavBar/NavBar.jsx @@ -1,8 +1,6 @@ import React, {useReducer, useContext, useEffect } from "react"; import axios from "axios"; import "./NavBar.css"; -import burger from '../../Assets/Images/burger-min.png'; -import Logo from '../../Assets/Images/logo-min.png'; import { Link } from "react-router-dom"; import { GlobalState } from '../../GlobalState'; import { StyledHeaderNav } from '../../Layout/Container/styledContainer' @@ -12,6 +10,10 @@ import { useCookies } from "react-cookie"; import { useLocation } from "react-router-dom"; const NavBar = () => { + const Logo = + "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/logo-min.png"; + const burger = + ' const logo = "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/burger-min.png'; const [cookies, setCookie, removeCookie] = useCookies(["cookie-name"]); const location = useLocation(); const currentPath = location.pathname; diff --git a/src/Components/NavBar/SideBar.jsx b/src/Components/NavBar/SideBar.jsx index 6715d2c1..8740c938 100644 --- a/src/Components/NavBar/SideBar.jsx +++ b/src/Components/NavBar/SideBar.jsx @@ -9,13 +9,14 @@ import { ArticleHr } from "../../Layout/Hr/styledHr"; import { HiOutlinePencilAlt } from "react-icons/hi"; import { BsHouseDoor, BsBell, BsBellFill } from "react-icons/bs"; import { MdBookmarkBorder, MdBookmark } from "react-icons/md"; -import logo from "../../Assets/Images/newLogo.png"; import { Link } from "react-router-dom"; import { GlobalState } from "../../GlobalState"; import { useParams } from "react-router-dom"; import axios from "axios"; const SideBar = (props) => { + const logo = + "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/newLogo.png"; const [savedArticleState, setSavedArticleState] = useState( props.user.savedArticles.includes(props.article._id) ); @@ -42,7 +43,7 @@ const SideBar = (props) => { await axios.put(`/api/user/${props.user._id}`, { savedArticles: [props.article._id], }); - setSavedArticleState(!savedArticleState) + setSavedArticleState(!savedArticleState); } }; diff --git a/src/Components/Technologies/Technologies.css b/src/Components/Technologies/Technologies.css index eeb961cf..b879a81e 100755 --- a/src/Components/Technologies/Technologies.css +++ b/src/Components/Technologies/Technologies.css @@ -6,7 +6,7 @@ rgba(119, 119, 119, 0.6), rgba(119, 119, 119, 0.6) ), - url("../../Assets/Images/keyboard-min.jpeg"); + url("https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/keyboard-min.jpeg"); background-size: cover; background-position: top; background-repeat: no-repeat; diff --git a/src/Pages/Articles/Articles.css b/src/Pages/Articles/Articles.css index 2603f332..03193ef3 100755 --- a/src/Pages/Articles/Articles.css +++ b/src/Pages/Articles/Articles.css @@ -114,7 +114,7 @@ rgba(119, 119, 119, 0.6), rgba(119, 119, 119, 0.6) ), - url("../../Assets/Images/project1-min.jpg"); + url("https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/project1-min.jpg"); background-size: cover; background-position: bottom; background-repeat: no-repeat; diff --git a/src/Pages/Auth/login.jsx b/src/Pages/Auth/login.jsx index 3474f5c5..f6d75984 100644 --- a/src/Pages/Auth/login.jsx +++ b/src/Pages/Auth/login.jsx @@ -6,10 +6,11 @@ import { Link } from "react-router-dom"; import { GlobalState } from "../../GlobalState"; import "./auth.css"; -import Logo from "../../Assets/Images/newLogo.png"; import { useCookies } from "react-cookie"; const Login = () => { + const logo = + "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/newLogo.png"; const state = useContext(GlobalState); const [user, setUser] = state.userAPI.user; const [isLoggedIn, setIsLoggedIn] = state.userAPI.isLoggedIn; @@ -19,17 +20,17 @@ const Login = () => { const [rememberMe, setRememberMe] = useState(false); const [cookies, setCookie, removeCookie] = useCookies(["cookie-name"]); - const onChangeInput = e => { + const onChangeInput = (e) => { const { name, value } = e.target; setUser({ ...user, [name]: value }); }; - const loginSubmit = async e => { + const loginSubmit = async (e) => { e.preventDefault(); try { const login = await axios.post("/api/user/login", { ...user, - rememberMe + rememberMe, }); await handleSubmittion(login); } catch (err) { @@ -38,7 +39,7 @@ const Login = () => { } }; - const handleSubmittion = async login => { + const handleSubmittion = async (login) => { try { if (!cookies.accesstoken && login.data) setCookie("accesstoken", login.data.accesstoken); diff --git a/src/Pages/Auth/register.jsx b/src/Pages/Auth/register.jsx index f4e72921..c69aac49 100644 --- a/src/Pages/Auth/register.jsx +++ b/src/Pages/Auth/register.jsx @@ -4,267 +4,262 @@ import axios from "axios"; import { Link } from "react-router-dom"; import "./auth.css"; -import Logo from "../../Assets/Images/newLogo.png"; - const Register = () => { + const logo = + "https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/newLogo.png"; const [showRole, setShowRole] = useState(false); const [secret, setSecret] = useState(""); - const [pass, setPass] = useState(false) - const [initialPress, setInitialPress] = useState(0) + const [pass, setPass] = useState(false); + const [initialPress, setInitialPress] = useState(0); const [user, setUser] = useState({ - name: "", - email: "", - password: "", - role: 0 + name: "", + email: "", + password: "", + role: 0, }); const onChangeInput = (e) => { - const { name, value } = e.target; - setUser({ ...user, [name]: value }); + const { name, value } = e.target; + setUser({ ...user, [name]: value }); + }; + + const validation = (input) => { + let valid = true; + let message = ""; + if (input.name) { + valid = typeof input.name === "string"; + valid = input.name.length >= 3; + message = + "Name only accepts string characters and must be greater than 3"; + } else if (input.password) { + valid = typeof input.password === "string"; + valid = input.password.length >= 6; + message = "Password must be greater than 6 charaters"; + } else if (input.email) { + valid = typeof input === "string"; + let regex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; + valid = input.email.match(regex); + message = "Email only accepts in email format"; + } + return { valid, message }; }; - const validation = (input) => { - let valid = true - let message = "" - if (input.name) { - valid = typeof input.name === 'string' - valid = input.name.length >= 3 - message = "Name only accepts string characters and must be greater than 3" - } else if (input.password) { - valid = typeof input.password === 'string' - valid = input.password.length >= 6 - message = "Password must be greater than 6 charaters" - } else if (input.email) { - valid = typeof input === 'string' - let regex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; - valid = input.email.match(regex) - message = "Email only accepts in email format" - } - return {valid, message} - } + const showPassword = () => { + let password = document.getElementById("password"); + if (pass && initialPress >= 1) { + password.setAttribute("type", "text"); + } else { + password.setAttribute("type", "password"); + } + setPass(!pass); + setInitialPress(initialPress + 1); + }; - const showPassword = () => { - let password = document.getElementById("password") - if (pass && initialPress >= 1) { - password.setAttribute('type', 'text') - } else { - password.setAttribute('type', 'password') - } - setPass(!pass) - setInitialPress(initialPress + 1) - } + const registerSubmit = async (e) => { + e.preventDefault(); + try { + const { valid, message } = validation(user); + if (valid) { + await axios.post("/api/user/register", { ...user }); - const registerSubmit = async (e) => { - e.preventDefault(); - try { - const {valid, message} = validation(user) - if (valid) { - await axios.post("/api/user/register", { ...user }); - - localStorage.setItem("firstLogin", true); - - window.location.href = "/"; - } else { - alert(message) - } - } catch (err) { - alert(err.response.data.msg); - } - }; + localStorage.setItem("firstLogin", true); + + window.location.href = "/"; + } else { + alert(message); + } + } catch (err) { + alert(err.response.data.msg); + } + }; const updateRole = () => { - setShowRole(true); - } + setShowRole(true); + }; - const {name, email, password, role} = user; - return ( - //
- //
- // brand-name - //
- //

Registration

- // - // - // - // - // - // - // { - // showRole === true ? - // <> - // - // setSecret(e.target.value)} - // /> - // - // : - // null - // } - // { - // secret === process.env.REACT_ROLE_SECRET_CODE ? - // <> - // - // - // - // : - // null - // } - //
- // - //
- // Already have an account? Log in here! - //
- //
- //
- //
- //
-
-
-
- - brand-name - -
-
-
-
-

Register

-
-
-
-
- -
-
- -
-
- -
- { - showRole === true ? - <> -
- setSecret(e.target.value)} - /> -
- - : - null - } - { - secret === process.env.REACT_ROLE_SECRET_CODE ? - <> -
- -
- - : - null - } -
- -
-
-
-
- Already have an account? Log in here! -
-
-
-
-
- ); + const { name, email, password, role } = user; + return ( + //
+ //
+ // brand-name + //
+ //

Registration

+ // + // + // + // + // + // + // { + // showRole === true ? + // <> + // + // setSecret(e.target.value)} + // /> + // + // : + // null + // } + // { + // secret === process.env.REACT_ROLE_SECRET_CODE ? + // <> + // + // + // + // : + // null + // } + //
+ // + //
+ // Already have an account? Log in here! + //
+ //
+ //
+ //
+ //
+
+
+
+ + brand-name + +
+
+
+
+

Register

+
+
+
+
+ +
+
+ +
+
+ +
+ {showRole === true ? ( + <> +
+ setSecret(e.target.value)} + /> +
+ + ) : null} + {secret === process.env.REACT_ROLE_SECRET_CODE ? ( + <> +
+ +
+ + ) : null} +
+ +
+
+
+
+ Already have an account? Log in here! +
+
+
+
+
+ ); }; export default Register; diff --git a/src/Pages/Home/Home.css b/src/Pages/Home/Home.css index 0884c22f..70f351c4 100755 --- a/src/Pages/Home/Home.css +++ b/src/Pages/Home/Home.css @@ -26,7 +26,7 @@ rgba(119, 119, 119, 0.6), rgba(119, 119, 119, 0.6) ), - url("../../Assets/Images/cpu-min.jpeg"); + url("https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/cpu-min.jpeg"); background-size: cover; background-position: bottom; background-repeat: no-repeat; @@ -45,7 +45,7 @@ rgba(119, 119, 119, 0.6), rgba(119, 119, 119, 0.6) ), - url("../../Assets/Images/cpu-min.jpeg"); + url("https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/cpu-min.jpeg"); background-position: center; display: flex; flex-direction: column; diff --git a/src/Pages/Projects/Projects.css b/src/Pages/Projects/Projects.css index b33dfe51..ff0ec57e 100755 --- a/src/Pages/Projects/Projects.css +++ b/src/Pages/Projects/Projects.css @@ -4,7 +4,7 @@ rgba(119, 119, 119, 0.6), rgba(119, 119, 119, 0.6) ), - url("../../Assets/Images/project1-min.jpg"); + url("https://hoseacodes-blog.s3.amazonaws.com/Assets/Images/project1-min.jpg"); background-size: cover; background-position: bottom; background-repeat: no-repeat;