image2css:使用 box-shadow 将图像转换为 CSS

时间:2021-07-05 11:41:15
【文件属性】:
文件名称:image2css:使用 box-shadow 将图像转换为 CSS
文件大小:17KB
文件格式:ZIP
更新时间:2021-07-05 11:41:15
JavaScript 自动将图像转换为 CSS 这是一个实验,所以,可能你不想要,你不会在网络上使用图像作为框阴影,对吧? 所以,! ! 它是如何工作的? image2css 在canvas 元素中,并从canvas 中 (imageData 是一个大数组,包含图像每个像素的RGBA),我们寻找每个像素,然后我们! 我们也会在适当的时候使用 RGBA 或 HEX(以提高最终尺寸并保持图像质量),image2css 也不使用 0 值中的单位(以提高最终尺寸),所有 alpha 0 像素都不会写入box-shadow 规则(改善最终尺寸) 如何使用 嗯,你可以在任何地方使用 bower bower install image2css --save 并在您的页面中包含 de lib < script src =" bower_components/image2css/lib/image2css.js "
【文件预览】:
image2css-master
----.jshintrc(510B)
----.gitignore(50B)
----package.json(849B)
----Gruntfile.js(1KB)
----css()
--------style.css(1010B)
----scripts()
--------script.js(2KB)
----README.md(3KB)
----tests()
--------pistol.png(781B)
--------test.js(3KB)
--------index.html(639B)
----index.html(934B)
----lib()
--------image2css.js(3KB)
----bower.json(650B)
----img()
--------form-me.png(7KB)
----.editorconfig(99B)

网友评论