-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdesktop.js
More file actions
126 lines (110 loc) · 3.23 KB
/
desktop.js
File metadata and controls
126 lines (110 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
let types = Object.freeze({ "About" : 1, "Projects" : 2});
function ProjectView (props) {
return (
<div className="ProjectView">
<h3><a href={props.url}><b>{props.project}</b><code> </code><i className="fab fa-github-square"></i></a></h3>
<p>{props.project_detail}</p>
</div>
);
}
function ProjectsView(props) {
return (
<div className="ProjectsView">
<div className="ProjectsContentsView">
<h2>Projects</h2>
{projects.map((project, ind) =>
<div className={"ProjectsBox" + (ind != 0 ? "" : " FirstElem")} key={project["project"]}>
{ind != 0 && <div className="HorizontalLine" />}
<ProjectView project={project["project"]}
project_detail={project["project_detail"]}
url={project["url"]} />
</div>
)}
</div>
</div>
);
}
function AboutView(props){
return (
<div className="AboutView">
<h2>About Me</h2>
<p>{about_me}</p>
</div>
);
}
function ContentView (props) {
var currentView = <AboutView />;
if(props.current == types.Projects) {
currentView = <ProjectsView />;
}
return (
<div className="ContentView">
<div className="InnerContentView">
{currentView}
</div>
</div>
);
}
function DesktopNavView (props) {
function star(type){
if(type == props.current){
return <code>*</code>;
} else {
return <code> </code>;
}
}
return (
<div className="NavView" style={props.navViewStyle}>
<div className="InnerNavView">
<h1>TAEHYUN_LEE</h1>
<h2 id="contacts">
<a id="resume_link" href={links.resume} >Resume</a>
<a href={links.github} ><i className="fab fa-github-square"></i></a>
<a href={links.linkedin} ><i className="fab fa-linkedin"></i></a>
<a href={links.mail} ><i className="fas fa-envelope-square"></i></a>
</h2>
<h3 onClick={(e) => props.changeCurrent(types.About)} >[{star(types.About)}] About</h3>
<h3 onClick={(e) => props.changeCurrent(types.Projects)}>[{star(types.Projects)}] Projects</h3>
</div>
</div>
);
}
/**
* Main react componenet, takes charge of which views to present
*
*/
class DesktopApp extends React.Component {
constructor(props){
super(props);
this.state = { current : types.About};
this.changeCurrent = this.changeCurrent.bind(this);
}
changeCurrent (newCurrent) {
this.setState({ current : newCurrent });
}
render() {
var desktopPaletteStyle = {
position : "absolute",
top : "5%",
left : "5%",
};
var desktopChangeColStyle = {
width: "20px",
height: "20px"
};
var desktopNavViewStyle = {
width: "40%"
};
return (
<div className="ContainingView">
<ColorPalettesView paletteStyle = {desktopPaletteStyle}
changeColStyle = {desktopChangeColStyle}/>
<DesktopNavView navViewStyle = {desktopNavViewStyle}
current = {this.state.current}
changeCurrent = {this.changeCurrent} />
<div className = "VerticalLine"/>
<ContentView current = {this.state.current} />
</div>
);
}
}