-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.html
84 lines (75 loc) · 3.39 KB
/
template.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="css/main.css">
<title>Shehan.com</title>
</head>
<body class="center">
<nav class="wrap d-flex p-3">
<div class="nav">
<a href="index.html" class="flex-grow-1">
<img src="images/logo-01.png" alt="shehan- website-logo" class="logo">
</a>
<div id="navList" class="links">
<div id="navclose" class="not-display-in-pc navCloseButton"><i class="fa fa-window-close" aria-hidden="true"></i></div>
<a class="navLinks" href="index.html">Home</a>
<a class="navLinks" href="services.html">Services</a>
<a class="navLinks" href="work.html">work</a>
<a class="navLinks" href="caontact.html">Contact</a>
<a class="btn-my-light" target="_blank" href="https://www.linkedin.com/in/shehan-maleesha-017a89261/">Hire Me</a>
</div>
<div id="navbutton" class="navbutton d-sm-none d-sm-inline-block">
<i class="fas fa-bars"></i>
</div>
</div>
</nav>
<div class="navBottomLine">
<div class="light "></div>
</div>
<main>
<div class="defaultContent wrap"></div>
</main>
<footer>
</footer>
<div class="d-none" id="moveUp"><i class='far fa-arrow-alt-circle-up' style='font-size:36px'></i></div>
</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script>
document.getElementById("navbutton").addEventListener('click', (e)=>{
console.log("clicked");
document.getElementById("navList").classList.add("move-left");
document.getElementById("navList").classList.remove("move-right");
})
document.getElementById("navclose").addEventListener('click',(e)=>{
document.getElementById("navList").classList.remove("move-left");
document.getElementById("navList").classList.add("move-right");
})
var scrollButton =document.getElementById('moveUp');
window.addEventListener('scroll', function() {
// Get the viewport height
const vh = window.innerHeight;
// Calculate 120% of the viewport height
const threshold = 1 * vh;
// Get the current scroll position
const scrollPosition = window.scrollY;
// console.log(Math.floor(scrollPosition) + " > "+ vh);
// if (Math.floor(scrollPosition) > vh) {
// console.log("down");
// scrollButton.classList.remove("d-none");
// } else {
// console.log("top");
// scrollButton.classList.add("d-none");
// }
});
scrollButton.addEventListener('click', function() {
window.scrollTo({
top: 0,
behavior: 'smooth' // Optional: Adds a smooth scrolling effect
});
});
</script>
</html>