Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yaena1223 committed Jul 10, 2022
2 parents c0e3e03 + 4bcee4b commit 22b198d
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 43 deletions.
9 changes: 6 additions & 3 deletions runningmate/mateapp/templates/mateapp/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,15 @@
</div>

<div class="item2" id="today_date">
<button class="nav-btn go-prev" onclick="preDay()">&lt;</button>
<!-- <button class="nav-btn go-prev" onclick="preDay()">&lt;</button> -->
<div id="today_day">

<div class="day_week">
</div>
<div class="date_week">
</div>
</div>
<!-- <button class="nav-btn go-next" onclick="nextDay()">&gt;</button> -->
<script src="{% static 'js/today.js'%}"></script>
<button class="nav-btn go-next" onclick="nextDay()">&gt;</button>
</div>

<!-- ๋””๋ฐ์ด -->
Expand Down
4 changes: 2 additions & 2 deletions runningmate/mateapp/templates/mateapp/create_schedule.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ <h2>ํ•  ์ผ์ด ์žˆ๋‚˜์š”? ์ผ์ •์„ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”!</h2>
<textarea type="body" id="ipt4" name="body" id="" cols="30" rows="10" placeholder=" ์ผ์ •์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”"></textarea><br><br>
</div>
</div>
<a href="{% url 'mateapp:calendar' %}">
<a href="{% url 'mateapp:calendar' %}" style="text-decoration: none;">
<div id="btn">
<button type="submit">์ถ”๊ฐ€ํ•˜๊ธฐ</button>
</div>
</div>
</a>
</form>
</div>
Expand Down
26 changes: 23 additions & 3 deletions runningmate/runningmate/static/css/calender.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
grid-template-columns: 2fr 1.5fr 2fr;
grid-template-rows: 1fr 5fr 1fr 2.5fr 1.5fr 1.5fr 1.5fr 15px;
height: 100%;
row-gap: 10px;
row-gap: 15px;
column-gap: 20px;
font-family: AppleSDGothicNeoB;
font-weight: 500;
Expand Down Expand Up @@ -112,9 +112,12 @@


/*์บ˜๋ฆฐ๋” ํŽ˜์ด์ง€ ์บ˜๋ฆฐ๋”*/
.calendar {
margin-top: 3%;
}

.cal_main2{/*์บ˜๋ฆฐ๋” ํŽ˜์ด์ง€ ์บ˜๋ฆฐ๋”*/
font-family: AppleSDGothicNeoB;
font-family: 'AppleSDGothicNeoB';
font-size: 1.7vmin;
}

Expand Down Expand Up @@ -220,6 +223,23 @@ table {
margin-top: -11%;
}

/* ํˆฌ๋ฐ์ด - ์˜ค๋Š˜ ์š”์ผ ๋‚ ์งœ ํ‘œ๊ธฐ ---------*/
.day_week {
font-family: 'Roboto';
font-size: 20px;
font-weight: 400;
text-align: center;
margin-top: 3%;
margin-bottom: 3%;
}

.date_week {
font-family: 'AppleSDGothicNeoB';
font-size: 40px;
text-align: center;
margin-bottom: 3%;
}

/* ํˆฌ๋ฐ์ด - ๋””๋ฐ์ด */
#dday1, #dday2, #dday3{
background-color: white
Expand Down Expand Up @@ -263,7 +283,7 @@ table {
}

#plus{
font-family:AppleSDGothicNeoM;
font-family: 'AppleSDGothicNeoM';
display: inline-block;
font-size:larger;
vertical-align: middle;
Expand Down
2 changes: 1 addition & 1 deletion runningmate/runningmate/static/css/create_schedule.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
text-align: center;
font-family: "AppleSDGothicNeoB";
font-weight: 300;
margin-top: 5%;
margin-top: 3%;
}

#rec3 h2 {
Expand Down
4 changes: 2 additions & 2 deletions runningmate/runningmate/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ span{
}

#logout_button{
position: absolute;
position: fixed;
width: 3vmin;
height: 3vmin;
left: 15vw;
left: 14.5vw;
top: 90vh;
}

Expand Down
35 changes: 17 additions & 18 deletions runningmate/runningmate/static/js/calendar2.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ const renderCalendar = () => {
const viewMonth = date.getMonth();

// year-month ์ฑ„์šฐ๊ธฐ
document.querySelector(".year-month").textContent = `${viewYear}๋…„ ${
viewMonth + 1
}์›”`;
document.querySelector(".year-month").textContent = `${viewYear}๋…„ ${viewMonth + 1
}์›”`;

// ์ง€๋‚œ ๋‹ฌ ๋งˆ์ง€๋ง‰ Date, ์ด๋ฒˆ ๋‹ฌ ๋งˆ์ง€๋ง‰ Date
const prevLast = new Date(viewYear, viewMonth, 0);
Expand Down Expand Up @@ -123,7 +122,7 @@ $.ajaxSetup({
function contextToJson(context) {
const context_to_string = JSON.stringify(context);
const string_to_json = JSON.parse(context_to_string);
return string_to_json;
return string_to_json;
}
document.querySelectorAll(".date").forEach((date) => {
date.addEventListener("click", () => {
Expand All @@ -135,15 +134,15 @@ document.querySelectorAll(".date").forEach((date) => {
success: function (context) {
let object = contextToJson(context);
let status = object.status;
if(status == "exist1" || status == "exist2"){
/*๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐ›์•„์˜ค๊ธฐ*/
if (status == "exist1" || status == "exist2") {
/*๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐ›์•„์˜ค๊ธฐ*/
let title1 = object.title1;
let body1 = object.body1;
let starttime1 = object.starttime1;
let endtime1 = object.endtime1;
let place1 = object.place1;
let color1 = object.color1;

/*html์— ์˜์—ญ ์ถ”๊ฐ€*/
schedule_1.innerHTML = [
"<div id = 'cal_sch1'>",
Expand All @@ -161,31 +160,31 @@ document.querySelectorAll(".date").forEach((date) => {
"</div>",
].join("")


/*html์— ๋‚ด์šฉ ์ถ”๊ฐ€*/
cal_title.innerHTML = title1;
cal_body.innerHTML = body1;
cal_time_place.innerHTML = starttime1 + "~" + endtime1 + "/" + place1;

/*์ œ๋ชฉ ์ƒ‰ css ๋ณ€๊ฒฝ (๊ณผ๋ชฉ ์ƒ‰์ด๋ž‘ ๊ฐ™๊ฒŒ) */
cal_title.style.color =color1;
cal_title.style.color = color1;

/*๋ฏธ๋ชจ์ง€ css ๋ณ€๊ฒฝ ์ถ”๊ฐ€*/
sch1_team1.style.backgroundColor=color1;
sch1_team2.style.backgroundColor=color1;
sch1_team3.style.backgroundColor=color1;
sch1_team4.style.backgroundColor=color1;
sch1_team5.style.backgroundColor=color1;
sch1_team6.style.backgroundColor=color1;
sch1_team1.style.backgroundColor = color1;
sch1_team2.style.backgroundColor = color1;
sch1_team3.style.backgroundColor = color1;
sch1_team4.style.backgroundColor = color1;
sch1_team5.style.backgroundColor = color1;
sch1_team6.style.backgroundColor = color1;
sch1_team1.style.marginRight = '5px';
sch1_team2.style.marginRight = '5px';
sch1_team3.style.marginRight = '5px';
sch1_team4.style.marginRight = '5px';
sch1_team5.style.marginRight = '5px';
sch1_team6.style.marginRight = '5px';

}
}

else {
schedule_1.innerHTML = "<div id = 'no_schedule'>์•„์ง ๋“ฑ๋ก๋œ ์ผ์ •์ด ์—†์–ด์š”</div>";
}
Expand Down
46 changes: 32 additions & 14 deletions runningmate/runningmate/static/js/today.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
let today = new Date.now();
// let today = new Date.now();

// var week = [
// "Sun",
// "Mon",
// "Tue",
// "Wed",
// "Thu",
// "Fri",
// "Sat",
// ];
// const renderDay = () => {
// const viewDay = date.getDay();
// const weekofday = week[viewDay];

// document.querySelector(".today_day").textContent = '{weekofday}';
// } // today_day


const today1 = new Date();

const year = today1.getFullYear();
const month = today1.getMonth() + 1;
const day = today1.getDate();
var week = [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"SUNDAY",
"MONDAY",
"TUESDAY",
"WEDENSDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY",
];
const renderDay = () => {
const viewDay = date.getDay();
const weekofday = week[viewDay];

document.querySelector(".today_day").textContent = '{weekofday}';
} // today_day

document.querySelector(".day_week").innerHTML = week[today1.getDay()];
document.querySelector(".date_week").innerHTML = year + '.' + month + '.' + day;

0 comments on commit 22b198d

Please sign in to comment.