微信红包拆红包效果

<!doctype html>
<html>

    <head>
        <meta charset="UTF-8">
        <title></title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <link href="css/mui.min.css" rel="stylesheet" />
        <style type="text/css">

.container{
    text-align: center;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 15px 5px;
    background-color: rgba(0,0,0,0.3);
    height: 100%;
    position: absolute;
}
.hongbao{
    height: 450px;
    background: #A5423A;
    width: 300px;
    left: 0;
    top: 0;
    border-radius: 10px;
    margin: 0 auto;
}
.topcontent{
    height: 280px;
    border: 1px solid #BD503A;
    background-color: #BD503A;
    border-radius: 10px 10px 50% 50% / 10px 10px 15% 15%;
    box-shadow: 0px 4px 0px -1px rgba(0,0,0,0.2);
}
.avatar{
    position: relative;
}
.avatar span{
    position: absolute;
    top: 10px;
    left: 15px;
    -webkit-transform: rotate(45deg);
        -ms-transform: rotate(45deg);
            transform: rotate(45deg);
    font-size: 2em;
}
#close{
    color: rgba(0,0,0,0.5);
}
.avatar img{
    border: 1px solid #BD503A;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10%;
    width: 50px;
    height: 50px;
}
.topcontent h2{
    margin-top: 15px ;
    font-size: 16px;
    margin-bottom: 0px;
        color: #fffab5;
}
.text{
    color: #fffab5;
    font-size: 13px;

}
.description{
    margin: 30px 0;
    font-size: 20px;
    font-weight: 600;
    color: #fffab5;
}
#chai{
    width: 100px;
    height: 100px;
    border: 1px solid #FFA73A;
    background-color: #FFA73A;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    display: inline-block;
    margin-top: -50px;
    box-shadow: 0px 4px 0px 0px rgba(0, 0, 0, 0.2);
}
#chai span{
    margin-top: 35px;
    display: inline-block;
    font-size: 40px;
    color: #000000;
}
.rotate{
    -webkit-animation: anim .6s infinite alternate;
        -ms-animation: anim .6s infinite alternate;
            animation: anim .6s infinite alternate;
}
@-webkit-keyframes anim {
    from { -webkit-transform: rotateY(180deg); }
    to { -webkit-transform: rotateY(360deg); }
}
@-ms-keyframes anim {
    from { -ms-transform: rotateY(180deg); }
    to { -ms-transform: rotateY(360deg); }
}
@keyframes anim {
    from { transform: rotateY(180deg); }
    to { transform: rotateY(360deg); }
}
        </style>
    </head>

    <body>
        <div class="container" id="container">
    <div class="hongbao">
        <div class="topcontent">
            <div class="avatar">
                <span id="close">+</span>
                <img src="http://img3.imgtn.bdimg.com/it/u=3287497184,4066980060&fm=214&gp=0.jpg">               
            </div>
            <h2>最值</h2>
            <span class="text">给你发了一个红包</span>
            <div class="description">恭喜发财,大吉大利</div>
        </div>
        <div class="chai" id="chai">
            <span></span>
        </div>
    </div>
</div>







        <script src="js/mui.min.js"></script>
        <script type="text/javascript">

            mui.init()
            var oChai = document.getElementById("chai");
var oClose = document.getElementById("close");
var oContainer = document.getElementById("container");

oChai.onclick = function (){
    oChai.setAttribute("class", "rotate");
}
oClose.onclick = function (){
    oContainer.style.display = "none";
}


        </script>
    </body>

</html>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值