feat: show shopping list items in cards
This commit is contained in:
parent
f596a923d9
commit
6c704828ce
14 changed files with 396 additions and 85 deletions
18
assets/js/smooth-scroll.js
Normal file
18
assets/js/smooth-scroll.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (e) {
|
||||
// Only prevent default for same-page anchors
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#' && href.startsWith('#')) {
|
||||
const target = document.querySelector(href);
|
||||
if (target) {
|
||||
e.preventDefault();
|
||||
target.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue