블로그 날짜를 캘린더 형식으로 표시하기 위한 소스입니다.
HTML 부분
Monday24March2014
CSS 부분
.calendar_item {
color: #8d8d7e;
width: 92.3076923077px;
height: 120px;
position: absolute;
margin: 0 auto;
left: 0;
right: 0;
top: 50%;
margin-top: -60px;
border-radius: 10px;
text-align: center;
text-transform: uppercase;
box-shadow: 0px 3px 0 2px rgba(0, 0, 0, 0.05), 0 0 0 1px #8d8d7e, 0 0 0 2px #777;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}
.calendar_item > * {
position: relative;
z-index: 10;
}
.calendar_item::before {
content: '';
display: block;
position: absolute;
background-image: linear-gradient(#f7f7ea, #cfcfc4);
box-shadow: inset 0 -1px 0 #bbb, inset 0 3px 0 fbfbed;
top: 0;
left: 0;
right: 0;
height: 60px;
border-radius: 10px 10px 0 0;
}
.calendar_item::after {
content: '';
display: block;
position: absolute;
background-image: linear-gradient(#f7f7ea, #cfcfc4);
box-shadow: inset 0 -2px 0 #f9f9ec, inset 0 -3px 0 #fbfbed;
bottom: 0;
left: 0;
right: 0;
height: 60px;
border-radius: 0 0 10px 10px;
}
.calendar_item > .weekday {
font-size: 14px;
margin-top: 10px;
font-weight: 300;
}
.calendar_item > .day {
font-size: 64px;
margin-top: 0px;
text-indent: -1px;
font-weight: 600;
font-family: impact;
position: relative;
opacity: 0.5;
color: #68683d;
}
.calendar_item > .day::before {
content: '';
display: block;
position: absolute;
background-image: linear-gradient(#999, #555);
top: 50%;
margin-top: -1px;
left: 2px;
height: 10px;
width: 3px;
border-radius: 4px;
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.calendar_item > .day::after {
content: '';
display: block;
position: absolute;
background-image: linear-gradient(#999, #555);
top: 50%;
margin-top: -1px;
right: 2px;
height: 10px;
width: 3px;
border-radius: 4px;
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.calendar_item > .month {
font-size: 11px;
margin-top: -2px;
font-weight: 300;
}
.calendar_item > .year {
font-size: 14px;
font-weight: 600;
}
글꼴에 따라서 글자 크기를 조절해야 할 수도 있습니다.
Javascript 부분
$month = new Array();
$month = ["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"];
$day = new Array();
$day = ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'];
//연도 두자리 표시
$(".calendar_item > .year").html($date.getFullYear());
//월 뒤에 한칸 띄어쓰기
$(".calendar_item > .month").html($month[$date.getMonth()]);
$(".calendar_item > .day").html($date.getDate());
//요일 설정
$(".calendar_item > .weekday").html($day[$date.getDay()]);
월과 요일은 영문으로 표시해도 보기 좋음
결과 모양 (이미지)
보관용으로 작성합니다.
'WebProgram > Tistory' 카테고리의 다른 글
| [ Tstory ] 글쓴 날자를 캘린더 형식으로 만들기 (0) | 2018.06.15 |
|---|---|
| [애드센스] 광고 서식 지정 없이 본문 중간에 자동으로 삽입하기 (내용 추가 수정) (0) | 2018.05.30 |
| [애드센스] 광고 본문 중간에 자동으로 삽입하기 (서식 지정 없음) (0) | 2018.05.20 |
| [Tistory] 티스토리 블로그 공감 버튼 변경 (1) | 2018.05.17 |
| [Tistory] 티스토리 블로그 공감 버튼아래 클릭 유도 글귀 넣는 방법 (6) | 2017.03.14 |
| [ jQuery / CSS ] 제이쿼리와 CSS를 이용한 반응형 유튜브 플레이어 (0) | 2016.05.16 |
| [ Tistory ] 링크를 카테고리화하는 방법 (2) | 2016.04.06 |
| [ Tistory ] 사이드바용 달력 위젯 (0) | 2016.04.04 |