Skip to content

Commit

Permalink
Merge pull request #65 from radogado/gh-pages
Browse files Browse the repository at this point in the history
Carousel: Arrow keys control
  • Loading branch information
radogado committed Jul 10, 2023
2 parents c794cf4 + 6f20902 commit bc6d15f
Show file tree
Hide file tree
Showing 14 changed files with 454 additions and 413 deletions.
2 changes: 1 addition & 1 deletion dist/niui.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/niui.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/niui.min.css.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14379
14393
2 changes: 1 addition & 1 deletion dist/niui.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/niui.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/niui.min.js.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12472
12582
19 changes: 10 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3962,11 +3962,12 @@ <h2 class="section-title">Theme</h2>
})
})
});
document.querySelector(location.hash)?.scrollIntoView();
document.querySelector(`[href="${location.hash}"]`)?.click();
document.querySelectorAll('aside nav [aria-current]').forEach(el => el.removeAttribute('aria-current'));
document.querySelector(`[href="${location.hash}"]`).setAttribute('aria-current', 'true');

if (!!location.hash) {
document.querySelector(location.hash)?.scrollIntoView();
document.querySelector(`[href="${location.hash}"]`)?.click();
document.querySelectorAll('aside nav [aria-current]').forEach(el => el.removeAttribute('aria-current'));
document.querySelector(`[href="${location.hash}"]`).setAttribute('aria-current', 'true');
}

var set_active_timeout = 0;
const interSecObs = new IntersectionObserver(entries => {
Expand All @@ -3979,7 +3980,7 @@ <h2 class="section-title">Theme</h2>
let id = `#${slide.closest('section').id}`;
document.querySelector(`aside nav a[href="${id}"`).setAttribute('aria-current', 'true');
// history.replaceState(null, null, '#carousel');
console.log('intersection observing ', slide);
// console.log('intersection observing ', slide);
}, 300);
}
});
Expand All @@ -3994,9 +3995,9 @@ <h2 class="section-title">Theme</h2>
});

window.onpopstate = (event) => {
console.log(
`location: ${document.location}, state: ${JSON.stringify(event.state)}`
);
// console.log(
// `location: ${document.location}, state: ${JSON.stringify(event.state)}`
// );
clearTimeout(set_active_timeout);
document.querySelectorAll('aside nav [aria-current]').forEach(el => el.removeAttribute('aria-current'));
document.querySelector(`aside nav a[href="${location.hash}"`).setAttribute('aria-current', 'true');
Expand Down
Loading

0 comments on commit bc6d15f

Please sign in to comment.