
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
jquery.rsSlideIt
Advanced tools
Performs a smooth interpolation between two geometric transformations.
#jquery-rsSlideIt
Performs a smooth 2D/3D transition from one HTML element A to another element B.
The transition works be progressively morphing A's transform into B's transform.
Check out a 2D demo on CodePen, and also one 3D demo with fallback to 2D for older browsers.
#Key Features
#Installation
You can install from npm:
npm install jquery.rsSlideIt --save
or directly from git:
<script src="http://rawgit.com/ruisoftware/jquery-rsSlideIt/master/src/jquery.rsSlideIt.js"></script>
or you can download the Zip archive from github, clone or fork this repository and include jquery.rsSlideIt.js
from your local machine.
You also need to download jQuery. In the example below, jQuery is downloaded from Google cdn.
#Usage
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://rawgit.com/ruisoftware/jquery-rsSlideIt/master/libs/modernizr.js"></script>
<script src="http://rawgit.com/ruisoftware/jquery-rsSlideIt/master/src/jquery.rsSlideIt.js"></script>
If you care about older browsers, primarily versions of IE prior to IE9, then replace the jQuery 2.1.4
by 1.11.3
.
The Modernizr library should be loaded before the plugin.
jquery.rsSlideIt.js should be loaded after the jQuery and Modernizr libraries. In production environment, it is recommended the use of the minimized version jquery.rsSlideIt.min.js
.
Create a blocked element with slide elements inside.
<div id="container">
<img id="slide1" src="http://placehold.it/200?text=slide1">
<img id="slide2" src="http://placehold.it/200?text=slide2">
<img id="slide3" src="http://placehold.it/200?text=slide3">
<img id="slide4" src="http://placehold.it/200?text=slide4">
</div>
<button id="prev">previous</button>
<button id="next">next</button>
The above markup represents a viewport with 4 slides.
Any markup can be used. Your container does not have to be a div
and your slides do not have to img
.
Create plugin instance and set previous/next events
$(function () {
$("#container").rsSlideIt({
width: 500,
height: 300
});
$("#prev, #next").click(function () {
$("#container").rsSlideIt('transition', {
slide: this.id // destination slide is either 'prev' or 'next', depending on which button is pressed
});
});
});
#slide1 {
transform: rotate(30deg);
}
#slide3 {
transform: rotate(-30deg) skew(150deg) translateY(100px);
}
During the plugin initialization, the plugin performs two tasks:
div
element between your container and the slides, i.e., it changes the DOM from<div id="container">
<img id="slide1" src="http://placehold.it/200?text=slide1">
<img id="slide2" src="http://placehold.it/200?text=slide2">
<img id="slide3" src="http://placehold.it/200?text=slide3">
<img id="slide4" src="http://placehold.it/200?text=slide4">
</div>
to
<div id="container">
<div> <!-- new div element -->
<img id="slide1" src="http://placehold.it/200?text=slide1">
<img id="slide2" src="http://placehold.it/200?text=slide2">
<img id="slide3" src="http://placehold.it/200?text=slide3">
<img id="slide4" src="http://placehold.it/200?text=slide4">
</div>
</div>
Let's call this new div
the world.
When a request to make a transition to a slideN is received, the plugin smoothly changes the world transformation to the slideN reverse transformation, e.g., if your slides are
#slide1 { transform: none; }
#slide2 { transform: rotate(30deg); }
#slide3 { transform: rotate(25deg) skew(45deg); }
#slide4 { transform: skew(-15deg); }
then when a transition is done:
rotate(0)
to rotate(-30deg)
.rotate(-30deg) skew(0)
to rotate(-25deg) skew(-45deg)
.rotate(-25deg) skew(-45deg)
to rotate(0) skew(15deg)
.skew(15deg)
to skew(0)
.The plugin uses Modernizr for CSS3 feature detection. If Modernizr is not loaded (see Add Script), the plugin assumes that your browser does not support the latest CSS3 features and resorts to Javascript fallbacks, even on modern browsers. Thus it is highly recommended to include Modernizr. Specifically, the Modernizr properties required by the plugin are cssanimations and csstransforms3d.
If 3D transformations are not supported by the browser, the plugin adds a fallback class to the container element, which is by default no3D
.
So, if you 3D slide is rotateX(45deg) rotateZ(5deg)
you can fallback it to 2D, by adding another CSS rule:
#mySlide { transform: rotateX(45deg) rotateZ(5deg); } /* 3D transformation */
.no3D #mySlide { transform: rotate(5deg); } /* 2D fallback for older browsers */
Please note, that if Modernizr is not loaded on browsers that support 3D transformations, and no 2D CSS fallback is defined, the 3D transformations will still render correctly, but the plugin will make 2D transitions, because the plugin relies on what is returned by Modernizr.csstransforms3d, and if Modernizr is missing, it means returning false.
Here is one 3D demo with a fallback to 2D on older browsers. You can see a preview here on how the 3D demo looks like in older browsers.
If CSS animations are not supported by the browser, the plugin gracefully degradates to javascript animation using requestAnimationFrame(). Still, if requestAnimationFrame() is not supported by the browser, then a jQuery.animate() based animation is used instead.
This project is licensed under the terms of the MIT license
Please use the issue tracker to report any bugs or file feature requests.
Please refer to the Contribution page from more information.
FAQs
Performs a smooth interpolation between two geometric transformations.
The npm package jquery.rsSlideIt receives a total of 0 weekly downloads. As such, jquery.rsSlideIt popularity was classified as not popular.
We found that jquery.rsSlideIt 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 flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.