Skip to content

Instantly share code, notes, and snippets.

@ufologist
Created April 24, 2017 15:31
Show Gist options
  • Save ufologist/8b7b55a7d1bb2ecf6f6e7c47df82dfad to your computer and use it in GitHub Desktop.
Save ufologist/8b7b55a7d1bb2ecf6f6e7c47df82dfad to your computer and use it in GitHub Desktop.
wave animation | 波浪动画
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>wave animation | 波浪动画</title>
<style>
.banner-box {
position: relative;
}
.banner {
background: url(http://lorempixel.com/400/200/nature);
height: 200px;
}
.wave-box {
position: absolute;
bottom: 0;
width: 100%;
}
.wave-item {
position: absolute;
bottom: 0;
width: 400%;
background-repeat: repeat-x;
}
.wave-item--1 {
left: -236px;
z-index: 2;
height: 85px;
/* http://img1.sj.qq.com/res/sj.qq.com/official2/images/index/wave1.png */
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+UAAABVCAQAAACF6I3pAAAOPklEQVR42u3deXwU5RnA8VFBQMzHT/1opf0oatQqihoOL6wFlBJFVERuDGqrogjeHEE5yqUcFUVBQQ4PoCCXlEs+oSDiSThFpZYACWo2KcnqLhkYh+lO39lsdmdmdyGBHPtufvP9D0j+2Hl4np3nfeZ9FYWLi4uLi6ui1ykOp4adVgGRnyr7PVwndpmoQjECvbyhHfwpPkEACZLHnDmsjlA36PSgekH1XRoIZzhYf+L8N9bPlf6OusHfas+EZMHy3iM+gioJd2ewlwV6/BC3h3e9UGjXtQU2xR1AdWeysjwWyWLu3NUw7Mw4UqLE+ldlvyWSEeuH82AdSjulvKoDPlK4S8t2WbhHgj1+qB87vCOB3SAU1s6gJqQBVEUmi5/HbLlr7O82p1lyO3i6eLoc7FEyxKKN12c6BVaZG+wCa5x/f2Sc9XMHe3m65He2ft/yS20Z0Z4F64ee3evyeEMpr8zvqrEC3h7uIhj/+BsrNHPaWqHue7pkiPqiPYSNBbbwX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B7AAAAABJRU5ErkJggg==");
animation: wave1 25s linear .4s infinite normal;
}
.wave-item--2 {
z-index: 1;
height: 100px;
/* http://img1.sj.qq.com/res/sj.qq.com/official2/images/index/wave2.png */
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA/EAAABkCAMAAAD5XEDKAAAA6lBMVEUAAAD///8AAAAAAAAAAAAwMDBRUVFVVVVoaGhtbW2AgICOjo6ZmZmioqKqqqqxsbG7u7u/v7/Dw8PHx8fKysrNzc3Pz8/V1dXX19fZ2dnb29vc3Nzd3d3i4uLj4+Pk5OTl5eXm5ubm5ubn5+fq6urr6+vr6+vs7Ozs7Ozt7e3v7+/w8PDx8fHx8fHy8vL09PT09PT09PT19fX19fX19fX39/f39/f39/f4+Pj5+fn5+fn5+fn5+fn6+vr6+vr7+/v7+/v7+/v7+/v9/f39/f39/f39/f3+/v7+/v7+/v7+/v7///////////8ajZTIAAAATnRSTlMAAAECAwMEBAQEBQUGBwcICAkJCgsLDAwNDQ4PDxAQERESExMUFBUVFhcXGBkaGxscHR0eHx8gISIiIyQlJSYmJygpKissLS4vMDExMjOSfysNAAAIb0lEQVR42u2d2UIiOxRFc5vA5aIMYttxYBBFrJbBAjWoKEJkECH//zv3AagqVFSwhlSx12u/tCd7kZxTEyEAgNX59Ra//Mf/CQTL1+FXsP5Q4GXCLLEKfcBC5JT9Q/zv+RfLEHpjP8ILVg3ZknhRCx9ETs20Eb+vwnvLl66D2isB1E2ZJVsRxs61K84fhRB9aTAUQtxyXi6xlJm6edpgvM0/uJSGGTvXGpw3hRBiaK7DQAjR4ZyXtRzbUXwlgFo5WwgZTRxqNX5vdXw5fcHrWnaHLoQNxq+9COYqRNmppvPW95ZBSjkUzYaWTVKL97AefCo7jbKzWlOM5eq8dq81FrZmjcD4FTf2ueoxdlbl4kWux6hzrbEIrLeMQt5MPDd21jkrxCxmTOPdofwhz7eV7LZKWSO+WALD9T8/UX3x6HVfK8Q32PoFzZcOOzdI/Gk9pn9/eP8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gMAYDwAAMYDAGA8AADGAwBgPAAAxgMAYDwAAMYDAGA8ADAeAADjAQAwHgAA4wEAMB4AAOMBADAeAADjAQAwHgAA4wEAMB4AAOMBgPEAABgPAIDxAAAYDwCA8QAAGA8AgPEAABgPAIDxAAAYDwCA8QAAGA8AjAcAwHgAAIwHAMB4AACMBwDAeAAAjAcAwHgAAIwHAMB4AACMBwDGAwBgPAAAxgMAYDwAAMYDAGA8AADGAwBgPADAbv4H381ibPxtGOIAAAAASUVORK5CYII=");
animation: wave2 60s linear .4s infinite normal;
}
@keyframes wave1 {
from {
left: -236px;
}
to {
left: -1233px;
}
}
@keyframes wave2 {
from {
left: 0;
}
to {
left: -1009px;
}
}
</style>
</head>
<body>
<div class="banner-box">
<div class="banner"></div>
<div class="wave-box">
<div class="wave-item wave-item--1"></div>
<div class="wave-item wave-item--2"></div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment