加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
visual-studio-code-snippet.json 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
Ivan Boyko 提交于 2017-03-17 16:57 . Modules added
"Animated icon": {
"prefix": "anic",
"body": [ "<!--${1:id} animated icon begins-->",
"<div id='icons8-${1:id}' class='bodymovin'></div>",
"",
"<script>",
"",
" (function() {",
" var anime;",
" var state = 0;",
" var name = '${1:id}';",
"",
" function start() {",
" if (state % 2 == 0) {",
" // All animations have 28 frames:",
" // - First 14 ones for changing the satate",
" // - And the next 14 back to return to the original state",
" anim.playSegments([0, 13], true);",
" } else {",
" anim.playSegments([14, 27], true);",
" }",
" state++;",
" }",
"",
" $(document).ready(function () {",
" // Feel free to handle any other events here, not just click or hover",
" $('#icons8-'+name).click(start);",
" $('#icons8-'+name).hover(start);",
"",
" anim = bodymovin.loadAnimation({",
" container: document.getElementById('icons8-'+name),",
" renderer: 'svg',",
" loop: false,",
" autoplay: false,",
" path: 'icons/'+name+'.json'",
" });",
" });",
" })();",
"",
"</script>",
"<!--${1:id} animated icon ends-->"]
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化