style.css 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. *{
  2. box-sizing :border-box;
  3. }
  4. .level1{ /*задаем фон*/
  5. width: 638px;
  6. height: 589px;
  7. background: #0d5825;
  8. position: relative;
  9. }
  10. blockquote {
  11. font-size: 24px;
  12. font-family: 'Times New Roman', Times, serif ;
  13. font-weight: 700;
  14. color: #ffffff;
  15. padding-top: 30px;
  16. text-align: center;
  17. }
  18. img {
  19. width: 150px;
  20. position: absolute;
  21. top: 288px;
  22. transform-origin: 20px 225px; /*задаем точку
  23. смещения (~left bottom)*/
  24. transition: 0.2s linear; /*эффект при hover*/
  25. }
  26. .img:first-child{
  27. left: 212px;
  28. transform: rotate(-20deg);
  29. }
  30. .img:nth-child(2){
  31. left: 244px;
  32. transform: rotate(-8deg);
  33. }
  34. .img:last-child{
  35. left: 265px;
  36. transform: rotate(10deg);
  37. }
  38. .img:hover{
  39. top: 265px;
  40. }
  41. .holder{
  42. width: 150px;
  43. height: 150px;
  44. position: relative;
  45. }
  46. .pink, .blue, .green{
  47. width: 60px;
  48. height: 60px;
  49. position: absolute;/*привязываем к родителю
  50. (в данном случае к родительскому классу holder*/
  51. }
  52. .pink{
  53. top: 0;
  54. left: 0;
  55. background: pink;
  56. }
  57. .blue{
  58. top: 40px;
  59. left: 40px;
  60. background: blue;
  61. z-index: 2;
  62. }
  63. .green{
  64. top: 80px;
  65. left: 80px;
  66. background: green;
  67. }
  68. .nav{
  69. position: relative;
  70. background: grey;
  71. width: 200px;
  72. height: 400px;
  73. position: fixed;/*блок зафиксирован*/
  74. left: -180px;/*смещение влево
  75. так у нас блок заходит влево
  76. и мы видим лишь 20px(NENU HERE)*/
  77. z-index: 2000; /*поверх всех элементов!!!*/
  78. transition: 0.5s ease;/*время выхода блока
  79. до значения left: 0*/
  80. }
  81. .nav:hover {
  82. left: 0;/*смещение влево до 0,
  83. так у нас блок воходит полностью*/
  84. }
  85. button {
  86. position: absolute;/*привязываемся к .nav*/
  87. color:#fff;
  88. background-color: grey;
  89. border: none;
  90. transform-origin: 0% 100%;/*задаем точку трансформации(поворота)*/
  91. transform: rotate(90deg);/*поворот на 90град.*/
  92. margin-top: 120px;/*задаем положение*/
  93. margin-left: 179px;/*задаем положение*/
  94. font-size: 16px;
  95. line-height: 17px;
  96. font-family: 'Times New Roman', Times, serif;
  97. }
  98. .nav:hover/*при навелдении мышью на .nav, button перестанет быть видимым*/
  99. button{
  100. opacity:0;
  101. }
  102. li {
  103. list-style: none;
  104. line-height: 30px;
  105. }
  106. li:before{
  107. content:"";
  108. width: 10px;
  109. height: 10px;
  110. border: 1px solid #000;
  111. display: inline-block; /*т.к. нам нужно задать
  112. высоту и ширину элемента(display: inline уже
  113. не подходит)+нам не нужен перенос на след.
  114. строку(display: block тоже нет), поэтому, мы здесь
  115. наш элемент должен распологаться как блочно-строчный */
  116. background: orange;
  117. margin: 0 10px; /*отступы от начала строки*/
  118. transform: rotate(45deg);
  119. }
  120. a {
  121. color: #fff;
  122. text-decoration: none; /*отключить стилди тега а,
  123. задать новые стили */
  124. }
  125. a:hover {
  126. color: orange;
  127. }
  128. .block{
  129. position: relative;
  130. width: 300px;
  131. height: 300px;
  132. border: 2px solid grey;
  133. }
  134. .cube{
  135. position: absolute;
  136. width: 100px;
  137. height: 100px;
  138. background: red;
  139. animation: move 4s infinite;
  140. transition-delay: 0.2s;
  141. /*так как по умолчанию transform-origin: center;
  142. и стоит зависимость position: relative/absolute
  143. то дочерний .cube перемещаеться в рамках родителя
  144. .block, я правильно мыслю?*/
  145. }
  146. @keyframes move {
  147. 0%{
  148. transform: translateX( 0px);
  149. background: red;
  150. }
  151. 25%{
  152. transform: translateY( 200px);
  153. background: blue;
  154. }
  155. 50%{
  156. transform: translateY( 200px) translateX( 200px);
  157. background: green;
  158. }
  159. 75%{
  160. transform: translateX( 200px);
  161. background: yellow;
  162. }
  163. 100%{
  164. transform: translateX( 0px);
  165. background: red;
  166. }
  167. }