반응형
✨CSS Image Hover Effects
No Effect
1. Zoom In #1
Hover
/* Zoom In #1 */
.hover01 figure img {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
.hover01 figure:hover img {
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
2. Zoom Out #1
Hover
/* Zoom Out #1 */
.hover02 figure img {
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
.hover02 figure:hover img {
-webkit-transform: scale(0.5);
transform: scale(0.5);
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
3. Slide
Hover
/* Slide */
.hover03 figure img {
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
.hover03 figure:hover img {
margin-left: -20px;
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
4. Rotate(+Zoom Out)
Hover
/* Rotate */
.hover04 figure img {
-webkit-transform: rotate(0) scale(1);
transform: rotate(0) scale(1);
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
.hover04 figure:hover img {
-webkit-transform: rotate(15deg) scale(0.5);
transform: rotate(15deg) scale(0.5);
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
5. Blur
Hover
/* Blur */
.hover05 figure img {
-webkit-filter: blur(0);
filter: blur(0);
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
.hover05 figure:hover img {
-webkit-filter: blur(3px);
filter: blur(3px);
}
6. Gray Scale
Hover
/* Gray Scale */
.hover06 figure img {
-webkit-filter: grayscale(0);
filter: grayscale(0);
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
.hover06 figure:hover img {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
7. Sepia
Hover
/* Sepia */
.hover07 figure img {
-webkit-filter: sepia(0);
filter: sepia(0);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover07 figure:hover img {
-webkit-filter: sepia(100%);
filter: sepia(100%);
}
8. Blur + Gray Scale
Hover
/* Blur + Gray Scale */
.hover08 figure img {
-webkit-filter: grayscale(0) blur(0);
filter: grayscale(0) blur(0);
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
.hover08 figure:hover img {
-webkit-filter: grayscale(100%) blur(3px);
filter: grayscale(100%) blur(3px);
}
9. Opacity #1
Hover
/* Opacity #1 */
.hover09 figure img {
opacity: 1;
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
.hover09 figure:hover img {
opacity: .5;
}
10. Opacity #2
Hover
/* Opacity #2 */
.hover10 figure img {
opacity: 1;
-webkit-transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
.hover10 figure:hover img {
opacity: .10;
}
11. Flashing
Hover
/* Flashing */
.hover11 figure:hover img {
opacity: 1;
-webkit-animation: flash 1.5s;
animation: flash 1.5s;
}
@-webkit-keyframes flash {
0% {
opacity: .4;
}
100% {
opacity: 1;
}
}
@keyframes flash {
0% {
opacity: .4;
}
100% {
opacity: 1;
}
}
12. Shine
Hover
/* Shine */
.hover12 figure {
position: relative;
}
.hover12 figure::before {
position: absolute;
top: 0;
left: -75%;
z-index: 2;
display: block;
content: '';
width: 50%;
height: 100%;
background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 100%);
background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 100%);
-webkit-transform: skewX(-25deg);
transform: skewX(-25deg);
opacity: 0;
}
.hover12 figure:hover::before {
-webkit-animation: shine .75s;
animation: shine .75s;
}
@-webkit-keyframes shine {
0% {
opacity: 1;
}
40% {
opacity: 1;
}
100% {
left: 125%;
opacity: 0;
}
}
@keyframes shine {
0% {
opacity: 1;
}
40% {
opacity: 1;
}
100% {
left: 125%;
opacity: 0;
}
}
13. Circle
Hover
/* Circle */
.hover13 figure {
position: relative;
}
.hover13 figure::before {
position: absolute;
top: 50%;
left: 50%;
z-index: 2;
display: block;
content: '';
width: 0;
height: 0;
background: rgba(255,255,255,.2);
border-radius: 100%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
opacity: 0;
}
.hover13 figure:hover::before {
-webkit-animation: circle .75s;
animation: circle .75s;
}
@-webkit-keyframes circle {
0% {
opacity: 1;
}
40% {
opacity: 1;
}
100% {
width: 200%;
height: 200%;
opacity: 0;
}
}
@keyframes circle {
0% {
opacity: 1;
}
40% {
opacity: 1;
}
100% {
width: 200%;
height: 200%;
opacity: 0;
}
}
300x250
'개발언어 > JS' 카테고리의 다른 글
[자바스크립트] onclick, onchange, onmouse, onkeyup 이벤트 함수 (0) | 2022.05.10 |
---|---|
[JS] replace, replaceAll 사용방법 (0) | 2022.05.03 |
[CSS] 투명도 설정 하는법 - opacity / rgba (0) | 2022.04.10 |
[CSS] background-repeat (배경 이미지 반복 여부) (0) | 2022.04.09 |
[CSS] 컬러 차트 리스트 (0) | 2022.04.08 |