소제목 파란색 반짝 코드
<div class="center-glass-bar">
<h2 class="center-bar-title">여기에 소제목 내용을 입력하세요</h2>
</div>
<style>
.center-glass-bar {
width: 100%;
margin: 30px 0;
position: relative;
overflow: hidden;
background-color: #0047ff; /* 쨍한 파란색 */
border-radius: 6px;
box-shadow: 0 4px 12px rgba(0, 71, 255, 0.2);
/* 텍스트 중앙 정렬 추가 */
text-align: center;
}
.center-bar-title {
margin: 0;
padding: 20px 25px;
color: #ffffff;
font-size: 1.6rem;
font-weight: 900;
position: relative;
z-index: 2; /* 빛보다 위에 위치 */
text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
display: block; /* 가로 전체를 차지하게 함 */
}
/* 더 강렬해진 유리창 반사광 */
.center-glass-bar::before {
content: "";
position: absolute;
top: 0;
left: -150%;
width: 100%;
height: 100%;
/* 중앙 농도를 0.9까지 올려서 아주 번쩍이게 설정 */
background: linear-gradient(
110deg,
rgba(255, 255, 255, 0) 15%,
rgba(255, 255, 255, 0.2) 35%,
rgba(255, 255, 255, 0.9) 50%,
rgba(255, 255, 255, 0.2) 65%,
rgba(255, 255, 255, 0) 85%
);
transform: skewX(-25deg);
animation: center-shine 1.6s infinite cubic-bezier(0.4, 0, 0.2, 1);
z-index: 1;
}
@keyframes center-shine {
0% { left: -150%; }
45% { left: 150%; } /* 1.35초 동안 슥 지나감 */
100% { left: 150%; } /* 남은 시간 대기 후 다시 시작 */
}
</style>