Gathering detailed insights and metrics for img-comparison-slider
Gathering detailed insights and metrics for img-comparison-slider
Gathering detailed insights and metrics for img-comparison-slider
Gathering detailed insights and metrics for img-comparison-slider
npm install img-comparison-slider
96.6
Supply Chain
100
Quality
76.8
Maintenance
100
Vulnerability
100
License
@img-comparison-slider/react-v8.0.2
Published on 06 May 2024
img-comparison-slider-v8.0.6
Published on 09 Dec 2023
img-comparison-slider-v8.0.5
Published on 26 Nov 2023
img-comparison-slider-v8.0.4
Published on 10 Nov 2023
img-comparison-slider-v8.0.3
Published on 10 Nov 2023
img-comparison-slider-v8.0.2
Published on 10 Nov 2023
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
666 Stars
414 Commits
48 Forks
8 Watching
5 Branches
10 Contributors
Updated on 28 Nov 2024
TypeScript (62.02%)
JavaScript (16.55%)
SCSS (14.2%)
HTML (3.26%)
Shell (2.98%)
CSS (0.99%)
Cumulative downloads
Total Downloads
Last day
21.4%
4,568
Compared to previous day
Last week
2.4%
22,701
Compared to previous week
Last month
17.6%
100,456
Compared to previous month
Last year
61.2%
921,743
Compared to previous year
Usage examples: https://img-comparison-slider.sneas.io/examples.html
1<script 2 defer 3 src="https://cdn.jsdelivr.net/npm/img-comparison-slider@8/dist/index.js" 4></script> 5<link 6 rel="stylesheet" 7 href="https://cdn.jsdelivr.net/npm/img-comparison-slider@8/dist/styles.css" 8/> 9 10<img-comparison-slider> 11 <img slot="first" src="before.jpg" /> 12 <img slot="second" src="after.jpg" /> 13</img-comparison-slider>
Besides the default HTMLElement
attributes such as class
, tabindex
, title
, etc., img-comparison-slider
supports:
Attribute | Description | Default | Available |
---|---|---|---|
value | Position of the divider in percents. | 50 | 0..100 |
hover | Automatically slide on mouse over. | false | |
direction | Set slider direction. | horizontal | horizontal , vertical |
nonce | Define nonce which gets passed to inline style. | ||
keyboard | Enable/disable slider position control with the keyboard. | enabled | enabled , disabled |
handle | Enable/disable dragging by handle only. | false | true , false |
The component emits slide
event when the slider position is changed by user.
Some styling techniques and ideas can be found in examples.
The component elements like the default handle or the separator line could be styled using CSS3 variables.
Example:
1<style type="text/css"> 2 img-comparison-slider { 3 --divider-width: 2px; 4 --divider-color: #c0c0c0; 5 --default-handle-opacity: 0.3; 6 } 7</style>
Variable | Description | Default value | Example value |
---|---|---|---|
--divider-width | Width of the vertical line separating both images | 1px | 1em |
--divider-color | Color of the vertical line separating the two images | #fff | rgba(0, 0, 0, 0.5) |
--divider-shadow | Shadow cast by the vertical line separating the two images | none | 0px 0px 5px rgba(0, 0, 0, 0.5) |
--handle-position-start | Handle position on the divider axis. In case the handle must be displaced off the center | 50% | |
--default-handle-width | Width of the default handle | 50px | |
--default-handle-color | Color of the default handle | #fff | rgba(0, 0, 0, 0.5) |
--default-handle-opacity | Opacity of the default handle | 1 | 0.3 |
--default-handle-shadow | Shadow cast by the default handle | none | 0px 0px 5px rgba(0, 0, 0, 1) |
The handle of the component can be changed by assigning the attribute slot="handle"
to any element within img-comparison-slider
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/28 approved changesets -- score normalized to 0
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
22 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More