style.css 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. @keyframes box {
  2. 0% {
  3. position: absolute;
  4. top: 0;
  5. left: 0;
  6. background: red;
  7. }
  8. 25% {
  9. position:absolute;
  10. top: calc(100% - 100px);
  11. left: 0;
  12. background: blue;
  13. }
  14. 50% {
  15. position: absolute;
  16. top: calc(100% - 100px);
  17. left: calc(100% - 100px);
  18. background: green;
  19. }
  20. 75% {
  21. position: absolute;
  22. top: 0;
  23. left: calc(100% - 100px);
  24. background: yellow;
  25. }
  26. 100% {
  27. position: absolute;
  28. top: 0;
  29. left: 0;
  30. background: red;
  31. }
  32. }
  33. body {
  34. margin: 0;
  35. }
  36. html {
  37. box-sizing: border-box;
  38. }
  39. .cards {
  40. background: #0d5825;
  41. height: 500px;
  42. width: auto;
  43. }
  44. .blockquote {
  45. font-size: 25px;
  46. text-align: center;
  47. color: white;
  48. position: relative;
  49. top: 10px;
  50. }
  51. .card1 {
  52. height: 200px;
  53. width: 150px;
  54. position: absolute;
  55. top: 50%;
  56. left: 53%;
  57. transform: translate(-47%, -50%) rotate(8deg);
  58. z-index: 3;
  59. }
  60. .card2 {
  61. height: 200px;
  62. width: 150px;
  63. position: absolute;
  64. top: 48%;
  65. left: 51%;
  66. transform: translate(-49%, -52%) rotate(-8deg);
  67. z-index: 2;
  68. }
  69. .card3 {
  70. height: 200px;
  71. width: 150px;
  72. position: absolute;
  73. top: 47%;
  74. left: 48%;
  75. transform: translate(-52%, -53%) rotate(-20deg);
  76. }
  77. .card1:hover {
  78. transition: transform .4s ease-in-out;
  79. transform: translate(-47%, -60%) rotate(8deg);
  80. }
  81. .card2:hover {
  82. transition: transform .4s ease-in-out;
  83. transform: translate(-49%, -62%) rotate(-8deg);
  84. }
  85. .card3:hover {
  86. transition: transform .4s ease-in-out;
  87. transform: translate(-52%, -63%) rotate(-20deg);
  88. }
  89. /* Task 2 */
  90. .task2 {
  91. height: 300px;
  92. width: 300px;
  93. }
  94. .pink {
  95. height: 100px;
  96. width: 100px;
  97. background-color: pink;
  98. position: relative;
  99. top: 10px;
  100. left: 10px;
  101. z-index: 1;
  102. }
  103. .blue {
  104. height: 100px;
  105. width: 100px;
  106. background-color: blue;
  107. position: relative;
  108. top: -20px;
  109. left: 70px;
  110. z-index: 2;
  111. }
  112. .lightgreen {
  113. height: 100px;
  114. width: 100px;
  115. background-color: lightgreen;
  116. position: relative;
  117. top: -55px;
  118. left: 130px;
  119. z-index: 1;
  120. }
  121. /* Task 3 */
  122. .menu {
  123. height: 400px;
  124. width: 200px;
  125. position: relative;
  126. transform: translateX(-160px);
  127. background-color: gray;
  128. }
  129. .menu:hover {
  130. transition: all .9s linear;
  131. transform: translateX(0px);
  132. }
  133. .menu:hover #vertical {
  134. transition: all .9s linear;
  135. opacity: 0;
  136. }
  137. .menu-list {
  138. position: relative;
  139. top: 100px;
  140. }
  141. #vertical {
  142. font-size: 20px;
  143. color: white;
  144. writing-mode: vertical-lr;
  145. position: relative;
  146. top: 10px;
  147. left: 10px;
  148. float: right;
  149. }
  150. .list-item {
  151. margin-top: 10px;
  152. margin-bottom: 10px;
  153. }
  154. .menu a {
  155. text-decoration: none;
  156. }
  157. .menu-items li {
  158. list-style: none;
  159. }
  160. .menu-items a {
  161. color: white;
  162. }
  163. .links:hover {
  164. transition: all .3s ease-in;
  165. color: orange;
  166. }
  167. /* Task 4 */
  168. .anim-holder {
  169. width: 300px;
  170. height: 300px;
  171. position: relative;
  172. }
  173. .anim-box {
  174. width: 100px;
  175. height: 100px;
  176. position: absolute;
  177. top: 0;
  178. left: 0;
  179. background: red;
  180. animation: box 4s linear infinite;
  181. }