Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
copy
css
html { height: 100%; background: #1A2A3A; color: #FFF; } body { font-family: Roboto, sans-serif; display: flex; justify-content: center; align-items: center; flex-direction: column } .svg { border-radius: 50% 50%; padding: 0px; width: 50vmin; height:50vmin; background: #0D47A1; display: flex; justify-content: center; align-items: center; } svg { width: 50%; height:50%; stroke:#B0BA23; stroke-width:4; stroke-linecap: round; fill:none; } .btnSvg { width:20px; height:20px; stroke-width:10; } svg .use { opacity: 0; transform: scale(.8) rotate(.5turn); transform-origin: center center; transition: all .5s ease; } svg .use.active { opacity: 1; transform: scale(1); transition: all .5s ease; transition-delay: .2s; } .buttons { margin-top: 10vh; display:flex; flex-wrap: wrap; justify-content: center; flex-grow: 1; } button { border:0; background: #0D47A1; height: 30px; width: 30px; color: #fff; cursor:pointer; border-radius: 3px; margin: 2px; display:flex; justify-items:center; align-items:center; } .code { background-color: #7986CB; margin-top:5vh; min-width: 80vw; border-radius: 5px; position:relative; } .code pre { padding:10px; } button.copy { position:absolute; width:auto; height:auto; padding: 10px 15px; right:0px; top:0px; } .dwf { position:absolute; bottom:4px; right:10px; }
JavaScript
var btns = Array.from(document.querySelectorAll(".btn")); var codeBox = document.querySelector(".code pre"); var copyBtn = document.querySelector(".copy"); setState('cross'); copyBtn.addEventListener('click', (e) => { const selection = window.getSelection(); const range = document.createRange(); range.selectNodeContents(codeBox); selection.removeAllRanges(); selection.addRange(range); try { document.execCommand('copy'); selection.removeAllRanges(); } catch(e) { alert('Copy not working use Strg-C instead'); } }); btns.forEach( (btn) => { btn.addEventListener('click', (e)=>{ var activeIcon = document.querySelector(".use.active"); activeIcon.classList.remove("active"); setState(btn.dataset.icon); }); }); function setState(iconName) { var icon = document.querySelector('.'+iconName); var code = document.querySelector('#'+iconName); icon.classList.add('active'); console.dir(codeBox); codeBox.innerText = "
\n" + code.outerHTML + "\n
"; }
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>基本的SVG图标-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号