• 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>

      

  • 相关阅读:
    《JS权威指南学习总结--3.8类型转换》
    php基础-1
    django的url分配和url捕获参数
    Django项目的创建和设计模式
    1.Tensorflow的基本概念:
    linux下安装pycharm
    url参数和字典的相互转化
    MySQL数据库一
    利用伪装文件夹实现对文件的加密-当然如果你懂,这是很好破解的,只是障眼法而已
    数组有N+M个数字, 数字的范围为1 ... N, 打印重复的元素, 要求O(M + N), 不可以用额外的空间
  • 原文地址:https://www.cnblogs.com/daifuchao/p/13852895.html
Copyright © 2020-2023  润新知