Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
dual-side-scroll
Advanced tools
It's a tiny freeware library on TypeScript to sinhronize page scrolling and navigation meny-bar.
This tiny plugin is designed to show the progress of the page scrolling interactively. There are two types of actions: onScrolled
and onChanged
.
They can be used together or separately.
onScrolled
- returns to the progress for each scroll event. It is convenient to use when you need to display progress in real time.onChanged
- works only when one paragraph is replaced to another. This is useful for switching the active menu item in the navigation block.All you need is a navigation menu with links to the relevant paragraphs in the text. When initializing an object, you need to specify cursor and menu selectors, as well as a callback function.
When the onScrolled
event is used, an object will be sent to the processing unit:
Progress {
// id of current paragraph
Id: string;
// % of paragraph being reviewed
Percent: number;
}
When the onChanged
event is used, the id of the current paragraph will be sent to the processing unit.
When the window is changed in size, the script automatically will be adjuscted to the proportional value. This is sometimes needed in the mobile version. When the device screen is rotated, the scrolling will continue to work correctly.
npm i dual-side-scroll
Take the minified version of the script from dist
and place it in your application directory. Make sure the plugin connection string is located above the connection string of your scripts.
<script src="./<your_js_directory>/scroll-progress.min.js"></script>
For debugging purposes, there is an unminified version with sourcemap.
The source code of the page LiveDemo script.
document.addEventListener("DOMContentLoaded", function (event) {
let currentParagraphName = document.getElementById('current-paragraph-name');
let currentParagraphPercent = document.getElementById('current-paragraph-percent');
new ScrollProgress.Init(
"#cursor",
"menu",
progress => {
currentParagraphName.innerText = document.getElementById(progress.Id).innerText;
currentParagraphPercent.innerText = progress.Percent + '%';
},
id => {
document.querySelectorAll('a[href*="link"]')
.forEach(element =>
element.classList.remove('active-meny-item')
);
document.querySelector(`[href="#${id}"]`).classList
.add('active-meny-item');
}
);
});
FAQs
It's a tiny freeware library on TypeScript to sinhronize page scrolling and navigation meny-bar.
The npm package dual-side-scroll receives a total of 3 weekly downloads. As such, dual-side-scroll popularity was classified as not popular.
We found that dual-side-scroll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.