#bg {
height: 100vh;
background-color: grey;
}
#container {
position: absolute;
top: 50%; left: 50%;
transform: translateX(-50%) translateY(-50%);
height: 70vh;
width: 70vh;
max-width: 80vw;
}
.menu {
position: absolute;
height: 150px; width: 150px;
top: 50%; left: 50%;
border: solid 15px black;
transform: translateX(-50%) translateY(-50%);
border-radius: 50%;
transition: 0.2s ease;
}
.menu-animated {
animation: borderColor 3s alternate infinite;
border-radius: 0%;
}
@keyframes borderColor {
0% {
border: solid 15px #85ccdd;
}
12.5% {
border-top: solid 15px #85ccdd;
}
25% {
border-top: solid 15px #85ccdd;
border-right: solid 15px #85ccdd;
}
37.5% {
border-top: solid 15px #85ccdd;
border-right: solid 15px #85ccdd;
border-bottom: solid 15px #85ccdd;
}
50% {
border-top: solid 15px #85ccdd;
border-right: solid 15px #85ccdd;
border-bottom: solid 15px #85ccdd;
border-left: solid 15px #85ccdd;
}
62.5% {
border-top: solid 15px #ff6c5d;
}
75% {
border-top: solid 15px #ff6c5d;
border-right: solid 15px #ff6c5d;
}
87.5% {
border-top: solid 15px #ff6c5d;
border-right: solid 15px #ff6c5d;
border-left: solid 15px #ff6c5d;
}
100% {
border-top: solid 15px #ff6c5d;
border-right: solid 15px #ff6c5d;
border-left: solid 15px #ff6c5d;
border-bottom: solid 15px #ff6c5d;
}
}
.bg-animated {
background: linear-gradient(-45deg, #EE7752, #E73C7E, #23A6D5, #23D5AB);
background-size: 400% 400%;
animation: gradient 4s infinite;
}
@keyframes gradient {
0% {
background-position: 0% 50%
}
50% {
background-position: 100% 50%
}
100% {
background-position: 0% 50%
}
}
.circle {
position: absolute;
border-radius: 50%;
height: 50px; width: 50px;
top: 50%; left: 50%; right: auto; bottom: auto;
transform: translateX(-50%) translateY(-50%);
background-color: #FFF;
}
.circle p {
text-align: center;
position: absolute;
font-family: 'Amatic SC', cursive;
color: #FFF;
line-height: 1em;
font-size: 1.5em;
top: 110%;
display: none;
transition: 1s ease;
}
#circle5 {
height: 100px; width: 100px;
}
.circle-animated {
animation: circleAnimated 2s alternate infinite;
}
@keyframes circleAnimated {
0% {
background-color: #fffb82;
}
100% {
background-color: #b9f;
}
}
.circle-animated:hover {
box-shadow: 0 0 0 10px #e8ffc0;
}
var spread_tl = new TimelineMax()
.to(".circle",0, {left:"50%", top: "50%"})
.to("#circle1", 0.3, {left:"0", top: "0", ease:Expo.easeInOut})
.to("#circle2", 0.3, {x: "50%", left: "auto", right: "0%", top: "0", ease:Expo.easeInOut})
.to("#circle3", 0.3, {x: "50%", left: "auto", right: "0%", top: "auto", y: "50%", bottom: "0", ease:Expo.easeInOut})
.to("#circle4", 0.3, {left: "0%", top: "auto", y: "50%", bottom: "0", ease:Expo.easeInOut})
.reverse();
var grow_tl = new TimelineMax()
.to("#circle5", 0.1, {scale: 1.05, ease:Power1.easeInOut})
.to("#circle5", 0.2, {scale: 0.85, ease:Elastic.easeInOut})
.to("#circle5", 0.1, {scale: 0.9, ease:Power1.easeInOut})
.to("#circle5", 0.2, {scale: 0.7, ease:Power4.easeInOut})
.to("#circle5", 0.2, {scale: 0.5, ease:Power4.easeInOut})
.to("#circle5", 0.1, {scale: 0.6, ease:Power1.easeInOut})
.to("#circle5", 0.2, {scale: 0.35, ease:Power4.easeInOut})
.reverse();
$(".menu, #circle5").click(function() {
$(".menu").toggleClass("menu-animated");
$("#bg").toggleClass("bg-animated");
$(".circle").toggleClass("circle-animated");
$(".circle p").toggle();
spread_tl.reversed(!spread_tl.reversed());
grow_tl.reversed(!grow_tl.reversed());
});