Ocean

In this example below you will see how to do a Ocean with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by Himechi90, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright Himechi90 ©
  • HTML
  • CSS
  • JavaScript
    <div id="ocean" class=""></div>

/*Downloaded from https://www.codeseek.co/Himechi90/ocean-zvdNwp */
    html{
  background: #fff;  
  height: 100%;
}
body {
  margin: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
}
#ocean {
  position: absolute;
  background: url("https://pohoh3.files.wordpress.com/2014/04/cropped-sea_waves-3333px1.png") no-repeat;
  background-size: cover;
  top: 200px;
  left: 0;
  /*background: #08ADE8;*/
  width: 150%;
  height: 300px;
  display: block;
  -webkit-animation: mymove1 5s infinite; /* Chrome, Safari, Opera */ 
  animation: mymove1 5s infinite;
}

/* Chrome, Safari, Opera */ 
@-webkit-keyframes mymove1 {
    0%   {top: 110px;left:-100px;}
    10%   {top: 80px;left:-120px;}
    20%   {top: 120px;left:-150px;}
    25%  {top: 70px;left:-90px;}
    50%  {top: 90px;left: -140px;}
    75%  {top: 60px;left: -80px;}
    100% {top: 100px;left:-100px;}
} 





/*Downloaded from https://www.codeseek.co/Himechi90/ocean-zvdNwp */
    

Comments