/* EX 1 Styles Here */
#ex1 {
    width: 100%;
    height: 40px;
    position: relative;
    background-color: thistle;
    border: 5px solid #666;
    box-sizing: border-box;
}

#ex1a {
    width: 30px;
    height: 30px;
    background-color: yellow;
    position: absolute;
    bottom: 0;
    left: 0;
}

#ex1:hover {
    cursor: pointer;
}

#ex1:hover div{
    animation: animation1 3s ease-in-out infinite alternate;
}

@keyframes animation1 {
    from { left: 0; background-color: yellow;}
    to { left: calc(100% - 30); background-color: green;}
}
/* EX2 rules here */

#ex2 {
    width: 100%;
    height: 200px;
    position: relative;
    background-color: thistle;
    border: 5px solid #666;
    box-sizing: border-box;
}

#ex2a {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: yellow;
    position: absolute;
    bottom: 0;
    left: 0;
}

#ex2:hover div{
    animation-name: animation2;
    animation-duration: 5s;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes animation2 {
	0% { 
		left: 0; 
		background-color: yellow;
	}
	33% { 
		left: calc(33% - 60px);
		bottom: 70%;
		background-color: green; 
		width: 60px; 
		height: 60px;
	}
	66% {
		left: calc(66% - 40px);
		bottom: 0; 
		background-color:aqua; 
		width: 40px; 
		height: 40px;
	}
	100% {
		left: calc(100% - 20px);
		bottom: 50%; 
		background-color:rgb(255, 0, 170); 
		width: 20px; 
		height: 20px;
	}
}

/* EX3 Rules here */

#ex3 {
    width: 100%;
    height: 200px;
    background-color: thistle;
    border: 5px solid #666;
    box-sizing: border-box;
    display: grid;
    place-content: center;
    perspective: 1000px;
}

#ex3a {
    width: 150px;
    height: 150px;
    background-color: red;
    color: #fff;
    font-size: 48px;
    font-weight: bold;
    display: grid;
    place-content: center;
}

#ex3:hover div{
    animation: animation3 3s 2 alternate forwards;
}

@keyframes animation3 {
    0% { 
        transform: rotateY(0deg) translateX(0px);
        animation-timing-function: ease-in;
    }
    25% { 
        transform: rotateY(90deg) translateX(150px) translateZ(150px);
        animation-timing-function: linear;
    }
    50% {
        transform: rotateY(180deg) translateX(0px) translateZ(300px);
        animation-timing-function: linear;
        background-color: blue;
    }
    75% {
        transform: rotateY(270deg) translateX(-150px) translateZ(150px);
        animation-timing-function: linear;
    }
    100% {
        transform: rotateY(360deg) translateX(0) translateZ(0px);
        background-color: red;
        animation-timing-function: ease-out;
    }
}

