21.08.07
Today I Learned
audio.html
<!-- Audio Main -->
<main id="audio-main" role="main">
<div class="audio-container audio-flex-between">
<!-- Audio Main Left -->
<div class="audio-main-left">
<!-- Audio Today -->
<div id="audio-today" class="audio-section">
<div class="audio-header">
<h2>오늘의 오디오클립</h2>
</div>
<div class="audio-body">
<div class="audio-slide-wrap">
<div class="audio-slide audio-flex-between">
<img src="https://via.placeholder.com/380x198" alt="audio image" />
<div class="txt-wrap">
<h3>[재혼 황후] 오디오 드라마</h3>
<p>오디오 드라마로 만나는 레전드 웹소설!</p>
</div>
</div>
<button class="btn btn-left"></button>
<button class="btn btn-right"></button>
</div>
</div>
</div>
<!-- Audio Original -->
<div id="audio-original" class="audio-section">
<div class="audio-header">
<h2>오디오클립 추천 오리지널</h2>
</div>
<div class="audio-body">
<ul class="audio-flex-between">
<li>
<a href="#">
<img src="https://via.placeholder.com/120" alt="audio image" />
<h3>Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li>
<a href="#">
<img src="https://via.placeholder.com/120" alt="audio image" />
<h3>Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li>
<a href="#">
<img src="https://via.placeholder.com/120" alt="audio image" />
<h3>Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li>
<a href="#">
<img src="https://via.placeholder.com/120" alt="audio image" />
<h3>Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li>
<a href="#">
<img src="https://via.placeholder.com/120" alt="audio image" />
<h3>Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
</ul>
<button class="btn btn-right"></button>
</div>
</div>
<!-- Audio Playlist -->
<div id="audio-playlist" class="audio-section">
<div class="audio-header">
<h2>나를 위한 플레이리스트</h2>
<p>당신을 위해 매일 새롭게 업데이트 됩니다.</p>
<a href="#" class="link-total">전체보기</a>
</div>
<div class="audio-body">
<ul class="audio-flex-between">
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/152" alt="audio image" />
<i class="icon-play"></i>
</div>
<h3>이번주 베스트 추천</h3>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/152" alt="audio image" />
<i class="icon-play"></i>
</div>
<h3>이번주 베스트 추천</h3>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/152" alt="audio image" />
<i class="icon-play"></i>
</div>
<h3>이번주 베스트 추천</h3>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/152" alt="audio image" />
<i class="icon-play"></i>
</div>
<h3>이번주 베스트 추천</h3>
</a>
</li>
</ul>
<button class="btn btn-right"></button>
</div>
</div>
<!-- Audio Live-->
<div id="audio-live" class="audio-section">
<div class="audio-header">
<h2>라이브 ON</h2>
</div>
<div class="audio-body">
<ul class="audio-flex-between">
<li class="active">
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/120" alt="audio image" />
<div class="live-state">
<span class="live">LIVE</span>
</div>
</div>
<h3>Title 1Title 1Title 1Title 1Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/120" alt="audio image" />
<div class="live-state">
<span class="live">LIVE</span>
</div>
</div>
<h3>Title 1Title 1Title 1Title 1Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/120" alt="audio image" />
<div class="live-state">
<span class="live">LIVE</span>
</div>
</div>
<h3>Title 1Title 1Title 1Title 1Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/120" alt="audio image" />
<div class="live-state">
<span class="live">LIVE</span>
</div>
</div>
<h3>Title 1Title 1Title 1Title 1Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/120" alt="audio image" />
<div class="live-state">
<span class="live">LIVE</span>
</div>
</div>
<h3>Title 1Title 1Title 1Title 1Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
</ul>
<button class="btn btn-right"></button>
</div>
</div>
<!-- Audio Book -->
<div id="audio-book" class="audio-section">
<div class="audio-header">
<h2>주간 베스트 오디오북 TOP 100</h2>
</div>
<div class="audio-body">
<ul class="audio-flex-between">
<li class="active">
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/120x174" alt="audio image" />
<div class="live-state">
<span class="time">2시간 14분</span>
</div>
</div>
<h3>Title 1Title 1Title 1</h3>
<span class="author-1">개발자</span>
<span class="author-2">개발자</span>
<span class="price">대여 3,500원</span>
</a>
</li>
<li class="active">
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/120x174" alt="audio image" />
<div class="live-state">
<span class="time">2시간 14분</span>
</div>
</div>
<h3>Title 1Title 1Title 1</h3>
<span class="author-1">개발자</span>
<span class="author-2">개발자</span>
<span class="price">대여 3,500원</span>
</a>
</li>
<li class="active">
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/120x174" alt="audio image" />
<div class="live-state">
<span class="time">2시간 14분</span>
</div>
</div>
<h3>Title 1Title 1Title 1</h3>
<span class="author-1">개발자</span>
<span class="author-2">개발자</span>
<span class="price">대여 3,500원</span>
</a>
</li>
<li class="active">
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/120x174" alt="audio image" />
<div class="live-state">
<span class="time">2시간 14분</span>
</div>
</div>
<h3>Title 1Title 1Title 1</h3>
<span class="author-1">개발자</span>
<span class="author-2">개발자</span>
<span class="price">대여 3,500원</span>
</a>
</li>
<li class="active">
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/120x130" alt="audio image" />
<div class="live-state">
<span class="time">2시간 14분</span>
</div>
</div>
<h3>Title 1Title 1Title 1</h3>
<span class="author-1">개발자</span>
<span class="author-2">개발자</span>
<span class="price">대여 3,500원</span>
</a>
</li>
</ul>
<button class="btn btn-right"></button>
</div>
</div>
<!-- Audio Channel -->
<div id="audio-channel" class="audio-section">
<div class="audio-header">
<h2>새로 나온 채널</h2>
</div>
<div class="audio-body">
<ul class="audio-flex-between">
<li class="active">
<a href="#">
<img src="https://via.placeholder.com/120" alt="audio image" />
<h3>Title 1Title 1Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li class="active">
<a href="#">
<img src="https://via.placeholder.com/120" alt="audio image" />
<h3>Title 1Title 1Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li class="active">
<a href="#">
<img src="https://via.placeholder.com/120" alt="audio image" />
<h3>Title 1Title 1Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li class="active">
<a href="#">
<img src="https://via.placeholder.com/120" alt="audio image" />
<h3>Title 1Title 1Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
<li class="active">
<a href="#">
<img src="https://via.placeholder.com/120" alt="audio image" />
<h3>Title 1Title 1Title 1</h3>
<span class="author">개발자</span>
</a>
</li>
</ul>
<button class="btn btn-right"></button>
</div>
</div>
</div>
<!-- Audio Main Right -->
<div class="audio-main-right"></div>
</div>
</main>
style.css
/* 08-17 */
/* Audio Main */
#audio-main {
width: 100%;
background-color: #f5f8fa;
padding-top: 61px; /* header와 겹쳐지는 부분을 제거 */
}
#audio-main .audio-container {
/* overflow: hidden; main left와 right 영역이 부모 영역의 높이 값에 영향을 주기 위함 */
align-items: flex-start;
}
/* 각 섹션별 공통 디자인 */
.audio-section {
padding: 32px 0;
}
.audio-section .audio-header {
}
.audio-section .audio-header h2 {
font-size: 22px;
font-weight: 500;
letter-spacing: -0.8px; /* 자간 간격 조절 */
}
.audio-section .audio-body {
position: relative;
padding-top: 19px;
}
.audio-section .audio-body .btn {
position: absolute;
width: 35px;
height: 35px;
background-color: yellow;
border-radius: 50%;
}
.audio-section .audio-body .btn-left {
left: -17px;
}
.audio-section .audio-body .btn-right {
right: -17px;
}
/* Audio Main Left */
#audio-main .audio-main-left {
/* float: left; */
width: 660px;
}
/* Audio Today */
#audio-today .audio-slide {
align-items: flex-start;
}
#audio-today .audio-slide-wrap {
position: relative;
width: 100%;
}
#audio-today .audio-slide-wrap .btn {
top: 83px;
}
#audio-today .audio-slide img {
width: 380px;
height: 198px;
}
#audio-today .audio-slide .txt-wrap h3 {
font-size: 18px;
padding-top: 2px;
}
#audio-today .audio-slide .txt-wrap p {
margin-top: 12px;
}
/* Audio Original */
#audio-original {
}
#audio-original .audio-body {
position: relative;
}
#audio-original .audio-body ul {
align-items: flex-start;
}
#audio-original .audio-body ul li {
width: 120px;
}
#audio-original .audio-body ul li img {
border-radius: 10px;
}
#audio-original .audio-body ul li h3 {
font-size: 13px;
margin-top: 10px;
}
#audio-original .audio-body .author {
font-size: 12px;
margin-top: 2px;
color: #959595;
}
#audio-original .audio-body .btn-right {
top: 60px;
}
/* Audio Playlist */
#audio-playlist {
}
#audio-playlist .audio-header {
position: relative;
}
#audio-playlist .audio-header h2 {
}
#audio-playlist .audio-header p {
margin-top: 8px;
font-size: 13px;
font-weight: 400;
color: #888;
}
#audio-playlist .audio-header .link-total {
display: block;
position: absolute;
right: 0;
top: 6px;
padding: 10px 18px 8px;
background-color: #fff;
font-size: 13px;
border: solid 1px rgba(0, 0, 0, 0.1);
border-radius: 20px;
box-shadow: 0 2px 10px 0 rgb(80, 85, 91 / 7%);
color: #157efb;
}
#audio-playlist .audio-body {
}
#audio-playlist .audio-body ul {
align-items: flex-start;
}
#audio-playlist .audio-body li {
width: 152px;
border: solid 1px rgba(0, 0, 0, 0.1);
border-radius: 4px;
}
#audio-playlist .audio-body .image-wrap {
position: relative;
width: 150px;
height: 150px;
}
#audio-playlist .audio-body .image-wrap img {
position: absolute;
width: 100%;
height: 100%;
}
#audio-playlist .audio-body .image-wrap .icon-play {
position: absolute;
bottom: -16px;
right: 10px;
width: 32px;
height: 32px;
background-color: yellow;
border-radius: 50%;
}
#audio-playlist .audio-body h3 {
background-color: #fff;
padding: 17px 11px;
font-size: 13px;
}
#audio-playlist .btn-right {
top: 90px;
}
/* Audio Live */
#audio-live {
}
#audio-live .audio-body {
align-items: flex-start; /* 위쪽으로 정렬시키기 위함 */
}
#audio-live .audio-body li {
width: 120px;
}
#audio-live .audio-body li .image-wrap {
position: relative;
width: 120px;
height: 120px;
border: solid 1px gray;
border-radius: 50%;
}
#audio-live .audio-body li .image-wrap img {
position: absolute;
width: 100%;
height: 100%;
border: solid 1px #fff;
border-radius: 50%;
}
#audio-live .audio-body li .image-wrap .live-state {
position: absolute;
bottom: -15px;
left: 50%;
transform: translateX(-50%); /* x축 중앙정렬 */
padding: 2px;
border: solid 1px #fff;
border-radius: 3px;
background-color: #fff;
}
#audio-live .audio-body li .image-wrap .live-state .live {
display: block;
padding: 4px 5px;
color: red;
border: solid 2px red;
border-radius: 3px;
background-color: #fff;
font-size: 10px;
}
#audio-live .audio-body li.active .image-wrap .live-state .live {
border: solid 2px red;
background-color: red;
color: #fff;
}
#audio-live .audio-body h3 {
margin-top: 16px;
font-size: 13px;
}
#audio-live .audio-body .author {
margin-top: 6px;
font-size: 12px;
color: #959595;
}
/* Audio Book */
#audio-book {
}
#audio-book .audio-body {
}
#audio-book .audio-body ul {
align-items: flex-start;
}
#audio-book .audio-body li {
width: 120px;
}
#audio-book .audio-body .image-wrap {
position: relative;
width: 100%;
}
#audio-book .audio-body .image-wrap img {
width: 100%;
}
#audio-book .audio-body .image-wrap .time {
position: absolute;
padding: 2px 5px 0;
background-color: rgba(17, 17, 17, 0.75);
font-size: 11px;
color: #fff;
right: 5px;
bottom: 5px;
}
#audio-book .audio-body li h3 {
font-size: 13px;
margin-top: 11px;
}
#audio-book .audio-body li .author-1 {
display: block;
font-size: 12px;
margin-top: 4px;
color: #959595;
}
#audio-book .audio-body li .author-2 {
display: block;
font-size: 12px;
}
#audio-book .audio-body li .price {
display: block;
font-size: 12px;
margin-top: 4px;
font-weight: 500;
}
/* Audio Channel */
#audio-channel {
}
#audio-channel .audio-body {
}
#audio-channel .audio-body ul {
align-items: flex-start;
}
#audio-channel .audio-body li {
width: 120px;
height: 120px;
}
#audio-channel .audio-body li img {
width: 120px;
height: 120px;
border: solid 1px rgba(0, 0, 0, 0.2);
border-radius: 5px;
}
#audio-channel .audio-body li h3 {
font-size: 13px;
margin-top: 10px;
}
#audio-channel .audio-body li .author {
font-size: 12px;
margin-top: 6px;
color: #959595;
}
/* Audio Main Right */
#audio-main .audio-main-right {
/* float: right; */
width: 330px;
}
Review
今日はオーディオクリップサイトのメイン左側の領域をコピーしました.各セクションには重複する多機能セクションが多いため、より多くの汎用設計プロパティを追加すると、各セクションで作成されるコードの量が減少する可能性があります.今度コピー猫の操作をするときは、やってみなければなりません.
Reference
この問題について(21.08.07), 我々は、より多くの情報をここで見つけました https://velog.io/@pyeonne/21.08.07テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol