jquery模仿手机端移动端微信发送语音录音松开上滑取消动画效果代码

代码语言:html

所属分类:表单美化

代码描述:jquery模仿手机端移动端微信发送语音录音松开上滑取消动画效果代码

代码标签: 移动 端微 发送 语音 录音 开上 取消 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML仿微信录音动画效果</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }
        
        html, body {
            background: #fff;
        }
        
        .btn {
            position: fixed;
            bottom: 0;
            width: 100%;
            height: 60px;
            background: #eee;
        }
        
        .btn input {
            width: 100%;
            height: 100%;
            font: 20px/60px 'microsoft yahei';
        }
        
        .blackBoxSpeak {
            width: 176px;
            height: 176px;
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            margin: auto;
            background: url("//repo.bfw.wiki/bfwrepo/image/60d57592c17b9.png") no-repeat 28px 16px/65px 104px,
            url("//repo.bfw.wiki/bfwrepo/image/60d575b15ba53.png") no-repeat 111.2px 32px/28.8px 88px;
            
            background: rgba(0, 0, 0, .7);
            display: none;
            border-radius: 12px;
        }
        
        .blackBoxSpeakConent {
            font: 14.4px '微软雅黑 Light';
            position: absolute;
            left: 0;
            right: 0;
            bottom: 12px;
            display: block;
            text-align: center;
            width: 90%;
            padding: 8px 0;
            margin: auto;
            color: #ffffff;
            font-weight: 200;
            border-radius: 4px;
        }
        
        .blackBoxPause {
            width: 176px;
            height: 176px;
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            margin: auto;
            background: url("//repo.bfw.wiki/bfwrepo/image/60d57592c17b9.png") no-repeat 28px 16px/65px 104px,
            url("//repo.bfw.wiki/bfwrepo/image/60d575b15ba53.png") no-repeat 111.2px 32px/28.8px 88px;
            
            background: rgba(0, 0, 0, .7);
            display: none;
            border-radius: 12px;
        }
        
        .blackBoxPauseContent {
            font: 14.4px '微软雅黑 Light';
            position: absolute;
            left: 0;
            right: 0;
            bottom: 12px;
            display: block;
            text-align: center;
            width: 90%;
            padding: 8px 0;
            margin: auto;
            color: #ffffff;
            font-weight: 200;
            border-radius: 4px;
        }
    </style>
</head>
<body>

<h3>只支持移动端预览</h3>
<!-- 底部按住说话按钮 -->
<div class="btn">
    <input type="button" id="bt_recoding" value="按住 说话">
</div>

<!-- 中间黑框 录音状态 -->
<div class="blackBoxSpeak">
    <p class="blackBoxSpeakConent">手指上划,取消发送</p>
</div>

<!-- 中间黑框 暂停状态 -->
<div class="blackBoxPause">
    <p class="blackBoxPauseContent" style="background: red">松开手指, 取消发送</p>
</div>



<script type="text/javascript">
    //录音按钮
    var bt_recoding = document.getElementById("bt_recoding");

    //中间黑色边框和里面的内容(录音状态)
    var blackBoxSpeak = document.querySelector(".blackBoxSpeak");
    blackBoxSpeak.style.background = "url('//repo.bfw.wiki/bfwrepo/image/60d57592c17b9.png') no-repeat 28 16px/65px 104px, url('//repo.bfw.wiki/bfwrepo/image/60d575b15ba53.png') no-repeat 111.2px 32px/28.8px 88px";
    blackBoxSpeak.style.backgroundColor.........完整代码请登录后点击上方下载按钮下载查看

网友评论0