在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):rikschennink/shiny开源软件地址(OpenSource Url):https://github.com/rikschennink/shiny开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):Shiny, Simulating Reflections for Mobile WebsitesAdd shiny reflections to text, backgrounds, and borders on devices that support the Use a mobile device, preferably iPhone in portrait mode at the moment Todo
InstallationInstall from npm:
Or download APIThere's currently only one API call to make and it's If the second argument is not supplied Shiny will render a radial background gradient with a white center and a transparent outer ring. // No config supplied, select element by class
shiny('.my-shiny-element');
// Select multiple elements
shiny('.my-shiny-element, #my-other-shiny-element');
// Configuration object, see below for details
shiny('.my-shiny-element', { /* config here */ });
// Pass element object
const myElement = document.querySelector('my-shiny-element');
shiny(myElement, { /* config here */ });
// Pass array of elements
shiny([myElement, myOtherElement], { /* config here */ }); Usage<!-- The element you want to make shiny -->
<div class="my-shiny-element">Hello World</div>
<!-- Include the library -->
<script src="shiny.umd.js"></script>
<!-- Initialize the SHINYNESS -->
<script>
shiny('.my-shiny-element', {
// type of shiny to render,
// 'background', 'border', or 'text'
type: 'background',
gradient: {
// type of gradient
// 'linear' or 'radial'
type: 'radial',
// angle of gradient when type is linear
angle: '110deg',
// flip axis movement
flip: {
x: true,
y: false
},
// colors to use
colors: [
// offset, color, opacity
// ! don't pass rgba or hsla colors, supply the opacity seperately
[0, '#fff', 1], // white at 0%
[1, '#fff', 0], // to fully transparent white at 100%
]
},
// optional pattern fill
pattern: {
type: 'noise', // only 'noise' for now
opacity: .5
}
});
</script> |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论