Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
headroom.js
Advanced tools
Headroom.js is a lightweight, high-performance JS widget (with no dependencies) that allows you to react to the user's scroll. The header on this site is a living example, it slides out of view when scrolling down and slides back in when scrolling up.
Headroom.js is available on npm. To install:
npm install headroom.js --save
# or...
yarn add headroom.js
A a universal build (suitable for script tags, CommonJS, and AMD) is available from unpkg.com:
For complete documentation please visit the headroom.js website.
After installing headroom.js
. The following JS will create and initialise a headroom instance:
import Headroom from "headroom.js";
// select your header or whatever element you wish
const header = document.querySelector("header");
const headroom = new Headroom(header);
headroom.init();
Then you can add the following CSS to your page:
.headroom {
will-change: transform;
transition: transform 200ms linear;
}
.headroom--pinned {
transform: translateY(0%);
}
.headroom--unpinned {
transform: translateY(-100%);
}
You should now see your header slide in and out in response to the user's scroll.
Contributions are welcome. Please clearly explain the purpose of the PR and follow the current code style.
Issues can be resolved quickest if they are descriptive and include both a reduced test case and a set of steps to reproduce.
The following steps will get you setup to contribute changes to this repo:
git clone https://github.com/<your_github_username>/headroom.js.git
cd headroom.js
npm
, so you should too.npm install
To build the project:
npm run build
To start a watcher for building the project and running tests:
npm start
To run the test suite in headless mode:
npm test
Licensed under the MIT License.
FAQs
Give your page some headroom. Hide your header until you need it
The npm package headroom.js receives a total of 23,685 weekly downloads. As such, headroom.js popularity was classified as popular.
We found that headroom.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.