profile-site/main.js

123 lines
3.1 KiB
JavaScript
Raw Normal View History

let pageLocation = "meet";
2021-01-14 17:46:52 -05:00
let backButton = document.getElementById("back");
let nextButton = document.getElementById("next");
2021-01-14 14:40:08 -05:00
2021-01-14 17:46:52 -05:00
function next() {
if (pageLocation === "meet") {
2021-01-14 17:46:52 -05:00
document.location = "#vegetable-dash";
pageLocation = "vegetable-dash";
2021-01-14 17:46:52 -05:00
}
else if (pageLocation === "vegetable-dash") {
2021-01-16 16:58:53 -05:00
document.location = "#gold-rush";
pageLocation = "gold-rush";
}
else if (pageLocation === "gold-rush") {
2021-01-14 18:08:14 -05:00
document.location = "#coming-soon";
pageLocation = "coming-soon";
2021-01-14 18:08:14 -05:00
}
buttonVisiblility();
2021-01-14 17:46:52 -05:00
}
function last() {
if (pageLocation === "vegetable-dash") {
2021-01-14 17:46:52 -05:00
document.location = "#meet";
pageLocation = "meet";
2021-01-14 17:46:52 -05:00
}
2021-01-16 16:58:53 -05:00
else if (pageLocation === "gold-rush") {
2021-01-14 18:08:14 -05:00
document.location = "#vegetable-dash";
pageLocation = "vegetable-dash";
}
2021-01-16 16:58:53 -05:00
else if (pageLocation === "coming-soon") {
document.location = "#gold-rush";
pageLocation = "gold-rush";
}
buttonVisiblility();
}
function buttonVisiblility() {
if (pageLocation != "meet") {
backButton.style.opacity = "1";
}
else {
backButton.style.opacity = "0";
}
if (pageLocation != "coming-soon") {
nextButton.style.opacity = "1";
}
else {
nextButton.style.opacity = "0";
2021-01-14 18:08:14 -05:00
}
2021-01-15 14:09:56 -05:00
where();
2021-01-14 14:40:08 -05:00
}
2021-01-15 14:09:56 -05:00
function where() {
let meetIndicator = document.getElementById("meetIndicator");
let vegIndicator = document.getElementById("vegetable-dashIndicator");
2021-01-16 16:58:53 -05:00
let goldIndicator = document.getElementById("gold-rushIndicator");
2021-01-15 14:09:56 -05:00
let comingIndicator = document.getElementById("coming-soonIndicator");
if (pageLocation === "meet") {
meetIndicator.style.backgroundColor = "#262626";
}
else {
meetIndicator.style.backgroundColor = "#d6d6d6";
}
if (pageLocation === "vegetable-dash") {
vegIndicator.style.backgroundColor = "#262626";
}
else {
vegIndicator.style.backgroundColor = "#d6d6d6";
}
2021-01-16 16:58:53 -05:00
if (pageLocation === "gold-rush") {
goldIndicator.style.backgroundColor = "#262626";
}
else {
goldIndicator.style.backgroundColor = "#d6d6d6";
}
2021-01-15 14:09:56 -05:00
if (pageLocation === "coming-soon") {
comingIndicator.style.backgroundColor = "#262626";
}
else {
comingIndicator.style.backgroundColor = "#d6d6d6";
}
}
2021-01-15 14:52:34 -05:00
function ind(page) {
document.location = "#" + page;
pageLocation = page;
buttonVisiblility();
}
2021-01-26 09:32:59 -05:00
// Right Click Menu
let rightClickMenu = document.getElementById("menu").style;
if (document.addEventListener) {
document.addEventListener('contextmenu', function(e) {
var posX = e.clientX;
var posY = e.clientY;
menu(posX, posY);
e.preventDefault();
}, false);
document.addEventListener('click', function(e) {
rightClickMenu.display = "none";
}, false);
}
else {
document.attachEvent('oncontextmenu', function(e) {
var posX = e.clientX;
var posY = e.clientY;
menu(posX, posY);
e.preventDefault();
});
document.attachEvent('onclick', function(e) {
setTimeout(function() {
rightClickMenu.display = "none";
}, 501);
});
}
2021-01-15 14:52:34 -05:00
2021-01-26 09:32:59 -05:00
function menu(x, y) {
rightClickMenu.top = y + "px";
rightClickMenu.left = x + "px";
rightClickMenu.display = "block";
}