Gathering detailed insights and metrics for gatsby-image-background-slider
Gathering detailed insights and metrics for gatsby-image-background-slider
Gathering detailed insights and metrics for gatsby-image-background-slider
Gathering detailed insights and metrics for gatsby-image-background-slider
npm install gatsby-image-background-slider
Typescript
Module System
Min. Node Version
Node Version
NPM Version
19.6
Supply Chain
73
Quality
62.7
Maintenance
25
Vulnerability
90.1
License
JavaScript (55.19%)
CSS (39.37%)
HTML (5.44%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
60,068
Last Day
1
Last Week
102
Last Month
364
Last Year
6,674
MIT License
17 Stars
15 Commits
5 Forks
3 Watchers
5 Branches
2 Contributors
Updated on Sep 07, 2024
Minified
Minified + Gzipped
Latest Version
0.0.4
Package Id
gatsby-image-background-slider@0.0.4
Size
9.66 kB
NPM Version
6.4.1
Node Version
10.15.3
Published on
Aug 08, 2020
Cumulative downloads
Total Downloads
Last Day
-50%
1
Compared to previous day
Last Week
131.8%
102
Compared to previous week
Last Month
-33.1%
364
Compared to previous month
Last Year
0%
6,674
Compared to previous year
8
28
Lazy-loaded background images, with a simple fade transition between them, using
gatsby-image
. Inspired byreact-background-slider
, except for—well—the obvious.
I wanted to have a nice, simple slideshow of high-resolution background images. I also didn't want to lock the main thread with ugly chunks of said images. Thus, I resorted to making the best reinvention of the wheel I could muster for a background image slideshow with lazy-loading.
1npm install --save gatsby-image-background-slider
component file (i.e. layout.js)
1import React from 'react' 2 3import BackgroundSlider from 'gatsby-image-background-slider' 4 5const Layout = ({ children }) => ( 6 <> 7 <main>{children}</main> 8 <BackgroundSlider 9 query={useStaticQuery(graphql` 10 query { 11 backgrounds: allFile (filter: {sourceInstanceName: {eq: "backgrounds"}}){ 12 nodes { 13 relativePath 14 childImageSharp { 15 fluid (maxWidth: 4000, quality: 100){ 16 ...GatsbyImageSharpFluid 17 } 18 } 19 } 20 } 21 } 22 `)} 23 /> 24 </> 25)
gatsby-config.js
1plugins: [ 2 { 3 resolve: `gatsby-source-filesystem`, 4 options: { 5 name: `backgrounds`, 6 path: `${__dirname}/src/bg`, // wherever background images are stored 7 }, 8 } 9]
component file (i.e. layout.js)
1import React from 'react' 2 3import BackgroundSlider from 'gatsby-image-background-slider' 4 5const Layout = ({ children }) => ( 6 <> 7 <main>{children}</main> 8 <BackgroundSlider 9 query={useStaticQuery(graphql` 10 query { 11 backgrounds: allFile (filter: {sourceInstanceName: {eq: "backgrounds"}}){ 12 nodes { 13 relativePath 14 childImageSharp { 15 fluid (maxWidth: 4000, quality: 100){ 16 ...GatsbyImageSharpFluid 17 } 18 } 19 } 20 } 21 } 22 `)} 23 initDelay={2} // delay before the first transition (if left at 0, the first image will be skipped initially) 24 transition={4} // transition duration between images 25 duration={8} // how long an image is shown 26 // specify images to include (and their order) according to `relativePath` 27 images={["dog.jpg", "cat.jpg", "giraffe.jpg", "tasmanian devil.jpg", "gabe.jpg"]} 28 29 // pass down standard element props 30 style={{ 31 transform: "rotate(-2deg) scale(.9)", 32 }} 33 > 34 {/* Captions in sync with background images*/} 35 <div>Woof</div> 36 <div>Meow</div> 37 <>{/* Giraffes don't talk; [they aren't real](https://chivomengro.com/2017/10/23/the-truth-comes-out-giraffes-are-a-hoax/) */}</> 38 <a href="https://en.wikipedia.org/wiki/Tasmanian_devil#Conservation_status"> 39 I could use a hand 40 </a> 41 <div>I need to find better hobbies</div> 42 </BackgroundSlider> 43 </> 44)
gatsby-config.js
1plugins: [ 2 { 3 resolve: `gatsby-source-filesystem`, 4 options: { 5 name: `backgrounds`, 6 path: `${__dirname}/src/bg`, // wherever background images are stored 7 }, 8 } 9]
MIT © GabeEddyT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/10 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 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
185 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-17
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