Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@sect/100vh
Advanced tools
Lightweight JS package for easy overcoming the problem with 100vh on mobile devices
Lightweight JS package for easy overcoming the problem with 100vh on mobile devices :iphone:
It creates the CSS variable called --vh
at the <html>
tag and vh
variable in the window
, which is changed on orientation change & resize
event and stays still during scroll. This will prevent the page "jumping" on scroll, which leads to bad user experience.
This will stay still only on mobile devices, on desktop the value changes together with the viewport. That means that it can be used on any resolution and there is no need for additional css media queries.
Install package in your project
npm i @sect/100vh
Import the package and run the init function at the page start.
(for Nuxt.js/Vue app it can be initialized in plugins, if you're using other technology – init the script above all the other code)
import vh from '@sect/100vh';
vh.init();
<!-- Include 100vh from dist -->
<script src="dist/100vh.umd.js"></script>
<!-- Initialize (you can do this whenever you want) -->
<script>
vh.init();
</script>
CSS
.section {
height: var(--vh);
}
JS
window.querySelectorAll('section').style.height = window.vh;
Want to help improve this plugin? Great!
Project is open-source so fork repo and join us!
MIT License © Sparing Interactive
FAQs
Lightweight JS package for easy overcoming the problem with 100vh on mobile devices
We found that @sect/100vh 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.