-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
145 lines (130 loc) · 5.17 KB
/
index.html
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--LIBRARIES-->
<script src="https://unpkg.com/react@15.5.4/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15.5.4/dist/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.25.0/babel.min.js"></script>
<!-- /LIBRARIES -->
<!-- FONT AWESOM ICONS -->
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> -->
<title>WebGL Renderer</title>
</head>
<body style="background-color: #444;">
<div id="app">React has not rendered yet</div>
<script type="text/babel">
let pageScale = 1.5;
let bgColor = "#aaa";
let bgTextColor = "#555";
let projBgColor = "#ddd";
let projTextColor = "#444";
function Projects(props){
const JSXCreateFunction = function(project, index){
return <Project link={project.link} img={project.img} projectname={project.projectname} desc={project.desc} key={project.id}/>
};
let projects = props.projects.map(JSXCreateFunction);
let pageNameStyle = {
fontSize: 32*pageScale,
fontFamily: "Arial, Helvetica, sans-serif",
margin: 20*pageScale,
textAlign: "center",
color: bgTextColor
}
let divStyle = {
textAlign: "center"
}
return(
<div style={divStyle}>
<h1 style={pageNameStyle}>Projects made in the WebGL renderer</h1>
{projects}
<hr/>
</div>
);
}
//Project
function Project(props){
let friendLyStyle = {
display: "inline-block",
margin: 20*pageScale,
width: 200*pageScale,
height: 300*pageScale,
padding: 0,
backgroundColor: projBgColor,
filter: `drop-shadow(0px 0px ${5*pageScale}px #222)`,
// textAlign: "center",
textDecoration: "none",
color: projTextColor,
// position: "absolute",
}
return(
<a href={props.link} style={friendLyStyle} id={`project-${props.projectname}`}>
<ProjectImage img={props.img}/>
<ProjectName projectname={props.projectname}/>
<Description desc={props.desc}/>
</a>
);
}
//ProjectImage
function ProjectImage(props){
let avatarStyle ={
width: 150*pageScale,
height: 150*pageScale,
borderRadius: "50%",
filter: "none",
marginLeft: 2.5*pageScale,
marginTop: 20*pageScale,
textAlign: "center"
}
return(
<img style={avatarStyle} src={props.img} alt="project pic"/>
);
}
//ProjectName
function ProjectName(props){
let nameStyle = {
fontSize: 24*pageScale,
fontFamily: "Arial, Helvetica, sans-serif",
// margin: 20,
filter: "none",
textAlign: "center"
}
return(
<h1 style={nameStyle}>{props.projectname}</h1>
);
}
//Description
function Description(props){
let divStyle = {
marginLeft: 15*pageScale,
textAlign: "center",
padding: 0,
}
let pStyle = {
textAlign: "center",
fontFamily: "Arial, Helvetica, sans-serif",
width: "85%",
margin: 0,
padding: 0,
}
return(
<div style={divStyle}>
<p style={pStyle}>{props.desc}</p>
</div>
);
}
var projects = [
{id:0, projectname:"PBR render", img:`misc/projects/PBR.png`, link:`${window.location.href}\index_pbr.html`, desc:"An Utah teapot model rendered with PBR shader in a forest background"},
{id:1, projectname:"3D FluidSim", img:`misc/projects/FluidSim.png`, link:`${window.location.href}\index_volumetric.html`, desc:"Interactive 3D fluid simulation"},
{id:2, projectname:"Star Trek scene", img:`misc/projects/StarTrek.png`, link:`${window.location.href}\pages/Space/index.html`, desc:"Star Trek scene with Galaxy class Enterprise D and a cloaked Romulan ship"}
];
ReactDOM.render(
<div style={{backgroundColor: bgColor}}>
<Projects projects={projects}/>
</div>,
document.getElementById("app")
)
</script>
</body>
</html>