├── public ├── favicon.png ├── index.html └── play.svg ├── src ├── About.js ├── index.js ├── Transitions.css ├── Home.js ├── Home.css ├── VkLogo.js ├── App.js ├── Contact.js ├── App.css └── Contact.css ├── .gitignore ├── package.json └── README.md /public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiftoo/PersonalPage/master/public/favicon.png -------------------------------------------------------------------------------- /src/About.js: -------------------------------------------------------------------------------- 1 | import React, { PureComponent } from "react"; 2 | 3 | export default class About extends PureComponent { 4 | render() { 5 | return
about
; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import App from "./App"; 4 | 5 | ReactDOM.render( 6 | 7 | 8 | , 9 | document.getElementById("root") 10 | ); 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /src/Transitions.css: -------------------------------------------------------------------------------- 1 | .fade-in { 2 | animation: slide 250ms, fade-in 250ms; 3 | } 4 | .fade-out { 5 | animation: fade-in 250ms; 6 | animation-direction: reverse; 7 | animation-fill-mode: forwards; 8 | } 9 | 10 | @keyframes fade-in { 11 | from { 12 | opacity: 0; 13 | } 14 | to { 15 | opacity: 1; 16 | } 17 | } 18 | 19 | @keyframes slide { 20 | from { 21 | transform: translateX(-1vw); 22 | } 23 | to { 24 | transform: translateX(0); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 0x666c 15 | 16 | 17 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /public/play.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Home.js: -------------------------------------------------------------------------------- 1 | import React, {PureComponent} from "react"; 2 | import {Link} from "react-router-dom"; 3 | import "./Home.css"; 4 | 5 | export default class Home extends PureComponent { 6 | render() { 7 | return ( 8 |
9 |
10 |

Lorem Ipsum

11 |

12 | 11 dolor sit amet, consectetur adipiscing elit. Curabitur nec blandit leo. Praesent malesuada neque fringilla lacus varius, at dignissim mauris efficitur. 13 | Etiam et eros quis nisl finibus pellentesque. Proin a magna sollicitudin, consequat sem id, maximus ante. Suspendisse ultrices massa in finibus viverra. 14 | Fusce sit amet congue turpis. 15 |

16 |
17 | 18 |
19 |
20 |
21 | learn more 22 |
23 |
24 |
Learn more!
25 |
26 | 27 |
28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "forum", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^4.2.4", 7 | "@testing-library/react": "^9.5.0", 8 | "@testing-library/user-event": "^7.2.1", 9 | "autosize": "^4.0.2", 10 | "history": "^5.0.0", 11 | "install": "^0.13.0", 12 | "npm": "^6.14.8", 13 | "react": "^16.13.1", 14 | "react-dom": "^16.13.1", 15 | "react-icons": "^3.11.0", 16 | "react-router-dom": "^5.2.0", 17 | "react-scripts": "3.4.3" 18 | }, 19 | "scripts": { 20 | "predeploy": "npm run build", 21 | "deploy": "gh-pages -d build", 22 | "start": "react-scripts start", 23 | "build": "react-scripts build", 24 | "test": "react-scripts test", 25 | "eject": "react-scripts eject" 26 | }, 27 | "eslintConfig": { 28 | "extends": "react-app" 29 | }, 30 | "browserslist": { 31 | "production": [ 32 | ">0.2%", 33 | "not dead", 34 | "not op_mini all" 35 | ], 36 | "development": [ 37 | "last 1 chrome version", 38 | "last 1 firefox version", 39 | "last 1 safari version" 40 | ] 41 | }, 42 | "devDependencies": { 43 | "@svgr/webpack": "^5.4.0", 44 | "gh-pages": "^3.1.0" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Home.css: -------------------------------------------------------------------------------- 1 | .home-container { 2 | margin-top: 7vh; 3 | margin-left: 16vw; 4 | width: 35vw; 5 | } 6 | 7 | .learn-more { 8 | display: flex; 9 | flex-direction: row; 10 | cursor: initial; 11 | font-size: 18px; 12 | font-weight: bold; 13 | margin-top: 30px; 14 | letter-spacing: 0.5px; 15 | margin-left: 0.25vw; 16 | } 17 | 18 | .play-o { 19 | cursor: pointer; 20 | border-radius: 50%; 21 | background: var(--gradient); 22 | width: 56px; 23 | height: 56px; 24 | margin-right: 15px; 25 | transition: margin-right 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94); 26 | } 27 | .play-o:hover { 28 | transition: margin-right 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94); 29 | margin-right: 20px; 30 | } 31 | .play-o:hover > .play-i > .play-svg { 32 | transform: translateY(1px); 33 | } 34 | 35 | .play-i { 36 | position: relative; 37 | border-radius: 50%; 38 | margin: 4px; 39 | width: 48px; 40 | height: 48px; 41 | background-color: var(--background); 42 | box-shadow: 0 0 10px 2px transparent; 43 | 44 | display: flex; 45 | } 46 | .play-o:hover > .play-i { 47 | box-shadow: 0 0 12px 1px #ff6600; 48 | } 49 | .play-svg { 50 | display: block; 51 | margin: auto; 52 | width: 26px; 53 | height: 26px; 54 | 55 | position: relative; 56 | left: 3px; 57 | } 58 | 59 | .learn-more > .label { 60 | margin-block: auto; 61 | } 62 | 63 | @media only screen and (max-width: 560px) { 64 | .home-container { 65 | padding-left: 4vw; 66 | padding-right: 4vw; 67 | margin-left: 0; 68 | margin-right: 0; 69 | width: auto; 70 | flex-flow: column; 71 | margin-left: 0; 72 | text-align: center; 73 | } 74 | .learn-more { 75 | margin-top: 20px; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `npm start` 8 | 9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console. 14 | 15 | ### `npm test` 16 | 17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `npm run build` 21 | 22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `npm run eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `npm run build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /src/VkLogo.js: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | function SvgVk(props) { 4 | return ( 5 | 6 | 10 | 11 | ); 12 | } 13 | 14 | export default SvgVk; 15 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { PureComponent } from "react"; 2 | import { DiGithubAlt } from "react-icons/di"; 3 | import { ImFacebook, ImTwitter } from "react-icons/im"; 4 | import { HashRouter, Link, Redirect, Route, Switch } from "react-router-dom"; 5 | import About from "./About"; 6 | import "./App.css"; 7 | import Contact from "./Contact"; 8 | import Home from "./Home"; 9 | import "./Transitions.css"; 10 | import VkLogo from "./VkLogo"; 11 | 12 | export default class App extends PureComponent { 13 | constructor() { 14 | super(); 15 | 16 | this.iconSize = "27px"; 17 | this.shareIcons = [ 18 | {el: DiGithubAlt, link: "https://github.com/jiftoo/"}, 19 | {el: ImTwitter, link: "https://github.com/jiftoo/"}, 20 | {el: VkLogo, link: "https://github.com/jiftoo/"}, 21 | {el: ImFacebook, link: "https://github.com/jiftoo/"}, 22 | ]; 23 | 24 | this.animationTimeout = -1; 25 | 26 | this.state = { 27 | white: false, 28 | pageIndex: 0, 29 | links: this.shareIcons.map((icon, i) => ( 30 | { 32 | this.setWhiteActive(ev.target, true); 33 | this.animationTimeout = setTimeout(() => this.setWhiteActive(null, false), 4000); 34 | }} 35 | href={icon.link} 36 | key={i} 37 | > 38 | {React.createElement(icon.el, {size: this.iconSize})} 39 | 40 | )), 41 | }; 42 | 43 | this.unloadHandler = this.unloadHandler.bind(this); 44 | } 45 | 46 | // Clear the animation on unload, after the user presses the back button after going to one of the social links 47 | unloadHandler(event) { 48 | clearTimeout(this.animationTimeout); 49 | this.setWhiteActive(null, false); 50 | } 51 | componentDidMount() { 52 | window.addEventListener("unload", this.unloadHandler); 53 | } 54 | componentWillUnmount() { 55 | window.removeEventListener("unload", this.unloadHandler); 56 | } 57 | 58 | setWhiteActive(target, bool) { 59 | if (bool) { 60 | target.classList.add("share-container-expand"); 61 | document.getElementById("not-buttons").classList.add("fade-out"); 62 | } else { 63 | document.querySelectorAll(".fade-out, .share-container-expand").forEach((el) => el.classList.remove("fade-out", "share-container-expand")); 64 | } 65 | } 66 | 67 | setLocation(pageIndex) { 68 | this.setState({pageIndex}); 69 | } 70 | 71 | render() { 72 | return ( 73 | 74 |
75 | 97 |
98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 |
113 |
114 |
115 |
{this.state.links}
116 |
117 |
118 | ); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/Contact.js: -------------------------------------------------------------------------------- 1 | import autosize from "autosize"; 2 | import React, {Component} from "react"; 3 | import "./Contact.css"; 4 | 5 | export default class Contact extends Component { 6 | constructor() { 7 | super(); 8 | 9 | this.state = { 10 | email: "", 11 | question: "", 12 | 13 | selected: -1, 14 | 15 | emailError: "", 16 | questionError: "", 17 | showErrors: false, 18 | 19 | submitted: false, 20 | }; 21 | 22 | // I'll leave this in since it's actually good :o 23 | const generateAlphabetic = (name, minCharacters) => { 24 | const pattern = `[a-zA-Z ]{${minCharacters + 1},}`; 25 | return {[name]: {pattern: new RegExp(pattern), error: `${name[0].toUpperCase() + name.slice(1)} must be at least ${minCharacters} alphabetic characters`}}; 26 | }; 27 | const generateCustom = (name, pattern, example) => { 28 | if (!new RegExp(pattern).test(example)) throw new Error("Bro your exaple doesnt match the pattern wtf?"); 29 | return {[name]: {pattern: new RegExp(pattern), error: `${name[0].toUpperCase() + name.slice(1)} must look like ${example}`}}; 30 | }; 31 | const EMAIL_REGEX = /\S+@\S+\.\S+/; 32 | this.validationInfo = {...generateCustom("email", EMAIL_REGEX, "'email@example.com'"), ...generateAlphabetic("question", 5)}; 33 | 34 | this.validate = this.validate.bind(this); 35 | this.submit = this.submit.bind(this); 36 | } 37 | 38 | validate(ev) { 39 | ev && ev.preventDefault(); 40 | 41 | const [emailInfo, questionInfo] = [this.validationInfo.email, this.validationInfo.question]; 42 | const {email, question} = this.state; 43 | 44 | let emailError = ""; 45 | let questionError = ""; 46 | if (!emailInfo.pattern.test(email)) { 47 | emailError = emailInfo.error; 48 | } 49 | if (!questionInfo.pattern.test(question)) { 50 | questionError = questionInfo.error; 51 | } 52 | 53 | this.setState({emailError, questionError}); 54 | } 55 | 56 | submit(ev) { 57 | ev.preventDefault(); 58 | 59 | this.setState({showErrors: true}); 60 | 61 | if (this.state.emailError.length === 0 && this.state.questionError.length === 0) { 62 | // Submit 63 | // Fake a request 64 | setTimeout(() => this.setState({submitted: true}), 300); 65 | } 66 | } 67 | 68 | componentDidMount() { 69 | // Call validate once to fill in the error messages 70 | this.validate(); 71 | } 72 | 73 | render() { 74 | return ( 75 |
76 |
77 |

Contact

78 |
Please fill out the form to send me an contact e-mail. I will reach out to you as soon as possible!
79 |
80 |
81 |
82 | { 85 | ev.persist(); 86 | this.setState({email: ev.target.value}, () => this.validate(ev)); 87 | }} 88 | type="email" 89 | className="email" 90 | placeholder="Your e-mail address" 91 | /> 92 | {this.state.showErrors && this.state.emailError &&
{this.state.emailError}
} 93 |
94 |
95 |