π’
μ λ² ν¬μ€ν
μμ μ€κ³, λμμΈνλ κ²μ ν λλ‘ νλ¬κ·ΈμΈμ κ°μ Έμ μ¬μ©μκ° μ¬μ©ν νλ©΄μ ꡬνν΄λ³΄μμ΅λλ€.
μ λ μμ§ λ°±μλκ°λ°κΉμ§λ λΆμ‘±ν¨μ΄ λ§κΈ° λλ¬Έμ μλ²μ μ°λμ νμ§ μκ³
μ€ν¬λ¦½νΈμ μ μ΄μΏΌλ¦¬λ‘ ν μ μλ λ§νΌ μ§νν΄λ³Ό μμ μ
λλ€.
μ΄μ ν¬μ€ν π
https://yeonzzy.tistory.com/15
step.1 νλ¬κ·ΈμΈ λ€μ΄λ‘λ
λ€μ΄λ‘λ ν ν΄λλ₯Ό κ°μ Έμ vsCode λλ μμ£Ό μ¬μ©νλ μλν°ν΄λ‘ λΆλ¬μ¨λ€.
index.htmlμ μ΄μ΄λ³΄λ©΄ μ¬μ©νμ§ μμ μ΄λ―Έμ§μ λ²νΌ λ±μ μ§μμ£Όκ³ λ¬λ ₯λ§ λ¨κ²¨λμ μνλ‘ μμ.
step.2 μΊλ¦°λ(λ¬λ ₯) λ‘λ
λ¬λ ₯μ λ‘λμν€κΈ° μν΄ βμλ¨μ ν΄λΉ cssμ°κ²°
** μ΄λ reset.cssλ κΈ°λ³ΈμΌλ‘ λ€μ΄κ°λ λΆλΆμ μΆκ°μ μΌλ‘ λ§λ€μ΄ μ°κ²°.
<head>
<link rel="stylesheet" href="css/monthly.css">
<link rel="stylesheet" href="css/reset.css">
</head>
/* reset.css */
@charset "utf-8";
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;300;400;500;700;900&display=swap');
*{
margin: 0;
padding: 0;
font-family: 'Noto Sans KR', sans-serif !important;
}
html, body{
width: 100%;
height: 100%;
}
ol, ul, li{
list-style: none;
}
a{
text-decoration: none;
}
header, nav, article, aside, main, section, footer{
display: block;
}
img{
display: block;
}
βμΊλ¦°λ(λ¬λ ₯)μ λ‘λνκ³ μ νλ λΆλΆμ bodyμ κΈ°μ
** body μμͺ½μ pageλΆν° λ£μ΄μ€λ€. id="myCalendar" λΆλΆμ calendarκ° κ·Έλ €μ§λ€.
<div class="page">
<div style="display:inline-block;">
<div class="monthly" id="mycalendar" style="width: 100%; height: 50px;"></div>
</div>
</div>
π€μ€ν¬λ¦½νΈ μ°κ²° λ° μμ±
** bodyκ° λλκΈ° μ scriptλ₯Ό μ°κ²°ν΄μ€λ€.
** μ¬κΈ°μ μ£Όμμ²λ¦¬μ μ΄μ λ μλ°μ€ν¬λ¦½νΈλ λ‘컬 xmlμ λΆλ¬μ¬ λ 보μμ CORS ERRORκ° λ°μνκΈ° λλ¬Έ.
** μλ²μ μ°κ²°νμ¬ μ¬μ©νλ κ²½μ° mode / jsonUrl / dataType μ΄ νμνλ€.
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/monthly.js"></script>
<script type="text/javascript">
$(window).load( function() {
$('#mycalendar').monthly({
//mode: 'event',
//jsonUrl: 'https://cors-anywhere.herokuapp.com/events.json',
//dataType: 'json',
//xmlUrl: 'events.xml'
// weekStart: 'Sun',
// setWidth: '80%'
});
});
</script>
step3. νλ©΄μ νμν λΆλΆμ μΆκ°μ μΌλ‘ λ£μ΄μ€λ€.
** μ€λ₯Έμͺ½μ νν°(λ²μ£Ό)μ [μκΆμ¬μ©] λ²νΌμ΄ λ€μ΄κ°μΌνλ―λ‘ μΆκ°μ μΈ μμ μ΄ μ΄λ€μ§
<div id="right">
<div class="right-container">
<div class="r-new-schedule">
<button id="new-schedule-btn">μκΆμ¬μ©</button>
</div>
<div class="r-calendars">
<div class="r-calendars-item">
<label>
<input type="checkbox" id="item-check-square" value="all" checked>
<span class="viewAll">View all</span>
</label>
</div>
<!-- νμ¬ κ·Όλ¬΄μ§κ° μ¬λ¬κ° μΌ κ²½μ° -->
<div class="calendarList u-calendarList">
<label>
<input type="checkbox" value="1" name="listChk" class="filter-location" checked>
<span class="list-round list-round-doksan"></span>
<span class="list-title">λ
μ° λ³Έμ¬</span>
</label>
<label>
<input type="checkbox" value="2" name="listChk" class="filter-location" checked>
<span class="list-round list-round-uiwang"></span>
<span class="list-title">μμ</span>
</label>
</div>
</div>
</div>
</div>
** κΈ°μ‘΄μ μλ monthly.css μ μΆκ°μ μΈ μ€νμΌμ μ νμ€.
** κΈ°μ‘΄ νλ¬κ·ΈμΈμ μΊλ¦°λ(λ¬λ ₯) μ€νμΌμ μμ νκ³ μΆμ κ²½μ° monthly.cssλ₯Ό νμ©νλ€.
/* monthly.css */
@charset "utf-8";
/* right */
#right{
position: fixed;
top: 0;
right: 0;
bottom: 0;
width: 200px;
height: 100%;
background-color: #fafafa;
z-index: 9;
font-size: 14px;
}
#right .right-container{
width: 100%;
height: 100%;
padding: 12px 10px;
box-sizing: border-box;
margin: 0 auto;
}
.r-new-schedule{
padding-bottom: 12px;
border-bottom: 1px solid #e5e5e5;
}
/* μκΆμ¬μ© λ²νΌ */
button#new-schedule-btn{
width: 180px;
height: 40px;
border-radius: 25px;
background-color: #00a9ff;
border: 0;
padding: 10px 20px;
color: #fff;
cursor: pointer;
}
button#new-schedule-btn:focus{
outline: none;
}
button#new-schedule-btn:hover{
background-color: #008ee7;
transition: all 1.0s;
}
.r-calendars-item{
padding: 20px;
border-bottom: 1px solid #e5e5e5;
font-size: 0.8rem;
}
.r-calendars-item > label{
display: inline-block;
font-weight: normal;
}
.r-calendars-item > label > span.viewAll{
display: inline-block;
padding-left: 25px;
}
input[type="checkBox"]#item-check-square{
display: none;
}
input[type="checkBox"]#item-check-square + span.viewAll{
display: inline-block;
cursor: pointer;
line-height: 14px;
background: url(../images/checkBox-false.png) no-repeat;
}
input[type="checkBox"]#item-check-square:checked ~ span.viewAll{
background: url(../images/checkBox-true.png) no-repeat;
}
.calendarList{
width: 100%;
height: auto;
padding: 10px 20px;
box-sizing: border-box;
border-bottom: 1px solid #e5e5e5;
}
.calendarList>ul>li{
/* border: 1px solid; */
height: 30px;
line-height: 30px;
font-size: 0.8rem;
color: #333;
}
/* μ¬μ©μ μΌ λ "μ¬μ©μ΄λ ₯" λ²μ£Ό μμ */
.u-calendarList>ul>li:nth-child(1) span.list-round{
background-color: #BAD532;
}
.u-calendarList>ul>li:nth-child(2) span.list-round{
background-color: #ff8f4e;
}
span.list-title{
vertical-align: 2px;
}
/* filter : location */
.calendarList > label{
display: inline-block;
font-weight: normal;
width: 100%;
}
.calendarList > label:nth-child(1){
margin-bottom: 10px;
}
input[type="checkBox"].filter-location{
display: none;
}
input[type="checkBox"].filter-location + span.list-round{
display: inline-block;
cursor: pointer;
width: 10px;
height: 10px;
line-height: 12px;
/* vertical-align: middle; */
margin-right: 8px;
border-radius: 8px;
border:2px solid;
background: transparent;
}
span.list-round-doksan{
color: #BAD532;
}
span.list-round-uiwang{
color: #ff8f4e;
}
input[type="checkBox"].filter-location:checked ~ span.list-round-doksan{
background-color: #BAD532;
}
input[type="checkBox"].filter-location:checked ~ span.list-round-uiwang{
background-color: #ff8f4e;
}
.calendarList > label > span.list-title{
font-size: 0.8rem;
}
'study > calendar' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[calendar] λ¬λ ₯μ μ΄μ©νμ¬ μκΆ μ¬μ©/λ±λ‘/λ°κΈνκΈ°(1) : μ€κ³ λ° λμμΈ (0) | 2021.05.19 |
---|