Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
smartphoto
Advanced tools
The most easy to use responsive image viwer especially for mobile devices
via npm
npm install smartphoto --save
or yarn
yarn add smartphoto
require
const smartPhoto = require('smartphoto');
smartphoto.js
window.addEventListener('load',function(){
new smartPhoto(".js-img-viwer");
});
jquery-smartphoto.js
$(function(){
$(".js-img-viwer").smartPhoto();
});
<a href="./assets/large-kuma.jpg" class="js-img-viwer" data-caption="くま" data-id="kuma">
<img src="./assets/kuma.jpg" width="360" data-group="0"/>
</a>
<a href="./assets/large-rakuda.jpg" class="js-img-viwer" data-caption="ラクダ" data-id="rakuda">
<img src="./assets/rakuda.jpg" width="360" data-group="0"/>
</a>
<a href="./assets/large-sai.jpg" class="js-img-viwer" data-caption="サイ" data-id="sai">
<img src="./assets/sai.jpg" width="360" data-group="0"/>
</a>
<link rel="stylesheet" href="./css/smartphoto.min.css">
<script src="./js/smartphoto.js"></script>
<script>
window.addEventListener('load',function(){
new smartPhoto(".js-img-viwer");
});
</script>
variable | description | default |
---|---|---|
arrows | prev/next arrows | true |
nav | navigation images at the bottom | true |
useOrientationApi | use accelerometer to move images | false |
resizeStyle | resize images to fill/fit on the screen | 'fill' |
animationSpeed | animation speed when switching images | 300 |
forceInterval | frequency to apply force to images | 10 |
When you want to hide arrows and nav
window.addEventListener('load',function(){
new smartPhoto(".js-img-viwer",{
arrows: false,
nav: false
});
});
variable | description | default |
---|---|---|
$animation-speed | animation speed when switching images | .3s |
$backdrop-color | backdrop color when viewing images | rgba(0, 0, 0, 1) |
$header-color | header color | rgba(0, 0, 0, .2) |
https://github.com/appleple/SmartPhoto
Code and documentation copyright 2017 by appleple, Inc. Code released under the MIT License.
FAQs
smartphoto
The npm package smartphoto receives a total of 4,915 weekly downloads. As such, smartphoto popularity was classified as popular.
We found that smartphoto 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.