Repository navigation
Expand file tree
/
Copy pathscripts.js
More file actions
75 lines (59 loc) · 2.17 KB
/
Copy pathscripts.js
File metadata and controls
75 lines (59 loc) · 2.17 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
window.addEventListener('scroll', reveal);
function reveal() {
var reveals = document.querySelectorAll('.reveal');
for (var i = 0; i < reveals.length; i++) {
var windowheight = window.innerHeight;
var revealtop = reveals[i].getBoundingClientRect().top;
var revealpoint = 150;
if (revealtop < windowheight - revealpoint) {
reveals[i].classList.add('active');
} else {
reveals[i].classList.remove('active');
}
}
}
// Common buttons
const title = document.getElementById('title');
const homeButton = document.getElementById('home');
const portfolioButton = document.getElementById('portfolio');
const contactButton = document.getElementById('contact');
const goToGalleryButton = document.getElementById('gallery');
title.addEventListener('click', openHome);
homeButton.addEventListener('click', openHome);
portfolioButton.addEventListener('click', openPortfolio);
contactButton.addEventListener('click', openContact);
function openHome() {
document.location.href = "index.html"
}
function openPortfolio() {
document.location.href = "portfolio.html"
}
function openContact() {
document.location.href = "contact.html"
}
// Portfolio page clickable elements
const landscapeButton = document.getElementById('landscape');
const floralButton = document.getElementById('floral');
const macroWorldButton = document.getElementById('macroWorld');
const aestheticsButton = document.getElementById('aesthetics');
const animalsButton = document.getElementById('animals');
landscapeButton.addEventListener('click', openLandscapes);
floralButton.addEventListener('click', openFloral);
macroWorldButton.addEventListener('click', openMacroworld);
aestheticsButton.addEventListener('click', openAesthetics);
animalsButton.addEventListener('click', openAnimals);
function openLandscapes() {
document.location.href = "landscapes.html"
}
function openFloral() {
document.location.href = "floral.html"
}
function openMacroworld() {
document.location.href = "macro-world.html"
}
function openAesthetics() {
document.location.href = "aesthetics.html"
}
function openAnimals() {
document.location.href = "animals.html"
}