<div class="wrapper">
<label class="switch">
<input type="checkbox" id="checkbox-toggle" />
<span class="slider">
<div class="fish">
<div class="body">
</div>
<div class="eye"></div>
<div class="tail"></div>
</div>
</span>
<span class="wave"> </span>
<div class="boat">
<div class="bottom"></div>
<div class="mast"></div>
<div class="rectangle-sm"></div>
<div class="rectangle-lg"></div>
</div>
<div class="sky">
<div class="sun">
<div class="outer"></div>
<div class="inner"></div>
</div>
<div class="cloud cloud1">
<div class="rect"></div>
<div class="circle circle-lg"></div>
<div class="circle circle-sm"></div>
</div>
<div class="cloud cloud2">
<div class="rect"></div>
<div class="circle circle-lg"></div>
<div class="circle circle-sm"></div>
</div>
</div>
</label>
<a href="https://dribbble.com/khatib" target="_blank">Design Inspiration from Mo(@Khatib)</a>
</div>
<svg viewBox="0 0 180 100" width="100%">
<filter width="100%" height="100%" x="0%" y="0%" id="wave">
<feTurbulence type="fractalNoise" baseFrequency="0.000001" id="turbulence" numOctaves="1" result="turbulence">
<animate id="noiseAnimate" attributeName="baseFrequency" values="0.095,0.000001;0.025,0.2;" dur="1.4s" repeatCount="indefinite"></animate>
</feTurbulence>
<feDisplacementMap in="SourceGraphic" in2="warpOffset" scale="6" dy="100px" xChannelSelector="R" yChannelSelector="G"></feDisplacementMap>
<feGaussianBlur stdDeviation="0.5" />
</filter>
* {
margin: 0;
padding: 0;
}
.wrapper {
position: absolute;
background: #2b3e51;
width: 100%;
height: 100%;
overflow-y: scroll;
.switch {
position: absolute;
left: 50%;
top: 60%;
transform: translate(-50%, -50%);
width: 120px;
height: 50px;
input {
display: none;
}
.wave {
position: absolute;
top: 0;
left: 0;
border-radius: 40px;
width: 120px;
height: 50px;
display: none;
&:after {
content: "";
width: 60px;
height: 3px;
border-radius: 100%;
background: #fff;
position: absolute;
top: 3px;
left: 20%;
opacity: 0.4;
}
&:before {
content: "";
width: 35px;
height: 2px;
border-radius: 100%;
background: #fff;
position: absolute;
top: 10px;
left: 30%;
opacity: 0.3;
}
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #e74a42;
transition: all 1.4s;
border-radius: 50px;
z-index: 100;
overflow: hidden;
&:before,
&:after {
position: absolute;
content: "";
height: 40px;
width: 40px;
left: 5px;
bottom: 5px;
border-radius: 30px;
background-color: #fff;
}
&:before {
transition: 0.4s;
}
&:after {
transition: 0.5s;
}
.fish {
position: absolute;
left: -20%;
top: 20%;
transition: 1.5s all;
.body {
width: 20px;
height: 20px;
background: repeating-linear-gradient(
-45deg,
#e79c2a,
#e79c2a 5px,
#fb7813 5px,
#fb7813 10px
);
border-radius: 0 100% 20% 100%;
transform: rotate(-45deg);
position: relative;
}
.eye {
position: absolute;
top: 8px;
left: 15px;
width: 4px;
height: 4px;
background-color: #000;
border-radius: 100%;
&:after {
content: "";
width: 1px;
height: 1px;
background-color: #fff;
border-radius: 100%;
position: absolute;
top: 25%;
left: 25%;
}
}
.tail {
width: 5px;
height: 5px;
background: repeating-linear-gradient(
-45deg,
#e79c2a,
#e79c2a 5px,
#fb7813 5px,
#fb7813 10px
);
border-radius: 100% 10% 0 10%;
transform: rotate(-45deg);
position: absolute;
left: -8px;
top: 40%;
}
}
}
.sky {
position: absolute;
left: -40%;
top: -150px;
width: 100px;
height: 100px;
transform: scale(0);
opacity: 0;
transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
.sun {
.outer {
background: #e77b21;
width: 50px;
height: 50px;
position: absolute;
top: -11px;
border-radius: 5px;
&:before,
&:after {
content: "";
position: absolute;
top: 0;
left: 0;
height: 50px;
width: 50px;
background: #e77b21;
border-radius: 5px;
}
&:before {
transform: rotate(30deg);
}
&:after {
transform: rotate(60deg);
}
}
.inner {
position: absolute;
width: 50px;
height: 50px;
border-radius: 100%;
background-color: #ffd65a;
top: -12px;
overflow: hidden;
&:before {
content: "";
width: 50px;
height: 50px;
border-radius: 100%;
position: absolute;
left: 3 px;
top: 15px;
background: #ffc631;
}
}
}
.cloud {
position: absolute;
filter: url("#cloud");
z-index: -1;
.rect {
width: 100px;
height: 30px;
background: #fff;
border-radius: 100px;
}
.circle {
border-radius: 100%;
background: #fff;
position: absolute;
}
.circle-lg {
width: 50px;
height: 50px;
top: -55%;
left: 5%;
}
.circle-sm {
width: 50px;
height: 50px;
border-radius: 100%;
left: 35%;
top: -50%;
}
}
.cloud1 {
left: -60%;
top: 20%;
}
.cloud2 {
left: 150px;
top: 10%;
opacity: 0.8;
}
}
input:checked + .slider {
background-color: transparent;
.fish {
animation: fishMovement 4s linear infinite;
}
}
input:checked ~ .wave {
background-color: #3398d9;
display: block;
filter: url(#wave);
}
input:checked + .slider:before {
transform: translateX(70px);
}
input:checked + .slider:after {
transform: translateX(70px);
}
input:checked ~ .boat {
top: -25%;
opacity: 1;
z-index: -1;
animation: boatMovement 3s linear alternate infinite;
}
input:checked ~ .sky {
transform: scale(1);
opacity: 1;
.outer {
animation: rotateSun 5s infinite linear;
}
.cloud {
animation: swingCloud 10s infinite linear;
}
}
.boat {
position: absolute;
top: 100%;
left: 25%;
width: 40px;
height: 100px;
transition: 0.6s all cubic-bezier(0.68, -0.6, 0.32, 1.6);
opacity: 0;
.bottom {
border-top: 15px solid #d64242;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
height: 0;
width: 40px;
border-radius: 2px;
&:after {
content: "";
width: 50px;
border-top: 4px solid #000;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
height: 0;
position: absolute;
top: 3px;
left: 2px;
opacity: 0.2;
}
}
.mast {
position: absolute;
width: 3px;
height: 35px;
background: #6f4914;
left: 70%;
bottom: 100%;
}
.rectangle-sm {
width: 0;
height: 0;
border-top: 15px solid transparent;
border-left: 10px solid #d6d6d6;
border-right: 10px solid transparent;
border-radius: 0 0 0 0;
position: absolute;
left: 80%;
bottom: 110%;
}
.rectangle-lg {
width: 0;
height: 0;
border-top: 25px solid transparent;
border-left: 10px solid transparent;
border-right: 15px solid #d6d6d6;
border-radius: 0 0 0 0;
position: absolute;
left: 5%;
bottom: 110%;
}
}
}
a {
color: #fff;
padding: 15px;
display: block;
font-family: sans-serif;
font-size: 10px;
position: absolute;
left: 35%;
}
}
svg {
display: none;
}
@keyframes fishMovement {
60% {
transform: translate(-50%, 50%);
}
65% {
transform: translate(50%, 50%);
}
100% {
transform: translate(100px, 50%);
}
}
@keyframes boatMovement {
30% {
transform: rotate(-5deg);
}
60% {
transform: rotate(5deg);
}
100% {
transform: rotate(0);
}
}
@keyframes twinkling {
30% {
opacity: 0.4;
}
60% {
transform: scale(1.2);
}
100% {
opacity: 1;
transform: scale(1);
}
}
@keyframes rotateSun {
100% {
transform: rotate(360deg);
}
}
@keyframes swingCloud {
50% {
transform: translateX(50px);
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.