js+css+svg实现实时显示个性签名字体效果的输入框代码
代码语言:html
所属分类:表单美化
代码描述:js+css+svg实现实时显示个性签名字体效果的输入框代码,注意,只支持英文。
代码标签: js css svg 实时 显示 个性 签名 字体 效果 输入框 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400..700;1,400..700&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap" rel="stylesheet">
<style>
body {
background: url('//repo.bfw.wiki/bfwrepo/image/66d30c867a7c8.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400..700;1,400..700&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');
.modal {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
display: flex;
flex-direction: column;
align-items: stretch;
gap: 36px;
width: 380px;
height: 52px;
padding: 24px;
border-radius: 40px;
overflow: hidden;
background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.2) 100%);
box-shadow: 0 0 16px 0 rgba(0,0,0,0);
transition: 0.4s ease height, 0.4s ease padding, 0.2s border-radius, 0.6s ease box-shadow;
}
.modal:hover {
box-shadow: 0 24px 48px -24px rgba(0,0,0,0.025);
}
.modal.active {
height: 160px;
padding: 32px;
border-radius: 48px;
}
.field-wrapper {
position: relative;
display: flex;
flex-direction: column;
align-items: stretch;
}
.field {
font-family: "Instrument Sans", sans-serif;
font-optical-sizing: auto;
font-style: normal;
/* font-variation-settings: "wdth" 100; */
font-size: 20px;
display: flex;
align-items: center;
min-height: 48px;
border-radius: 16px;
border: 1px solid rgba(0,0,0,0.05);
padding: 0 12px 2px 12px;
background: none;
color: #000;
outline: none;
transition: border 0.2s;
}
.active .field {
border: 1px solid rgba(0,0,0,0.5);
}
.field::placeholder {
opacity: 0.5;
color: #000;
}
.sign, .signed-by {
font-family: "JetBrains Mono", monospace;
font-optical-sizing: auto;
font-style: normal;
text-transform: uppercase;
font-size: 14px;
letter-spacing: 0.02em;
}
.active .signed-by {
opacity: 1;
}
.sign {
position: absolute;
right: 4px;
top: 50%;
transform: translateY(-50%);
display: flex;
gap: 8px;
align-items: center;
height: 44px;
border-radius: 12px;
padding: 0 14px 2px 12px;
background: #000;
color: #fff;
border: none;
opacity: 0.2;
transition: 0.2s;
}
.active .sign {
opacity: 1;
}
.signature {
border-bottom: 1px solid rgba(0,0,0,0.25)
}
.letter-bank {
display: none;
}
.signed-by {
color: rgba(0,0,0,0.5);
opacity: 0;
padding-bottom: 2px;
transition: 0.2s ease;
}
.signature-main {
display: flex;
min-height: 51px;
flex-flow: wrap;
justify-content: start;
}
.signature-main svg path {
stroke-linejoin: round;
stroke-linecap: round;
stroke-width: 1;
stroke: #000;
transition: 0.2s stroke-dashoffset;
}
.up, .lo {
max-height: 51px;
}
/* letter boxes */
.up.a {
margin: 0 -10px 0 -7px;
}
.up.b {
margin: 0 -5px 0 -13px;
}
.up.c {
margin: 0 -5px 0 -6px;
}
.up.d {
margin: 0 -6px 0 -6px;
}
.up.e {
margin: 0 -10px 0 -8px;
}
.up.f {
margin: 0 -13px 0 -5px;
}
.up.g {
margin: 0 0px 0 -6px;
}
.up.h {
margin: 0 -8px 0 -6px;
}
.up.i {
margin: 0 -25px 0 -16px;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0