Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event functions #685

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a2f9026
added funtionality and styling to drumkit
shb1383 May 16, 2024
1f98709
added functionality and styling to clock hands
shb1383 May 16, 2024
9ba8afe
created handle documents and function to update its properties
shb1383 May 20, 2024
9e61433
created various methods to sort given data
shb1383 May 21, 2024
a383123
added styling and toggle functions to panels
shb1383 May 22, 2024
314b55f
created fetch and functions to retieve data and display results for s…
shb1383 May 24, 2024
3aa1f51
created code using various array methods to complete tasks
shb1383 May 24, 2024
fc562b0
created and styled drawing function on canvas
shb1383 May 26, 2024
6a64ccd
coded various console tricks
shb1383 May 27, 2024
e307d73
created handle check function and applied event listener to it
shb1383 May 28, 2024
4e762e8
grabbed elements, created functions, and attached event listeners
shb1383 May 29, 2024
db3f228
created event listener on keys to detect secret code
shb1383 May 29, 2024
ec11536
grabbed image elements and created sliding function
shb1383 May 30, 2024
6661813
created copies
shb1383 Jun 5, 2024
edbcfb4
created functions to add, populate, and toggle
shb1383 Jun 8, 2024
5f81ef5
created mouse move shadow function
shb1383 Jun 9, 2024
f623d74
created function to sort without articles
shb1383 Jun 10, 2024
6ae3a81
added up times with reduce
shb1383 Jun 11, 2024
b6dfea8
created various functions for webcam
shb1383 Jun 11, 2024
716a343
implemented speech detection
shb1383 Jun 13, 2024
016b0f1
created function to access speed and postion watch accordingly
shb1383 Jun 14, 2024
ef4589a
created highlight link function
shb1383 Jun 15, 2024
5ca590b
created functions to populate and set voice plus function to toggle a…
shb1383 Jun 15, 2024
6329c50
created sticky nav function and applied it to css elements
shb1383 Jun 16, 2024
c12783c
applied event listeners utilizing capture, once, propagation and bubb…
shb1383 Jun 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
created sticky nav function and applied it to css elements
shb1383 committed Jun 16, 2024
commit 6329c5079fb24ead8ff572cf6ecd145f4d208b47
15 changes: 15 additions & 0 deletions 24 - Sticky Nav/index-START.html
Original file line number Diff line number Diff line change
@@ -55,6 +55,21 @@ <h1>A story about getting lost.</h1>
</div>

<script>
const nav = document.querySelector('#main');
const topOfNav = nav.offsetTop;

function fixNav() {
if(window.scrollY >= topOfNav) {
document.body.style.paddingTop = nav.offsetHeight + 'px';
document.body.classList.add('fixed-nav');
} else {
document.body.style.paddingTop = 0;
document.body.classList.remove('fixed-nav');
}
}


window.addEventListener('scroll', fixNav);

</script>

13 changes: 13 additions & 0 deletions 24 - Sticky Nav/style-START.css
Original file line number Diff line number Diff line change
@@ -25,6 +25,10 @@ body {
transition: transform 0.5s;
}

.fixed-nav .site-wrap {
transform: scale(1);
}

header {
text-align: center;
height: 50vh;
@@ -50,6 +54,11 @@ nav {
z-index: 1;
}

.fixed-nav nav {
position: fixed;
box-shadow: 0 5px rgba(0,0,0,0.1);
}

nav ul {
margin: 0;
padding:0;
@@ -74,6 +83,10 @@ li.logo {
font-size: 30px;
}

.fixed-nav li.logo {
max-width: 500px;
}

li.logo a {
color: black;
}