WebPublisher/CSS

[css] shining event

amanda 2023. 11. 9. 10:36
/* 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;
	}
}