상세 컨텐츠

본문 제목

[j쿼리]트랜스폼 트렌지션 연습

카테고리 없음

by esoesmio 2023. 5. 26. 02:01

본문

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    div {
      width: 400px;
      height: 400px;
      margin: 20px;
      position: relative;
    }

    .box1 {
      background-color: green;
      transition-duration: 5s, 5s;
      border-radius: 50%;
    }

    .box2 {
      background-color: blue;
    }

    .box1:hover {
      border-radius: 0%;
      width: 1000px;
      height: 1000px;
    }

    .box1:hover::before {
      content: "hahahahah this is me";
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
  </style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
</body>
</html>​
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .box {
      width: 300px;
      height: 200px;
      background-color: red;
      transition-property: all;
      transition-duration: 2s;
      position: relative;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .box:hover {
      transform: translate(100px, 500px) rotate(90deg);
      background-color: green;
    }
    .box:hover::after {
      content: "hahahah this is me hahahah";
      color: white;
      font-size: 20px;
      /*position: absolute;*/
    }
  </style>
</head>
<body>
<div class="box"></div>
</body>
</html>

 

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .box{
      width : 100px;
      height : 100px;
      border : 1px solid black;
      background-color: orange;
/*transform도 스타일 지정속성이기 때문에 transition-property로 지정 가능*/
    transition-property:transform;
      transition-duration: 2s;


    }
    .box:hover{
      width: 150px;
      height: 150px;
      border: 5px dotted red;
      background-color: green;
      border-radius: 50%;
    transform:translate(100px, 50px);

    }

  </style>

</head>
<body>
<div class="box">      </div>
</body>
</html>

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    .box{
      width : 100px;
      height : 100px;
      border : 1px solid black;
      background-color: orange;
      transition: all 5s linear 1s ;
    }
    .box:hover{
      width: 150px;
      height: 150px;
      border: 5px dotted red;
      background-color: green;
      border-radius: 50%;
    }

  </style>

</head>
<body>
<div class="box">      </div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    div:hover{
      transition-delay: 3s;
      background-color: yellow;
      border-radius: 50%;
    }


    div{
      background-color: red;
      transition-delay: 3s;

      width: 100px;
      height: 100px;
      margin: 20px;
      transition-property: all;
      transition-duration: 3s;
    }



    .box1{
   }

    .box2{
      transition-timing-function: linear;
    }
    .box3{
      transition-timing-function: ease-in;
    }
    .box4{
      transition-timing-function: ease-out;
    }
    .box5{
      transition-timing-function: ease-in-out;
    }


    .box1:hover, .box2:hover, .box3:hover, .box4:hover, .box5:hover{
      background-color: yellow;
      border-radius: 50%;


    }


  </style>

</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
<div class="box5"></div>

</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            background-color: red;
            width: 100px;
            height: 100px;
            margin: 20px;
            transition-property: all;
            transition-duration: 3s;
        }

        .box1{
            transition-timing-function: ease;
        }

        .box2{
            transition-timing-function: linear;
        }
        .box3{
            transition-timing-function: ease-in;
        }
        .box4{
            transition-timing-function: ease-out;
        }
        .box5{
            transition-timing-function: ease-in-out;
        }


.box1:hover, .box2:hover, .box3:hover, .box4:hover, .box5:hover{
    background-color: yellow;
    border-radius: 50%;


}


    </style>

</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
<div class="box5"></div>

</body>
</html>

 

댓글 영역