最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

html+css實(shí)現(xiàn)圖片掃描儀特效

  發(fā)布時(shí)間:2021-03-17 11:56:02   作者:北極光之夜。   我要評(píng)論
這篇文章主要介紹了html+css實(shí)現(xiàn)圖片掃描儀特效,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧

本文主要介紹了html css 圖片掃描儀,分享給大家,具體如下:

效果:

這樣,有抖動(dòng)的:

在這里插入圖片描述

無(wú)抖動(dòng)的:

在這里插入圖片描述

實(shí)現(xiàn):

1.定義一個(gè)盒子:

<body>
    <div class="tu"></div>
</body>

2.基本樣式,長(zhǎng)寬背景圖等等~

 .tu{
            width: 500px;
            height: 300px;
            background-image: url(8.jpg);
            background-size: 100% auto;
            background-repeat: no-repeat;
            position: relative;
            overflow: hidden;
            cursor: pointer;
        }

cursor: pointer;鼠標(biāo)經(jīng)過(guò)盒子樣式為小手

3.用偽類(lèi)元素做掃描線(xiàn),基本樣式:

 .tu::after{
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 500px;
            height: 35px;
            background-image: url(8.jpg);
            background-size: 100% auto;
            background-repeat: no-repeat;
            filter: sepia(100%); 
            opacity: 0;
           
        }

filter: sepia(100%); 圖片發(fā)黃。
filter: invert(100%); 像X光底片。

4.實(shí)現(xiàn)掃描:

.tu:hover::after{
            opacity: 1;
            animation: move 1.8s linear infinite;
        }
        @keyframes move{
            0%{
                top: 0;
                background-position: 6px 0px; 
            }
            20%{
                top: 60px;
                background-position: -6px -60px; 
            }
            40%{
                top: 120px;
                background-position: 6px -120px; 
            }
            60%{
                top: 180px;
                background-position: -6px -180px; 
            }
            80%{
                top: 240px;
                background-position: 6px -240px; 
            }
            100%{
                top: 300px;
                background-position: -6px -300px; 
            }
        }

讓background-position的y軸位移剛好等于top的距離,然后x軸為0的話(huà)就不抖,有數(shù)值就會(huì)抖動(dòng)。

完整代碼:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body{
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: rgb(0, 0, 0);
        }
        .tu{
            width: 500px;
            height: 300px;
            background-image: url(8.jpg);
            background-size: 100% auto;
            background-repeat: no-repeat;
            position: relative;
            overflow: hidden;
            cursor: pointer;
        }
        .tu::after{
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 500px;
            height: 20px;
            background-image: url(8.jpg);
            background-size: 100% auto;
            background-repeat: no-repeat;
            filter: invert(100%); 
            opacity: 0;
           
        }
        .tu:hover::after{
            opacity: 1;
            animation: move 1.8s linear infinite;
        }
        @keyframes move{
            0%{
                top: 0;
                background-position: 6px 0px; 
            }
            20%{
                top: 60px;
                background-position: -6px -60px; 
            }
            40%{
                top: 120px;
                background-position: 6px -120px; 
            }
            60%{
                top: 180px;
                background-position: -6px -180px; 
            }
            80%{
                top: 240px;
                background-position: 6px -240px; 
            }
            100%{
                top: 300px;
                background-position: -6px -300px; 
            }
        }
    </style>
</head>
<body>
    <div class="tu"></div>
</body>
</html>

總結(jié):

這是網(wǎng)上看到一外國(guó)博主的創(chuàng)意,然后自己也弄了一個(gè),雖然效果是比較簡(jiǎn)單的,但也是挺好玩的~

到此這篇關(guān)于html+css實(shí)現(xiàn)圖片掃描儀特效 的文章就介紹到這了,更多相關(guān)html+css圖片掃描儀 內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!

相關(guān)文章

  • html+css實(shí)現(xiàn)充電水滴融合特效代碼

    這篇文章主要介紹了html+css實(shí)現(xiàn)充電水滴融合特效代碼,代碼簡(jiǎn)單易懂,對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-01-28
  • html+css實(shí)現(xiàn)血輪眼輪回眼特效代碼

    這篇文章主要介紹了html+css實(shí)現(xiàn)血輪眼輪回眼特效 ,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-03-31

最新評(píng)論

偏关县| 池州市| 武夷山市| 西宁市| 乌拉特中旗| 霞浦县| 禹州市| 利川市| 临湘市| 宣汉县| 上思县| 当雄县| 江油市| 宜阳县| 密山市| 饶河县| 榆树市| 容城县| 措勤县| 潮安县| 永嘉县| 九江县| 澎湖县| 沿河| 陆河县| 蚌埠市| 康保县| 封开县| 海盐县| 永寿县| 云梦县| 新竹县| 临海市| 措美县| 兴安盟| 湘阴县| 乌审旗| 汶上县| 南郑县| 巍山| 苍南县|