Skip to content

Commit f26c37c

Browse files
committed
added mail support and timeline
1 parent 523ab82 commit f26c37c

File tree

15 files changed

+425
-27
lines changed

15 files changed

+425
-27
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
"@testing-library/user-event": "^12.8.3",
1414
"autoprefixer": "^9.8.6",
1515
"gh-pages": "^3.2.0",
16+
"gsap": "^3.6.1",
1617
"next": "^10.2.0",
1718
"next-seo": "^4.24.0",
1819
"next-sitemap": "^1.6.57",
1920
"next-themes": "0.0.14",
2021
"postcss": "^7.0.35",
2122
"react": "^17.0.2",
2223
"react-dom": "^17.0.2",
23-
"react-ga": "^3.3.0",
2424
"react-motion": "^0.5.2",
2525
"react-pdf": "^5.3.0",
2626
"react-scripts": "4.0.3",

public/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,13 @@
2020
<div id="root"></div>
2121
</body>
2222
<script src="https://unpkg.com/[email protected]/dist/ionicons.js"></script>
23+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7NQQVYC6KN"></script>
24+
<script>
25+
window.dataLayer = window.dataLayer || [];
26+
function gtag(){dataLayer.push(arguments);}
27+
gtag('js', new Date());
28+
29+
gtag('config', 'G-7NQQVYC6KN');
30+
</script>
2331

2432
</html>

src/App.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,14 @@ import DefaultContextMenu from "./Components/DefaultContextMenu";
1010
import { Document, Page } from 'react-pdf/dist/esm/entry.webpack';
1111
import Profile from "./Components/Profile";
1212
import 'react-pdf/dist/esm/Page/AnnotationLayer.css';
13-
import ReactGA from 'react-ga';
1413
import Terminal from "./Components/Terminal";
1514
import ChangeBackground from "./Components/ChangeBackground";
1615
import Dock from "./Components/Dock";
1716
import HDD from "./Assets/hdd.png";
1817
import SpotLight from "./Components/Spotlight";
1918
import Folder from "./Assets/folder.png";
20-
2119
import Head from 'next/head';
22-
ReactGA.initialize('G-7NQQVYC6KN');
23-
ReactGA.pageview(window.location.pathname + window.location.search);
24-
25-
26-
20+
import Mail from "./Components/Mail";
2721

2822

2923

@@ -58,6 +52,8 @@ const Component = () => {
5852
return <Terminal/>
5953
case 'CHANGE_BACKGROUND':
6054
return <ChangeBackground/>
55+
case 'MAIL':
56+
return <Mail />
6157
default:
6258
return <div>Some Content</div>
6359
}
@@ -124,9 +120,6 @@ const Stacks = () => {
124120

125121
const App = () => {
126122

127-
128-
129-
130123
return (
131124
<Store>
132125
<ThemeProvider attribute="class">

src/Assets/clock.png

14.5 KB
Loading

src/Assets/send.png

7.43 KB
Loading

src/Components/DefaultContextMenu.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from 'react';
22
import { Context } from "../store";
3-
const DefaultContextMenu = () => {
3+
import { useTheme } from 'next-themes';
44

5+
const DefaultContextMenu = () => {
6+
const { theme, setTheme } = useTheme();
57
const [ store, dispatch ] = React.useContext(Context);
68
return (
79
<div className="relative h-auto w-auto flex flex-col rounded-lg p-2 ring-1 ring-gray-600 ring-inset" style={{minWidth :"13rem", zIndex : 10 , backgroundColor : "rgb(34, 35, 54, 0.3)"}}>
@@ -13,6 +15,9 @@ const DefaultContextMenu = () => {
1315
<div
1416
onClick={() => dispatch({ type: "NEW_WINDOW", payload: { id: 'CHANGE_BACKGROUND', header: true, title : "change background image" } })}
1517
className="text-xs text-white pl-5 pt-1 pb-0.5 rounded-sm hover:bg-blue-500 mb-1 cursor-pointer">Change Desktop Background</div>
18+
<div
19+
onClick={() => setTheme( theme === 'dark' ? 'light' : 'dark') }
20+
className="text-xs text-white pl-5 pt-1 pb-0.5 rounded-sm hover:bg-blue-500 mb-1 cursor-pointer">Change Theme</div>
1621
<hr className="border border-gray-300 ml-2 mr-2 opacity-50" />
1722
<div className="text-xs text-gray-300 pl-5 pt-1 mt-1 rounded-sm hover:bg-blue-500 mb-1 cursor-not-allowed">✓ Use Stacks</div>
1823
</div>

src/Components/Dock.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,23 @@ const Dock = () => {
1212
const [ store, dispatch] = React.useContext(Context);
1313
const [name, setName] = React.useState('');
1414

15+
const getName = () => {
16+
if ( window === 'TERMINAL' ) {
17+
return 'Terminal';
18+
}
19+
if ( window === 'MAIL') {
20+
return 'Mail';
21+
}
22+
return 'Hello';
23+
}
24+
1525
React.useEffect(() => {
1626
var timeo;
1727
if ( clicked ){
1828
timeo = setTimeout(() => {
1929
setClick(false);
2030
if ( window){
21-
dispatch({ type: "NEW_WINDOW", payload: { id: window, header: true, title: (window === 'TERMINAL' ? 'Terminal' : 'Hello') } })
31+
dispatch({ type: "NEW_WINDOW", payload: { id: window, header: true, title: getName() } })
2232
}
2333
}, 1500);
2434

@@ -37,7 +47,7 @@ const Dock = () => {
3747
}}
3848
className={"h-16 w-16 " + (clicked && name === 'launchpad' ? "animate-bounce" : "")}></img>
3949
<img src={Mail} onClick={() => {
40-
setClick(true); setWindow(null); setName('mail');
50+
setClick(true); setWindow('MAIL'); setName('mail');
4151
}}
4252
className={"h-14 w-14 mt-1 " + (clicked && name === 'mail' ? "animate-bounce" : "")}></img>
4353
<img src={Terminal} onClick={() => {

src/Components/Mail.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React from "react";
2+
import Send from "../Assets/send.png";
3+
4+
5+
const Mail = (props) => {
6+
var context = props.context;
7+
8+
if (window.screen.width < 600) {
9+
context = {
10+
height: "30rem",
11+
width: window.screen.width - 100
12+
}
13+
}
14+
15+
const [ cc, setCc ] = React.useState('');
16+
const [ subject , setSubject ] = React.useState('');
17+
const [ from , setFrom ] = React.useState('');
18+
const [ body , setBody ] = React.useState('');
19+
20+
return (
21+
<div className="flex relative bg-white dark:bg-gray-900 rounded-b-xl" style={{ height: context.height, width: context.width, minHeight: "30rem" }}>
22+
<div className="flex flex-col mx-1 h-full w-full">
23+
<div className="h-10 w-full p-1" style={{backgroundColor :"rgb(56,59,65)"}}>
24+
<a href={`mailto:[email protected]?subject=${encodeURI(subject)}&cc=${cc}&body=${encodeURI(body)}`}>
25+
<img
26+
className="ml-3 cursor-pointer" src={Send}></img></a>
27+
</div>
28+
<div className="flex flex-row w-full mt-3 ml-3">
29+
<div className="text-xs mr-5 dark:text-gray-400 text-gray-800">To:</div>
30+
<div className="text-xs mr-5 dark:text-white text-gray-900">[email protected]</div>
31+
</div>
32+
<div className="border dark:border-gray-800 border-gray-800 border-b-1 my-3"></div>
33+
<div className="flex flex-row w-full mt-1 ml-3">
34+
<div className="text-xs mr-5 dark:text-gray-400 text-gray-800">Cc:</div>
35+
<input value={cc} onChange={(e) => setCc(e.target.value)}
36+
className="text-xs mr-5 dark:text-white w-full text-gray-900 bg-transparent outline-none"></input>
37+
</div>
38+
<div className="border dark:border-gray-800 border-gray-800 border-b-1 my-3"></div>
39+
<div className="flex flex-row w-full mt-1 ml-3">
40+
<div className="text-xs mr-5 dark:text-gray-400 text-gray-800">Subject:</div>
41+
<input value={subject} onChange={(e) => setSubject(e.target.value)}
42+
className="text-xs mr-5 dark:text-white w-full text-gray-900 bg-transparent outline-none"></input>
43+
</div>
44+
<div className="border dark:border-gray-800 border-gray-800 border-b-1 my-3"></div>
45+
<div className="flex flex-row w-full mt-1 ml-3">
46+
<div className="text-xs mr-5 dark:text-gray-400 text-gray-800">From:</div>
47+
<input value={from} onChange={(e) => setFrom(e.target.value)}
48+
className="text-xs mr-5 w-full dark:text-white text-gray-900 bg-transparent outline-none"></input>
49+
</div>
50+
<div className="border dark:border-gray-800 border-gray-800 border-b-1 my-3"></div>
51+
<textarea value={body} onChange={e => setBody(e.target.value)}
52+
className="px-2 mt-3 h-full w-full dark:text-white text-black text-md outline-none bg-transparent"></textarea>
53+
</div>
54+
</div>
55+
);
56+
57+
}
58+
59+
export default Mail;

src/Components/Profile.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ import { act } from 'react-dom/test-utils';
33
import About from './Screens/About';
44
import Projects from './Screens/Projects';
55
import Research from './Screens/Research';
6+
import Timeline from "./Timeline";
67

78
import AboutSVG from "../Assets/profile.svg"
89
import ProjectSVG from "../Assets/project.svg"
910
import ResearchSVG from "../Assets/research.svg"
11+
import Clock from "../Assets/clock.png";
12+
1013
const Profile = (props) => {
1114

1215
const [ activeScreen , setScreen ] = React.useState("about");
@@ -16,7 +19,8 @@ const Profile = (props) => {
1619
const screens = {
1720
'about' : <About/>,
1821
'projects' : <Projects/>,
19-
'research' : <Research/>
22+
'research' : <Research/>,
23+
'timeline' : <Timeline/>
2024
}
2125

2226
const changeScreen = (e) => {
@@ -50,6 +54,10 @@ const Profile = (props) => {
5054
<img className=" w-2 md:w-4 " alt="Research" src={ ResearchSVG }/>
5155
<span className=" ml-1 md:ml-2 text-black text-xs dark:text-white">Research</span>
5256
</div>
57+
<div tabIndex="0" onFocus={() => changeScreen('timeline')} className={(activeScreen === "timeline" ? " bg-gray-300 bg-opacity-100 hover:bg-opacity-95" : " hover:bg-gray-50 hover:bg-opacity-5 ") + " w-28 md:w-full rounded-lg cursor-default outline-none py-1.5 focus:outline-none duration-100 my-0.5 flex items-center pl-2 md:pl-2.5"}>
58+
<img className=" w-2 md:w-4 " alt="Timeline" src={ Clock }/>
59+
<span className=" ml-1 md:ml-2 text-black text-xs dark:text-white">Timeline</span>
60+
</div>
5361

5462
</div>
5563
);

0 commit comments

Comments
 (0)