Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
makura-2025
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Raj Shah
makura-2025
Commits
84823dd1
Commit
84823dd1
authored
Feb 03, 2025
by
jhukal9@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the intersection observer for the listing section
parent
091196fe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletions
+36
-1
script.js
assets/js/script.js
+34
-1
_resource-listing.scss
dev/sass/pages/resources/_resource-listing.scss
+2
-0
No files found.
assets/js/script.js
View file @
84823dd1
...
@@ -21,6 +21,39 @@
...
@@ -21,6 +21,39 @@
});
});
$
(
function
()
{
$
(
function
()
{
const
resourceListObserver
=
new
IntersectionObserver
(
function
()
{},
{});
const
resourceListObserver
=
new
IntersectionObserver
(
function
(
entries
)
{
entries
.
forEach
((
entry
)
=>
{
if
(
entry
.
isIntersecting
)
{
const
targetId
=
entry
.
target
.
id
;
const
tocItem
=
$
(
`.toc li a[data-target="
${
targetId
}
"]`
).
parent
();
if
(
entry
.
isIntersecting
)
{
tocItem
.
addClass
(
"active"
).
siblings
().
removeClass
(
"active"
);
}
}
});
},
{
threshold
:
0.1
,
},
);
$
(
".resource-block"
).
each
(
function
()
{
resourceListObserver
.
observe
(
this
);
});
$
(
".toc li a"
).
on
(
"click"
,
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
parent
().
addClass
(
"active"
).
siblings
().
removeClass
(
"active"
);
const
currentActive
=
$
(
this
).
data
(
"target"
);
const
targetElement
=
document
.
getElementById
(
currentActive
);
if
(
targetElement
)
{
targetElement
.
scrollIntoView
({
behavior
:
"smooth"
,
block
:
"start"
,
});
}
});
});
});
})(
jQuery
);
})(
jQuery
);
dev/sass/pages/resources/_resource-listing.scss
View file @
84823dd1
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
}
}
.resource-wrapper
{
.resource-wrapper
{
.resource-block
{
.resource-block
{
scroll-margin-top
:
120px
;
.resource-item
{
.resource-item
{
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.1
);
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.1
);
.resource-image
{
.resource-image
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment