Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Email address
css
body { background: #002b36; font-family: 'Roboto Mono', monospace; } *:focus {outline: none;} .wrap { height: 100%; width: 100%; overflow: hidden; padding: 15px; } .form-wrap { position: relative; height: 50px; width: 400px; margin: 100px auto 0; } input { color: #fff; position: absolute; width: 100%; height: 100%; left: 0; padding-top: 5px; border: none; font-size: 1em; font-weight: 200; background: none; opacity: 0; font-family: 'Roboto Mono', monospace; -webkit-transition: all 0.5s ease; transition: all 0.5s ease; } .active input{ opacity: 1; -webkit-transition: all 0.5s ease 0.5s; transition: all 0.5s ease 0.5s; } svg { position: absolute; left: 0; top: 100%; overflow: visible; fill: none; z-index: 5; } label { color: #fff; position: absolute; top: 15px; font-size: 1.3em; -webkit-transition: all 0.5s ease; transition: all 0.5s ease; } .active label { top: 0px; font-size: 1em; color: #FF5252; -webkit-transition: all 0.5s ease 0.6s; transition: all 0.5s ease 0.6s; } svg path { stroke: #fff; stroke-width: 3px; } .active + svg path { stroke: #FF5252; -webkit-transition: stroke 0.4s ease 0.6s; transition: stroke 0.4s ease 0.6s; } .input { height: 100%; width: 100%; position: relative; overflow: hidden; } .input:before { content: ""; position: absolute; height: 26px; width: 3px; right: 15px; bottom: -50px; background-color: transparent; -webkit-transform-origin: inherit; transform-origin: inherit; -webkit-transform: rotate(0deg); transform: rotate(0deg); -webkit-transition: bottom 0.4s ease 0.3s, background-color 0.2s ease 0.6s , -webkit-transform 0.4s ease; transition: bottom 0.4s ease 0.3s, background-color 0.2s ease 0.6s , -webkit-transform 0.4s ease; transition: transform 0.4s ease , bottom 0.4s ease 0.3s, background-color 0.2s ease 0.6s ; transition: transform 0.4s ease , bottom 0.4s ease 0.3s, background-color 0.2s ease 0.6s , -webkit-transform 0.4s ease; } .input:after { content: ""; position: absolute; height: 26px; width: 3px; right: 15px; bottom: -50px; visibility: hidden; background-color: transparent; -webkit-transform-origin: inherit; transform-origin: inherit; -webkit-transform: rotate(0deg); transform: rotate(0deg); -webkit-transition: visibility 0.4s ease, bottom 0.4s ease 0.3s, background-color 0.2s ease 0.6s, height 0.2s ease 0.6s, -webkit-transform 0.4s ease; transition: visibility 0.4s ease, bottom 0.4s ease 0.3s, background-color 0.2s ease 0.6s, height 0.2s ease 0.6s, -webkit-transform 0.4s ease; transition: transform 0.4s ease, visibility 0.4s ease, bottom 0.4s ease 0.3s, background-color 0.2s ease 0.6s, height 0.2s ease 0.6s; transition: transform 0.4s ease, visibility 0.4s ease, bottom 0.4s ease 0.3s, background-color 0.2s ease 0.6s, height 0.2s ease 0.6s, -webkit-transform 0.4s ease; } .valid:before { bottom: 10px; right: 16px; visibility: visible; background-color: #4CAF50 ; -webkit-transform-origin: inherit; transform-origin: inherit; -webkit-transform: rotate(40deg); transform: rotate(40deg); -webkit-transition: bottom 0.4s ease, -webkit-transform 0.4s ease 0.3s; transition: bottom 0.4s ease, -webkit-transform 0.4s ease 0.3s; transition: bottom 0.4s ease, transform 0.4s ease 0.3s; transition: bottom 0.4s ease, transform 0.4s ease 0.3s, -webkit-transform 0.4s ease 0.3s; } .valid:after { bottom: 10px; height: 15px; visibility: visible; background-color: #4CAF50; -webkit-transform-origin: inherit; transform-origin: inherit; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-transition: bottom 0.4s ease, visibility 0.4s ease 0.3s, -webkit-transform 0.4s ease 0.3s; transition: bottom 0.4s ease, visibility 0.4s ease 0.3s, -webkit-transform 0.4s ease 0.3s; transition: bottom 0.4s ease, visibility 0.4s ease 0.3s, transform 0.4s ease 0.3s; transition: bottom 0.4s ease, visibility 0.4s ease 0.3s, transform 0.4s ease 0.3s, -webkit-transform 0.4s ease 0.3s; } .invalid:before { bottom: 10px; visibility: visible; background-color: #ff5252; -webkit-transform: rotate(40deg); transform: rotate(40deg); -webkit-transition: bottom 0.4s ease, -webkit-transform 0.4s ease 0.3s; transition: bottom 0.4s ease, -webkit-transform 0.4s ease 0.3s; transition: bottom 0.4s ease, transform 0.4s ease 0.3s; transition: bottom 0.4s ease, transform 0.4s ease 0.3s, -webkit-transform 0.4s ease 0.3s; } .invalid:after { height: 26px; bottom: 10px; visibility: visible; background-color: #ff5252; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-transition: bottom 0.4s ease, visibility 0.4s ease 0.3s, -webkit-transform 0.4s ease 0.3s; transition: bottom 0.4s ease, visibility 0.4s ease 0.3s, -webkit-transform 0.4s ease 0.3s; transition: bottom 0.4s ease, visibility 0.4s ease 0.3s, transform 0.4s ease 0.3s; transition: bottom 0.4s ease, visibility 0.4s ease 0.3s, transform 0.4s ease 0.3s, -webkit-transform 0.4s ease 0.3s; }
JavaScript
'use strict'; var textInput = document.querySelector('input'); var textPath; var textDown = function() { textPath.animate({ d: "M0 1.5c150 40 300 30 400 0" }, 150, mina.easeout); }; var textUp = function() { textPath.animate({ d: "M0 1.5c150-18 300-18 400 0" }, 150, mina.easein); }; var textSame = function() { textPath.animate({ d: "M0 1.5h400" }, 200, mina.easein); }; var textRun = function() { setTimeout(textDown, 200); setTimeout(textUp, 400); setTimeout(textSame, 600); }; (function() { textInput.addEventListener('focus', function() { var svgText = Snap('svg'); var parentDiv = this.parentElement; textPath = svgText.select('path'); parentDiv.classList.add('active'); textRun(); this.addEventListener('blur', function() { var rg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.]{3,9})+\.([A-Za-z]{2,4})$/; this.value == 0 ? parentDiv.classList.remove('active') : null; !rg.test(this.value) && this.value != 0 ? (parentDiv.classList.remove('valid'), parentDiv.classList.add('invalid'), parentDiv.style.transformOrigin = "center") : rg.test(this.value) && this.value != 0 ? (parentDiv.classList.add('valid'), parentDiv.classList.remove('invalid'), parentDiv.style.transformOrigin = "bottom") : null; }); parentDiv.classList.remove('valid', 'invalid') }); })();
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>snap.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号