day7

μƒμ€πŸ‘ΈΒ·2023λ…„ 10μ›” 16일
1

λšœλ²…λšœλ²… λ‘λ²ˆμ§Έ

λͺ©λ‘ 보기
7/13
post-thumbnail

πŸ“Œ
relative = νλ¦„λŒ€λ‘œ // μ‹œμž‘μ  : κ°μžμœ„μΉ˜
absolute = νλ¦„λ¬΄μ‹œ // μ‹œμž‘μ  : λΆ€λͺ¨μš”μ†Œμœ„μΉ˜ λΆ€λͺ¨μš”μ†Œμ€‘μ— relativeκ°€ 있으면 그게 μ‹œμž‘μ ! relative μ—†μœΌλ©΄ bodyκ°€ μ‹œμž‘μ !
fixed = νλ¦„λ¬΄μ‹œ, 슀크둀 내렀도 κ³ μ •μœ„μΉ˜ // μ‹œμž‘μ  : λΆ€λͺ¨μš”μ†Œ 상관없이 κ·Έλƒ₯ μ „μ²΄νŽ˜μ΄μ§€ κΈ°μ€€

πŸ“– transition : λ°”λ€ŒλŠ” 효과

1. transition-property = νš¨κ³Όκ°€ 적용될 속성 이름

2. transition-duration = νš¨κ³Όκ°€ μ§€μ†λ˜λŠ” μ‹œκ°„

3. transition-delay = μ§€μ—°λ˜λŠ” μ‹œκ°„

4. transition-timing-funtion = 효과 속도(νŒ¨ν„΄) 지정

linear : μΌμ •ν•œ 속도
ease : 빨라지닀가 느렀짐
ease-in : λŠλ¦¬λ‹€κ°€ 빨라짐
ease-out : 빨라지닀가 점점 느렀짐
ease-in-out : λŠλ¦¬λ‹€κ°€ 점점 빨라지닀가 λ‹€μ‹œ 느렀짐
cubic-bezier(1,0,.89,1.2) : λΉ λ₯΄κΈ°λ₯Ό λ‚΄κ°€ 지정할 수 μžˆλ‹€!

πŸ‘‰ 5. transition: property duration timing-funtion delay = ν•œλ²ˆμ— 적용

ex) transition: all 1s linear 1s;
=> λͺ¨λ“  속성을 1μ΄ˆλ™μ•ˆ μΌμ •ν•œμ†λ„λ‘œ μ»€μ„œμ˜¬λ €λ†“κ³  1초 후에

πŸ’‘μ μš©πŸ’‘

<style>
	.box {
		width: 100px;
        height: 100px;
        background-color: red;
        margin: 10px;
        transition: background-color 2s cubic-bezier(1,0,.9,.76) 1s; /*ν•œμ€„λ‘œ ν•œλ²ˆμ— 적용*/
 	} 

   	/* 마우슀λ₯Ό 올리면 -> κ°€μƒμ„ νƒμž */
    .box:hover {
		background-color: blueviolet;
	}
</style>
<body>
 <div class="box"></div>
 <div class="box"></div>
 <div class="box"></div>
</body>

=> πŸ’»

=> 마우슀 μ˜¬λ €λ†“μœΌλ©΄ transition: background-color 2s cubic-bezier(1,0,.9,.76) 1s;
μ΄κ±°λŒ€λ‘œ 배경색상이 2μ΄ˆλ™μ•ˆ 1μ΄ˆν›„μ— λ³΄λΌμƒ‰μœΌλ‘œ 바뀐닀!

πŸ’‘μ μš©πŸ’‘

<style>
	/* λ°”λ€ŒκΈ° μ „ */
    .box {
		width: 200px;
        height: 200px;
        border: 2px solid blue;
        background-image: url(../../day01/images/imgtest3.jpg);
        background-size: 200px 200px;
        transition: all 1s linear 0.5s;
    }
    /* 마우슀 올리고 λ‚œ ν›„ */
    .box:hover {
        width: 600px;
        height: 600px;
        border: 2px solid red;
        background-image: url(../../day01/images/imgtest3.jpg);
        background-size: 200px 200px;
    }
</style>
<body>
    <div class="box"></div>
</body>

=> πŸ’»

=> 마우슀 올리면

=> transition: all 1s linear 0.5s; λͺ¨λ“ μ†μ„±μ΄ 마우슀올리면 0.5초 μžˆλ‹€κ°€ 1μ΄ˆλ™μ•ˆ μΌμ •ν•œμ†λ„λ‘œ λ™μž‘!

πŸ“– animation

@keyframes -> λ‹¨κ³„λ³„λ‘œ μ μš©ν•  μŠ€νƒ€μΌ (0% 25% 50% 100%)

1. animation-name: ν‚€ν”„λ ˆμž„ 이름

2. animation-duration: μ§€μ†λ˜λŠ” μ‹œκ°„

3. animation-delay: 지연 μ‹œκ°„(λͺ‡μ΄ˆμžˆλ‹€κ°€ 싀행될건지)

4. animation-fill-mode (μ‹œμž‘κ³Ό 끝)

	none        :   μ‹œμž‘μ μš©X   λλ‚˜λ©΄ μ›λž˜λŒ€λ‘œ 
    forwards    :   μ‹œμž‘μ μš©X   λλ‚˜λ©΄ λ§ˆμ§€λ§‰ μŠ€νƒ€μΌλ‘œ 적용
    backwards   :   μ‹œμž‘μ μš©O   λλ‚˜λ©΄ μ›λž˜λŒ€λ‘œ
    both        :   μ‹œμž‘μ μš©O   λλ‚˜λ©΄ λ§ˆμ§€λ§‰ μŠ€νƒ€μΌλ‘œ 적용 @

5. animation-iteration-count: λͺ‡λ²ˆ λ°˜λ³΅ν• κ±°λƒ 횟수 // λ¬΄μ œν•œ? infinite

6. animation-direction:

    normal              : 0% -> 100% (λ…Έλž‘ μ£Όν™© λΉ¨κ°•)
    reverse             : 100% -> 0% (λΉ¨κ°• μ£Όν™© λ…Έλž‘)
    alternate           : 0% -> 100% -> 0% -> 100% (normal->reverse) (μ™”λ‹€κ°”λ‹€)
    alternate-reverse   : 100% -> 0% -> 100% -> 0% (reverse->normal) (거꾸둜 μ™”λ‹€κ°”λ‹€)

πŸ’‘μ μš©πŸ’‘

  1. λ¨Όμ € @keyframes boxAni {} 둜 μŠ€νƒ€μΌ μž‘μ•„μ£Όκ³ 

@keyframes boxAni {
0% {
background-color: red;
margin-left: 0px;
}

25% {

background-color: red;
margin-left: 0px;
}

50% {
	background-color: red;
   	margin-left: 0px;
}

}
2. μ‹€ν–‰ ν•˜κ³  싢은 λ°•μŠ€ν΄λž˜μŠ€μ— animation-name: boxAni; λ„£μ–΄μ£Όκ³  animation-duration λ“±λ“±λ“± 속성 적어주면 λœλ‹€!

.box {
animation-name: boxAni;
animation-duration: 2s;
animation-delay:1s
animation-fill-mode: both;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-play-state: paused(정지) , running(μ‹€ν–‰) => μ»€μ„œμ˜¬λ €λ†¨μ„λ•Œ μ‹€ν–‰λ˜κ³  μ»€μ„œμ˜¬λ €λ†¨μ„λ•Œ μ •μ§€λ˜κ²Œ ν•˜λŠ” κ±° ν•˜κ³  μ‹Άμ„λ•Œ!!
}

πŸ“– transform : 크기변화λ₯Ό μ£ΌλŠ” μš©λ„

1. 이동 : translate(x,y)

=> x,y μ’Œν‘œλ§ŒνΌ 이동

2. 크기 : scale(2,2)

=> κ°€λ‘œ,μ„Έλ‘œ 2λ°°

3. 기울이기 : skew(xdeg, ydeg)

=> xμΆ• yμΆ• κΈ°μ€€ 기울이기

4. νšŒμ „μ‹œν‚€κΈ° : rotate(90deg)

=> 90도 돌렀라

5. 기쀀점 : transform-origin: x y

x = left center right
y = top center bottom

μ΄λŸ°μ‹μœΌλ‘œ ν•œλ²ˆμ— λ‹€ μ“Έ 수 μžˆλ‹€!

transform:scale(2,2) rotate(45deg);

πŸ“Œμ •λ¦¬

transition : λ‹€λ₯Έ μ†μ„±λ“€μ˜ λ³€ν™”, μΌμ •μ‹œκ°„λ™μ•ˆ μžμ—°μŠ€λŸ½κ²Œ // 이벀트(λ§ˆμš°μŠ€μ˜€λ²„)
animation : μ—¬λŸ¬λ‹¨κ³„λ‘œ λ‚˜λˆ μ„œ, μ›€μ§μž„ // λͺ‡νšŒλ°˜λ³΅, λ¬΄μ œν•œ 반볡
transform : 크기,νšŒμ „,이동

transition => λ§ˆμš°μŠ€μ˜€λ²„μΌλ•Œ λ‹€μ‹œ μ›λž˜λŒ€λ‘œ λŒμ•„μ˜€λŠ”νš¨κ³ΌOOOO
animation => λ§ˆμš°μŠ€μ˜€λ²„μΌλ•Œ λ‹€μ‹œ μ›λž˜λŒ€λ‘œ λŒμ•„μ˜€λŠ”νš¨κ³ΌXXXX

transition + transform
animation + transform

profile
λ’€μ£½λ°•μ£½ 벨둜그

0개의 λŒ“κΈ€