zoukankan      html  css  js  c++  java
  • CSS3实现直播滚动特效

    import livingScroll from '@/components/living-scroll/living-scroll.vue';

    components:{
    livingScroll
    },

    <livingScroll color="#fff"  backgroundColor="#ffa029" title="直播中"></livingScroll>

    <template>
    <view class="">
    <view :style="{ 'background-color': backgroundColor , 'color' : color}" class="dh">
    <view style="display: flex;" class="">
    <view :style="{ 'background-color': color}" class="dh1"></view>
    <view :style="{ 'background-color': color}" class="dh2"></view>
    <view :style="{ 'background-color': color}" class="dh3"></view>
    </view>
    <view :style="{'color' : color }" class="">{{title}}</view>
    </view>
    </view>
    </template>

    <script>
    export default {
    props: {
    title: {
    type: String,
    default: ""
    },
    color: {
    type: String,
    default: "#fff"
    },
    backgroundColor: {
    type: String,
    default: "#ffa029"
    },
    },
    data() {
    return {

    }
    },
    mounted() {

    },
    computed: {

    },
    methods: {

    }
    }
    </script>

    <style>
    .dh{
    display: flex;
    position: absolute;
    right: 10upx;top: 10upx;
    background-color: #FFA029;
    z-index: 99999;
    color: #fff;
    font-size: 26upx;
    padding: 0 10upx;
    border-radius: 10upx;
    }
    .dh1{
    4upx;
    -webkit-animation: .8s .1s living linear infinite backwards normal;
    animation: .8s .1s living linear infinite backwards normal;
    -webkit-animation-delay: -1.1s;
    }
    .dh2{
    4upx;
    margin-left: 4upx;
    -webkit-animation: .8s .3s living linear infinite backwards normal;
    animation: .8s .3s living linear infinite backwards normal;
    -webkit-animation-delay: -1.3s;
    }
    .dh3{
    4upx;
    margin-left: 4upx;
    margin-right: 4upx;
    -webkit-animation: .8s .6s living linear infinite backwards normal;
    animation: .8s .6s living linear infinite backwards normal;
    -webkit-animation-delay: -1.6s;
    }
    @-webkit-keyframes living{
    0%{-webkit-transform:scaleY(0.5);transform:scaleY(0.5);-webkit-transform-origin:0 10px;transform-origin:0 10px}
    50%{-webkit-transform:scaleY(.3);transform:scaleY(.3);-webkit-transform-origin:0 10px;transform-origin:0 10px}
    100%{-webkit-transform:scaleY(0.5);transform:scaleY(0.5);-webkit-transform-origin:0 10px;transform-origin:0 10px}
    }
    @keyframes living{
    0%{-webkit-transform:scaleY(0.5);-ms-transform:scaleY(0.5);transform:scaleY(0.5);-webkit-transform-origin:0 10px;-ms-transform-origin:0 10px;transform-origin:0 10px}
    50%{-webkit-transform:scaleY(.3);-ms-transform:scaleY(.3);transform:scaleY(.3);-webkit-transform-origin:0 10px;-ms-transform-origin:0 10px;transform-origin:0 10px}
    100%{-webkit-transform:scaleY(0.5);-ms-transform:scaleY(0.5);transform:scaleY(0.5);-webkit-transform-origin:0 10px;-ms-transform-origin:0 10px;transform-origin:0 10px}
    }

    </style>

      

  • 相关阅读:
    模块三 GO语言实战与应用-条件变量sync.Cond(上)
    模块三 GO语言实战与应用-sync.Mutex与sync.RWMutex
    模块三 GO语言实战与应用-更多的测试手法
    模块三 GO语言实战与应用-测试的基本规则和流程(下)
    模块三 GO语言实战与应用-测试的基本规则和流程(上)
    模块二 GO语言进阶技术-PANIC函数、RECOVER函数以及DEFER语句(下)
    CentOS7 相关命令-sunziren
    Thymeleaf如何回填复选框?-sunziren
    Thymeleaf中如何判断字符串是否包含或者不包含某个子串?-sunziren
    MySQL Innodb Engine--修改数据时先写Buffer Pool还是先写Redo Log
  • 原文地址:https://www.cnblogs.com/daifuchao/p/13852895.html
Copyright © 2011-2022 走看看