密码框输入密码隐藏显示切换动画效果
代码语言:html
所属分类:表单美化
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css?family=Lato:400,700&display=swap"); * { box-sizing: border-box; padding: 0; margin: 0; } body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='hsl(0, 0%25, 20%25)' opacity='0.1' width='20' height='20' viewBox='-5 -5 10 10'%3E%3Ccircle id='dot' r='1' /%3E%3Cuse href='%23dot' x='5' y='5' /%3E%3Cuse href='%23dot' x='-5' y='5' /%3E%3Cuse href='%23dot' x='5' y='-5' /%3E%3Cuse href='%23dot' x='-5' y='-5' /%3E%3C/svg%3E"), hsl(0, 0%, 95%); font-family: "Lato", sans-serif; background-size: 10px; } body > * + * { margin-top: 2rem; } /* svg */ svg { display: block; width: 90vw; max-width: 250px; height: auto; margin: 1rem; color: hsl(0, 0%, 10%); } /* when the .hide class is added to the svg scale the elements to show the closed eye */ svg.hide .eyelid, svg.hide .brows { transform: scaleY(-1); } svg.hide .eyeball { transform: scale(0); } /* for browsers supporting the d property transition the properties to have the eyes close/open */ @supports (d: path("")) { svg .eyelid, svg .brows path, svg .eyeball { transition: transform 0.5s ease-in-out, d 0.5s ease-in-out; } svg.hide .eyelid, svg.hide .brows, svg.hide .eyeball { transform: initial; } svg.hide .eyelid { d: path("M -30 0 c 15 20 45 20 60 0"); } svg.hide .eyeball { transform: scaleY(0); } svg.hide .brows path:first-of-type { .........完整代码请登录后点击上方下载按钮下载查看
网友评论0