반응형
Text Gradient
HTML 구조:
<span class="text-gradient">
<span>
Text Gradient
</span>
</span>
scss 버전:
.text-gradient {
overflow: hidden;
position: relative;
display: inline-block;
vertical-align: top;
font-size: 40px;
font-weight: 900;
line-height: 1.4;
&:before {
content: '';
position: absolute;
width: 110%;
padding: 50% 0;
top: 50%;
left: -5%;
transform: translateY(-50%) rotate(0deg);
transform-origin: center;
background-image: linear-gradient(0, #DE6262, #FFB88C);
background-size: 100% 100%;
animation: rotate 2s infinite linear;
animation-fill-mode: backwards;
animation-direction: alternate;
}
span {
position: relative;
display: inline-block;
vertical-align: top;
mix-blend-mode: screen;
background-color: #fff;
color: #000;
}
}
@keyframes rotate {
0% {
transform: translateY(-50%) rotate(0deg);
}
100% {
transform: translateY(-50%) rotate(180deg);
}
}
반응형
'css > e.g.' 카테고리의 다른 글
[css] 망할 놈의 다크 모드 대응하기 1부 (0) | 2023.08.25 |
---|---|
[css] 텍스트 길이에 맞춰 너비 조절하기 grid-template-columns: minmax(최소너비, max-content) 1fr; (0) | 2022.01.25 |
[css] filter를 이용해 이미지를 white/black 실루엣 이미지로 변경 (0) | 2022.01.22 |
[PC] Gradient Doughnut 2 / Loading (0) | 2021.09.25 |
[PC] Gradient Doughnut 1 (0) | 2021.09.24 |
댓글