First (broken) commit

This commit is contained in:
Dominik V. Salonen 2018-03-13 15:05:30 +01:00
commit cc74a03dd0
4 changed files with 205 additions and 0 deletions

36
index.html Executable file
View File

@ -0,0 +1,36 @@
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet" />
<link href="style.css" rel="stylesheet" />
<script src="main.js"></script>
</head>
<body>
<div id="site">
<div id="content">
<h1 class="title">
Quad
</h1>
<p class="sub-title">
AKA Dominik <span>(Vincent)</span> Salonen
</p>
<div id="main-container">
<div id="navbar">
<div id="button1" class="nav-button">About</div>
<div id="button2" class="nav-button">Social</div>
<div id="button3" class="nav-button">Projects</div>
</div>
<div id="page" onload="javascript:initialContent();">
<p class="initial-text">Click a button!</p>
</div>
</div>
<p class="notice">
P.S Anime is for bakas
</p>
</div>
</div>
</body>
</html>

53
main.js Executable file
View File

@ -0,0 +1,53 @@
// I suck at JS okay, don't judge. I know this is horrendous.
// Heavy copy/paste junk.
var button1 = document.getElementById('button1');
var button2 = document.getElementById('button2');
var button3 = document.getElementById('button3');
contsrc = "file:///H:/Side projects/Site/";
var payload1 = "Hellow";
//var payload2 = new Promise(function(resolve) {
// setTimeout(resolve(httpGet(contsrc + "pages/about.html")), 100, 'foo')});
var payload2 = "Ayy";
var payload3 = "lmao3";
function resetButtons() {
button1.className = "nav-button";
button2.className = "nav-button";
button3.className = "nav-button";
}
function httpGet(myUrl) {
var request = new XMLHttpRequest();
request.open('GET', myUrl, true);
request.send(null);
if (request.status == 200) {
return request.responseText;
}
}
function setContent(navbutt, payload) {
document.getElementById("page").innerHTML = payload;
resetButtons();
navbutt.className += " active";
}
button1.addEventListener('click', function() {
setContent(button1, payload1);
}, false);
button2.addEventListener('click', function() {
setContent(button2, payload2);
}, false);
button3.addEventListener('click', function() {
setContent(button3, payload3);
}, false);
function initialContent() {
setContent(button1, payload1);
}

1
pages/about.html Executable file
View File

@ -0,0 +1 @@
<p>Ayy lmao</p>

115
style.css Executable file
View File

@ -0,0 +1,115 @@
html, body {
margin: 0;
padding: 0;
}
h1, h2, h3, h4, h5, p {
margin: 0;
}
#site {
position: absolute;
top: 0;
left: 0;
background-color: #2b2b2b;
min-width: 100vw;
min-height: 100vh;
margin: 0;
color: #FFF;
font-family: "Lato", sans-serif;
}
#content {
display: block;
margin-right: auto;
margin-left: auto;
width: 750px;
max-width: 90vw;
margin-top: 40vh;
transform: translateY(-50%)
}
#main-container {
background-color: #3b3b3b;
margin-top: 10px;
padding: 5px;
border-radius: 5px 5px 0px 0px;
width: 100%;
box-shadow: 3px 3px 7px rgba(0,0,0,0.25);
}
#navbar {
width: 100%;
/* Whitespace hack */
font-size: 0;
text-align: center;
}
#page {
width: 100%;
padding: 15px 5px 8px 5px;
}
.title {
font-size: 32pt;
font-weight: 300;
text-align: center;
}
.sub-title {
font-size: 10pt;
color: #AAA;
text-align: center;
}
.sub-title span {
color: #555;
}
.nav-button {
display: inline-block;
border-bottom: solid 3px #2b2b2b;
background-color: #3b3b3b;
transition: background 0.15s ease-in-out, border 0.5s ease-in-out;
padding: 10px 5px;
box-sizing: border-box;
margin: 0;
text-align: center;
width: 33%;
/* Undo whitespace hack */
font-size: 12pt;
cursor: pointer;
}
.nav-button:hover {
background-color: #4b4b4b;
transition: background 0.15s ease-in-out;
}
.nav-button.active {
border-color: #FF5555;
transition: background 0.15s ease-in-out, border 0.5s ease-in-out;
}
.initial-text {
font-size: 18pt;
text-align: center;
margin-top: 50px;
margin-bottom: 50px;
}
.notice {
color: #3b3b3b;
text-align: right;
}
/* Thanks StackOverflow, heck if I can remember this stuff */
.noselect, .nav-button, .notice {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome and Opera */
}