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.
A Ruby wrapper to integrate scrollReveal - A small library to create and maintain how elements fade in, triggered when they enter the viewport.
See the demo application in action.
Add the gem to the Gemfile:
gem "scrollreveal-rails"
Add ScrollReveal to your JS Append the following lines to your app/assets/javascripts/application.js file:
//= require scrollReveal
$(function() {
window.scrollReveal = new scrollReveal();
});
In your view *.html.erb
or *.html.haml
<!-- Reveal using defaults. -->
scroll_reveal content: 'Holla!'
But wait! It’s more fun if you define your own reveal animation parameters, which you can do using using natural, declarative language:
<!-- Reveal using custom parameters. -->
scroll_reveal content: 'Foo', animation: 'enter left and move 50px over 1.33s'
scroll_reveal content: 'Bar', animation: 'enter from the bottom after 1s'
scroll_reveal content: 'Baz' animation: 'wait 2.5s and then ease-in-out 100px'
What you enter into the data-scrollReveal
attribute is parsed for specific words:
These specific keyword / value pairs allow you to describe basic reveal animation behavior.
keyword: enter
— Controls the vector origin of your reveal animation.
value: top
| right
| bottom
| left
Example:
<!-- Reveal your element with a downward motion. -->
scroll_reveal content: 'Foo', animation: 'enter top'
keyword: move
— The distance your revealing element travels.
value: [ integer ]px.
Example:
scroll_reveal content: 'Foo', animation: 'move 24px'
keyword: over
— The duration of your reveal animation.
value: [ decimal ]s
Example:
scroll_reveal content: 'Foo', animation: 'over 1.66s'
keyword: after/wait
— The duration before your reveal begins.
value: [ decimal ]s
Example:
<!-- Both are accepted. -->
scroll_reveal content: 'Mel', animation: 'after 0.33s'
scroll_reveal content: 'Mel', animation: 'wait 0.33s'
####Combining Keyword/Value Pairs You can easily combine the above pairs to create more dynamic reveal animations.
Example:
scroll_reveal content: 'Foo', animation: 'enter top move 50px'
scroll_reveal content: 'Bar', animation: 'enter top move 50px, after 0.3s'
scroll_reveal content: 'Baz', animation: 'enter top move 50px, after 0.6s'
scroll_reveal content: 'Mel', animation: 'enter top move 50px, after 0.9s'
####Passing Blocks You can easily pass a block too.
Example:
scroll_reveal animation: 'enter top move 50px' do
image_tag 'foo.jpg'
end
You can use conjoining filler words for more readable language.
from
the
and
then
but
with
,
Example:
<!-- These 4 lines are equivalent. -->
scroll_reveal content: 'Foo', animation: 'wait 0.3s, then enter left and move 40px over 2s'
scroll_reveal content: 'Bar', animation: 'enter from the left after 0.3s, move 40px, over 2s'
scroll_reveal content: 'Baz', animation: 'enter left move 40px over 2s after 0.3s'
scroll_reveal content: 'Mel', animation: 'enter left, move 40px, over 2s, wait 0.3s'
The gem itself is released under the MIT license
:pray:
FAQs
Unknown package
We found that scrollreveal-rails 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.
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.