js+css实现下雨天纸船雨中航行漂浮动画效果代码

代码语言:html

所属分类:动画

代码描述:js+css实现下雨天纸船雨中航行漂浮动画效果代码

代码标签: 纸船 雨中 航行 漂浮 动画 效果

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

<html>
<head>
    <style>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:800);
        body {
            background: #000;
            overflow: hidden;
        }

        #instructions {
            position: absolute;
            width: 100%;
            top: 50%;
            margin: auto;
            margin-top: 80px;
            font-family: "Open Sans", sans-serif;
            color: #AAA;
            font-size: 1.1em;
            text-transform: uppercase;
            text-align: center;
            line-height: 130%;
        }

        #bgr {
            position: absolute;
            margin: auto;
            top: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(#000, #111, #222, #000);
        }

        #raftHolder {
            position: absolute;
            margin: auto;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100px;
            height: 50px;
            overflow: hidden;
        }

        #raft {
            position: absolute;
            margin: auto;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            transform: rotate(-5deg);
            -webkit-animation-name: raftFloat;
            animation-name: raftFloat;
            -webkit-animation-duration: 1s;
            animation-duration: 1s;
            -webkit-animation-iteration-count: infinite;
            animation-iteration-count: infinite;
            -webkit-animation-direction: alternate;
            animation-direction: alternate;
            -webkit-animation-timing-function: ease-in-out;
            animation-timing-function: ease-in-out;
        }

        #raftBottom {
            position: absolute;
            margin: auto;
            top: 34px;
            bottom: 0;
            left: 0;
            right: 0;
            width: 0px;
            height: 0px;
            border-bottom: 20px solid #555;
            border-left: 20px solid transparent;
            border-right: 20px solid transparent;
        }
        #raftBottom::before {
            content: "";
            position: absolute;
            margin: auto;
            width: 0px;
            height: 0px;
            left: -40px;
            border-top: 20px solid #2A2A2A;
            border-left: 20px solid transparent;
            border-right: 20px solid transparent;
        }
        #raftBottom::after {
            content: "";
            position: absolute;
            margin: auto;
            width: 0px;
            height: 0px;
            border-top: 20px solid #888;
            border-left: 20px solid transparent;
            border-right: 20px solid transparent;
        }

        #raftTop {
            position: absolute;
            margin: auto;
            top: -7px;
            left: 20px;
            right: 0;
            bottom: 0;
            width: 0px;
            height: 0px;
            border-bottom: 20px solid #fff;
            border-right: 20px solid transparent;
        }
        #raftTop::before {
            content: "";
            position: absolute;
   .........完整代码请登录后点击上方下载按钮下载查看

网友评论0