Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
smartphoto
Advanced tools
The most easy to use responsive image viwer especially for mobile devices
See https://appleple.github.io/SmartPhoto/ for complete docs and demos
If you are Japasese, See here https://www.appleple.com/blog/javascript/smartphoto-js.html instead.
via npm
npm install smartphoto --save
or yarn
yarn add smartphoto
require
const smartPhoto = require('smartphoto');
smartphoto.js
document.addEventListener('DOMContentLoaded',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>
document.addEventListener('DOMContentLoaded',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 | true |
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 |
document.addEventListener('DOMContentLoaded',function(){
new smartPhoto(".js-img-viwer",{
arrows: false,
nav: false
});
});
You can choose if you want to scale images to fit/fill
document.addEventListener('DOMContentLoaded',function(){
new smartPhoto(".js-img-viwer",{
resizeStyle: 'fit'
});
});
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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.