added content
45
src/main.cpp
|
@ -4,19 +4,56 @@
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <format>
|
||||||
|
|
||||||
std::string data_index = Files::load("../static/index.html");
|
std::string data_index = Files::load("../static/index.html");
|
||||||
|
std::string data_projects = Files::load("../static/public/html/projects.html");
|
||||||
|
std::string data_contact = Files::load("../static/public/html/contact.html");
|
||||||
|
std::string data_about = Files::load("../static/public/html/about.html");
|
||||||
|
std::string data_resume = Files::load("../static/public/html/resume.html");
|
||||||
|
std::string data_404 = Files::load("../static/public/html/error.html");
|
||||||
|
|
||||||
httplib::Server svr;
|
httplib::Server svr;
|
||||||
|
|
||||||
|
auto page_handler(std::string data_content)
|
||||||
|
{
|
||||||
|
return [data_content](const httplib::Request& req, httplib::Response& res)
|
||||||
|
{
|
||||||
|
std::string data = std::vformat(data_index, std::make_format_args(data_content));
|
||||||
|
res.set_content(data, "text/html");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
void post_contact(const httplib::Request& req, httplib::Response& res)
|
||||||
|
{
|
||||||
|
std::cout << "Contact form submitted\n";
|
||||||
|
std::cout << "Name: " << req.get_param_value("name") << "\n";
|
||||||
|
std::cout << "Email: " << req.get_param_value("email") << "\n";
|
||||||
|
std::cout << "Message: " << req.get_param_value("message") << "\n";
|
||||||
|
|
||||||
|
res.set_content("<p>Message sent. Thanks!</p>", "text/html");
|
||||||
|
}
|
||||||
|
|
||||||
|
void error_handler(const httplib::Request& req, httplib::Response& res)
|
||||||
|
{
|
||||||
|
std::string data = std::vformat(data_index, std::make_format_args(data_404));
|
||||||
|
res.set_content(data, "text/html");
|
||||||
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
svr.set_mount_point("/static", "../static/public/");
|
svr.set_mount_point("/static", "../static/public/");
|
||||||
|
|
||||||
svr.Get("/", [](const httplib::Request& req, httplib::Response& res)
|
svr.Get("/", page_handler(data_projects));
|
||||||
{
|
svr.Get("/projects", page_handler(data_projects));
|
||||||
res.set_content(data_index, "text/html");
|
svr.Get("/contact", page_handler(data_contact));
|
||||||
});
|
svr.Get("/about", page_handler(data_about));
|
||||||
|
svr.Get("/resume", page_handler(data_resume));
|
||||||
|
|
||||||
|
svr.Post("/contact", post_contact);
|
||||||
|
|
||||||
|
svr.set_error_handler(error_handler);
|
||||||
|
|
||||||
std::cout << "Listening on port 8080\n";
|
std::cout << "Listening on port 8080\n";
|
||||||
svr.listen("0.0.0.0", 8080);
|
svr.listen("0.0.0.0", 8080);
|
||||||
|
|
|
@ -1,48 +1,24 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<title>Jays Portfolio</title>
|
|
||||||
<link rel="stylesheet" href="/static/style.css" />
|
<link rel="stylesheet" href="/static/style.css" />
|
||||||
<script src="/static/htmx.min.js"></script>
|
<script src="/static/js/htmx.min.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div id="root-head">
|
||||||
<h1>Welcome to my portfolio website :)</h1>
|
<ul class="navbar">
|
||||||
<p>
|
<li class="visually-hidden"><a href="#main-content">Skip to main content</a></li>
|
||||||
Here you can see the (more notable) projects I have created and/or worked on.
|
<li><button hx-get="/static/html/projects.html" hx-target="#main-content" hx-push-url="/">Projects</button></li>
|
||||||
</p>
|
<li><button hx-get="/static/html/contact.html" hx-target="#main-content" hx-push-url="/contact">Contact</button></li>
|
||||||
|
<li><button hx-get="/static/html/about.html" hx-target="#main-content" hx-push-url="/about">About</button></li>
|
||||||
<h2>Fast Nuclear Sim</h2>
|
<li><button hx-get="/static/html/resume.html" hx-target="#main-content" hx-push-url="/resume">Resume</button></li>
|
||||||
<p>
|
</ul>
|
||||||
The project was named this way after I built a command-line based nuclear reaction simulator
|
<div id="root-body">
|
||||||
in C++ which simulated random events leading to decay chains and the radioactive isotopes themselves
|
<div id="main-content">
|
||||||
(as whole integer amounts) in each simulated sample. Whilst I ended up with semi-realistic results,
|
{}
|
||||||
with each sample containing radioactive isotopes known to be fission products, my simulation was
|
</div>
|
||||||
also far too slow and inprecise for it to actually be used in a nuclear power plant simulation.
|
</div>
|
||||||
</p>
|
</div>
|
||||||
<p>
|
|
||||||
Fast Nuclear Sim was created to be a faster, floating point based nuclear reaction simulator.
|
|
||||||
It doesn't try to approximate the isotopes themselves, but it instead approximates some of the
|
|
||||||
more key ones, such as both the uranium-235 and uranium-238 components of the fuel,
|
|
||||||
the waste products of nuclear fission, and the reduction in reactor power from xenon-135.
|
|
||||||
</p>
|
|
||||||
<img
|
|
||||||
src="/static/image/Fast-Nuclear-Sim.png"
|
|
||||||
alt="An in-game screenshot of Fast Nuclear Sim, showing the reactor core, displays for pumps, valves, the turbine, a synchroscope, as well as the plants controls."
|
|
||||||
/>
|
|
||||||
<p>
|
|
||||||
This project was created in C++ and is rendered using GLFW and OpenGL. The project is incomplete,
|
|
||||||
but still being worked on. The project is, and consists fully of, open source software.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Links</h3>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://github.com/jsrobson10/fast-nuclear-sim" target="_blank">Fast Nuclear Sim (GitHub)</a></li>
|
|
||||||
<li><a href="https://github.com/jsrobson10/nuclear-sim" target="_blank">Nuclear Sim (GitHub)</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
<title>Jays Portfolio - About</title>
|
||||||
|
|
||||||
|
<h1>About</h1>
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
|
||||||
|
<title>Jays Portfolio - Contact</title>
|
||||||
|
|
||||||
|
<h1>Contact</h1>
|
||||||
|
|
||||||
|
<div id="contact-response">
|
||||||
|
<p>
|
||||||
|
You can contact me via this form or by emailing me at <a href="mailto:jsrobson10@gmail.com">jsrobson10@gmail.com</a>.
|
||||||
|
<form hx-post="/contact", hx-target="#contact-response">
|
||||||
|
<label for="contact-name">Name</label>
|
||||||
|
<input type="text" name="name" id="contact-name" required />
|
||||||
|
<label for="contact-email">Email</label>
|
||||||
|
<input type="email" name="email" id="contact-email" required />
|
||||||
|
<label for="contact-message">Message</label>
|
||||||
|
<textarea name="message" id="contact-message" required></textarea>
|
||||||
|
<button hx-disabled-elt="this">Send</button>
|
||||||
|
</form>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<h1>Other Links</h1>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://www.github.com/jsrobson10" target="_blank">GitHub</a></li>
|
||||||
|
<li><a href="https://www.linkedin.com/in/jay-robson-6a53312b3/" target="_blank">LinkedIn</a></li>
|
||||||
|
<li><a href="https://git.onewaycoding.com/jay" target="_blank">Gitea</a></li>
|
||||||
|
</ul>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
<title>Jays Portfolio - 404</title>
|
||||||
|
|
||||||
|
<h1>404</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Looks like you've stumbled upon a page that doesn't exist. Sorry about that.
|
||||||
|
</p>
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
<title>Jays Portfolio</title>
|
||||||
|
|
||||||
|
<h1>Welcome to my portfolio website :)</h1>
|
||||||
|
<p>
|
||||||
|
Here you can see the (more notable) projects I have created and/or worked on.
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li><button hx-get="/static/html/projects/fast_nuclear_sim.html" class="button-link" hx-target="#projects">Fast Nuclear Sim</button></li>
|
||||||
|
<li><button hx-get="/static/html/projects/goulds_webstore.html" class="button-link" hx-target="#projects">Goulds Webstore</button></li>
|
||||||
|
<li><button hx-get="/static/html/projects/project_zombie.html" class="button-link" hx-target="#projects">Project Zombie</button></li>
|
||||||
|
<li><button hx-get="/static/html/projects/this_portfolio_website.html" class="button-link" hx-target="#projects">This Portfolio Website</button></li>
|
||||||
|
</ul>
|
||||||
|
<div id="projects"></div>
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
<h2>Ant Simulator</h2>
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<h2>Binary Data Format</h2>
|
||||||
|
<p>
|
||||||
|
This project was created to be something similar in structure to JSON,
|
||||||
|
but also more compact. I wrote a version of this in C++ and another in Java.
|
||||||
|
The format was designed to be able to be both parsed and written to a binary blob,
|
||||||
|
while also being able to be read and written to a human-readable text format similar to JSON.
|
||||||
|
The difference between this and JSON is this one is statically typed, and natively
|
||||||
|
supports comments in the human readable version.
|
||||||
|
</p>
|
||||||
|
<h2>Links</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://github.com/jsrobson10/binary-data-format" target="_blank">Binary Data Format (Java) (GitHub)</a></li>
|
||||||
|
<li><a href="https://github.com/jsrobson10/BdfCpp" target="_blank">Binary Data Format (C++) (GitHub)</a></li>
|
||||||
|
</ul>
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
<h2>Fast Nuclear Sim</h2>
|
||||||
|
<p>
|
||||||
|
The project was named this way after I built a command-line based nuclear reaction simulator
|
||||||
|
in C++ which simulated random events leading to decay chains and the radioactive isotopes themselves
|
||||||
|
(as whole integer amounts) in each simulated sample. Whilst I ended up with semi-realistic results,
|
||||||
|
with each sample containing radioactive isotopes known to be fission products, my simulation was
|
||||||
|
also far too slow and imprecise for it to actually be used in a nuclear power plant simulation.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Fast Nuclear Sim was created to be a faster, floating point based nuclear reaction simulator.
|
||||||
|
It doesn't try to approximate the isotopes themselves, but it instead approximates some of the
|
||||||
|
more key ones, such as both the uranium-235 and uranium-238 components of the fuel,
|
||||||
|
the waste products of nuclear fission, and the reduction in reactor power from xenon-135.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
This project was created in C++ and is rendered using GLFW and OpenGL. The project is incomplete,
|
||||||
|
but still being worked on. The project is, and consists fully of, open source software.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/fast_nuclear_sim_control_room.png" alt="Fast Nuclear Sim control room" />
|
||||||
|
<p>
|
||||||
|
This is the control room of the nuclear power plant.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/fast_nuclear_sim_dials.png" alt="Fast Nuclear Sim dials" />
|
||||||
|
<p>
|
||||||
|
These are the dials for the electrical grid connection part of the nuclear power plant.
|
||||||
|
This shows the power output of the generator onto the grid, the synchroscope, and the
|
||||||
|
generator and grid frequency.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/fast_nuclear_sim_containment_building.png" alt="Fast Nuclear Sim containment building" />
|
||||||
|
<p>
|
||||||
|
This is the containment building of the nuclear power plant.
|
||||||
|
This room is currently very incomplete, as I was much more focused on core mechanics in the control room.
|
||||||
|
<h2>Links</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://github.com/jsrobson10/fast-nuclear-sim" target="_blank">Fast Nuclear Sim (GitHub)</a></li>
|
||||||
|
<li><a href="https://github.com/jsrobson10/nuclear-sim" target="_blank">Nuclear Sim (GitHub)</a></li>
|
||||||
|
</ul>
|
|
@ -0,0 +1,27 @@
|
||||||
|
<h2>Goulds Webstore</h2>
|
||||||
|
<p>
|
||||||
|
This is a project I created for a client.
|
||||||
|
The project is written using TypeScript, React, and MariaDB.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/goulds_webstore_mfa.png" alt="Goulds Webstore authenticator login step" />
|
||||||
|
<p>
|
||||||
|
This step uses an authenticator app to log in.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/goulds_webstore_profile.png" alt="Goulds Webstore profile page" />
|
||||||
|
<p>
|
||||||
|
This is the profile page.
|
||||||
|
Cards are stored using stripe for security so that the website does not have to store any credit card information.
|
||||||
|
Additionally, privacy options are avaliable, as well as options to change name, email, phone, password, and MFA.
|
||||||
|
All orders can also be seen by the user.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/goulds_webstore_user_admin.png" alt="Goulds Webstore page to edit user accounts" />
|
||||||
|
<p>
|
||||||
|
This is the page to edit user accounts.
|
||||||
|
Products have the option to be visible, hidden, or private. This makes it possible for customers
|
||||||
|
to be given access to certain products by staff, and to be given their own custom products.
|
||||||
|
</p>
|
||||||
|
<h2>Links</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://store.gouldsnaturalmedicine.com.au/" target="_blank">Goulds Webstore Website</a></li>
|
||||||
|
</ul>
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
|
||||||
|
<h2>Project Zombie</h2>
|
||||||
|
<p>
|
||||||
|
This was a game I wrote in Java using the LWJGL library. It is a 3D game, and it was the first time I
|
||||||
|
had wrote one that used the GPU for rendering. At first it used the fixed function pipeline, but I
|
||||||
|
later rewrote the rendering code to use shaders which made it look much better while also running faster.
|
||||||
|
The game is a top-down survival game, where the player must craft items and keep warm.
|
||||||
|
Originally the game was about just fighting zombies, but I decided to focus more on survival.
|
||||||
|
The game is not finished.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/project_zombie_title_screen.png" alt="Project Zombie title screen." />
|
||||||
|
<p>
|
||||||
|
The title screen gradually rotates and moves along to show off the world.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/project_zombie_daytime.png" alt="Project Zombie gameplay during the day. Trees, plants, and rocks are visible." />
|
||||||
|
<p>
|
||||||
|
Gameplay during the day phase.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/project_zombie_nighttime.png" alt="Project Zombie gameplay during the night. Everything is pitched black, except near the campfire." />
|
||||||
|
<p>
|
||||||
|
Gameplay during the night phase. This phase is especially cold.
|
||||||
|
A campfire and a light source is essential here.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/project_zombie_crafting.png" alt="Project Zombie crafting menu. There is a large selection of items to choose from." />
|
||||||
|
<p>
|
||||||
|
As you can see here, I did not end up adding all of the textures and instead focused on functionality.
|
||||||
|
This is why some of the textures are purple and black to indicate that they are missing.
|
||||||
|
</p>
|
||||||
|
<img src="/static/image/project_zombie_underground.png" alt="Project Zombie underground gameplay." />
|
||||||
|
<p>
|
||||||
|
The underground consists of several biomes. The one shown here are the ice caves.
|
||||||
|
These are extremely cold, and full of zombies.
|
||||||
|
</p>
|
||||||
|
<h2>Links</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://www.youtube.com/watch?v=iYD0GUbWbPo" target="_blank">Project Zombie (Unoptimized Version) (YouTube)</a></li>
|
||||||
|
</ul>
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
<h2>Portfolio Website</h2>
|
||||||
|
<p>
|
||||||
|
This is the website you are currently seeing. It was created using C++, HTML with HTMX, CSS, and JavaScript.
|
||||||
|
The website is designed to be a single page application, and is designed to be easy to add new projects to.
|
||||||
|
</p>
|
||||||
|
<h2>Links</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://git.onewaycoding.com/jay/Portfolio" target="_blank">Portfolio (Gitea)</a></li>
|
||||||
|
</ul>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
<title>Jays Portfolio - Resume</title>
|
||||||
|
|
||||||
|
<h1>Resume</h1>
|
||||||
|
|
Before Width: | Height: | Size: 720 KiB |
After Width: | Height: | Size: 936 KiB |
After Width: | Height: | Size: 679 KiB |
After Width: | Height: | Size: 521 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 413 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 195 KiB |
After Width: | Height: | Size: 994 KiB |
After Width: | Height: | Size: 237 KiB |
|
@ -1,4 +1,105 @@
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 40%;
|
width: calc(min(100%, 800px));
|
||||||
|
border-radius: 0.25em;
|
||||||
|
border-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
font: inherit;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.visually-hidden {
|
||||||
|
overflow: hidden;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
display: block;
|
||||||
|
left: 50%;
|
||||||
|
position: absolute;
|
||||||
|
transform: translateY(-100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-link {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
font: inherit;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: underline;
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.navbar {
|
||||||
|
list-style-type: none;
|
||||||
|
background-color: #c0c0c4;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.navbar li {
|
||||||
|
display: inline;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.navbar button {
|
||||||
|
background-color: #c0c0c4;
|
||||||
|
border: none;
|
||||||
|
padding: 1em 1.5em;
|
||||||
|
font: inherit;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
display: block;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.navbar button:hover {
|
||||||
|
background-color: #a0a0a4;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="text"], input[type="email"], textarea {
|
||||||
|
display: block;
|
||||||
|
width: calc(min(100% - 1em, 800px));
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="text"], input[type="email"], input[type="button"], textarea, button {
|
||||||
|
border-radius: 0.25em;
|
||||||
|
border-width: thin;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: gray;
|
||||||
|
padding: 0.25em 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
height: 10em;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
background-color: #404044;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#root-head {
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
display: block;
|
||||||
|
max-width: calc(max(80%, 800px));
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#root-body {
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
<p>Wowzers!</p>
|
|
||||||
<p>This thing is powerful! =)</p>
|
|