I have a problem with exercise. I made a circle that has several hovers. I want to put a picture in the background of this 4-part circle (attached code) and when it has hovered, this picture should be divided into 4 pieces and have a puzzle shape. I won't run with HTML and CSS. enter image description here
* {
margin: 0;
padding: 0;
font-size: medium;
font-family: sans-serif;
box-sizing: border-box;
}
.Parent {
width: 40%;
padding-top: 40%;
background-color: darkorchid;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
div.piece {
background-color: darksalmon;
width: 50%;
padding-top: 50%;
position: absolute;
background-image: url(img/fire.jpg);
background-size: cover;
}
#pie-1 {
top: 0%;
left: 0;
border-top-left-radius: 100%;
transition: 1s;
transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
/* easeInBack */
transition-timing-function: cubic-bezier(0.600, -0.280, 0.735, 0.045);
/* easeInBack */
background-position: left top;
}
#pie-2 {
top: 0%;
background-color: darkseagreen;
left: 50%;
border-top-right-radius: 100%;
transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
/* easeInBack */
transition-timing-function: cubic-bezier(0.600, -0.280, 0.735, 0.045);
/* easeInBack */
background-position: right top;
}
#pie-3 {
bottom: 0;
left: 0;
border-bottom-left-radius: 100%;
background-color: darkslategray;
transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
/* easeInBack */
transition-timing-function: cubic-bezier(0.600, -0.280, 0.735, 0.045);
/* easeInBack */
}
#pie-4 {
bottom: 0;
left: 50%;
border-bottom-right-radius: 100%;
background-color: darkviolet;
transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
/* easeInBack */
transition-timing-function: cubic-bezier(0.600, -0.280, 0.735, 0.045);
/* easeInBack */
}
.Parent:hover #pie-1 {
transform: translate(-100%, -100%);
z-index: 2;
}
.Parent:hover #pie-2 {
transform: translate(100%, -100%);
z-index: 2;
}
.Parent:hover #pie-3 {
transform: translate(-100%, 100%);
z-index: 2;
}
.Parent:hover #pie-4 {
transform: translate(100%, 100%);
z-index: 2;
}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div class="Parent">
<Div class="piece" id="pie-1"></Div>
<Div class="piece" id="pie-2"></Div>
<Div class="piece" id="pie-3"></Div>
<Div class="piece" id="pie-4"></Div>
</div>