80 lines
1.8 KiB
CSS
80 lines
1.8 KiB
CSS
/* Floating Ads Style */
|
|
/* viewport=1700, body min-width=1700 기준
|
|
콘텐츠 max-width=1400px, 광고 width=140px
|
|
50vw = 850px (페이지 중앙)
|
|
콘텐츠 왼쪽 끝: 50vw - 700px = 150px
|
|
광고 왼쪽 위치: 콘텐츠 왼쪽 끝 - 광고너비 - 여백 = 150 - 140 - 10 = 0px
|
|
→ left: calc(50vw - 700px - 150px) = calc(50vw - 850px) = 0
|
|
실제: left: calc(50vw - 850px) = 0 → 화면 왼쪽 끝
|
|
right: calc(50vw - 850px) = 0 → 화면 오른쪽 끝
|
|
콘텐츠(1400) + 광고(140)*2 + 여백(10)*2 = 1700 → 딱 맞음 */
|
|
|
|
.floating-ad {
|
|
position: fixed;
|
|
top: 150px;
|
|
width: 140px;
|
|
z-index: 990;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 20px;
|
|
max-height: calc(100vh - 200px);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.floating-ad a {
|
|
pointer-events: auto;
|
|
}
|
|
|
|
/* 콘텐츠(1400px) 바깥 좌우에 배치
|
|
left = (페이지너비 - 콘텐츠너비) / 2 - 광고너비 - 여백
|
|
= (1700 - 1400) / 2 - 140 - 10 = 150 - 150 = 0
|
|
→ 화면 가장자리에 딱 붙음, 콘텐츠와 겹치지 않음 */
|
|
.floating-ad.left {
|
|
left: 0;
|
|
}
|
|
|
|
.floating-ad.right {
|
|
right: 0;
|
|
}
|
|
|
|
.floating-ad a {
|
|
display: block;
|
|
overflow: hidden;
|
|
transition: transform 0.2s;
|
|
}
|
|
|
|
.floating-ad a:not(.floating-contact-btn) {
|
|
width: 140px;
|
|
height: 450px;
|
|
background-color: #f0f0f0;
|
|
}
|
|
|
|
.floating-ad a:hover {
|
|
transform: scale(1.05);
|
|
}
|
|
|
|
.floating-contact-btn {
|
|
display: block;
|
|
margin-top: 15px;
|
|
background-color: #009fe3;
|
|
color: #fff;
|
|
text-align: center;
|
|
padding: 12px 0;
|
|
border-radius: 8px;
|
|
text-decoration: none;
|
|
font-weight: bold;
|
|
transition: background-color 0.3s;
|
|
height: auto;
|
|
}
|
|
|
|
.floating-contact-btn:hover {
|
|
background-color: #007bb5;
|
|
}
|
|
|
|
.floating-ad img {
|
|
width: 100% !important;
|
|
height: 100% !important;
|
|
object-fit: fill !important;
|
|
display: block;
|
|
}
|