diff --git a/backend/sql_app/static/css/style.css b/backend/sql_app/static/css/style.css index 54f1519..a1cc5b2 100644 --- a/backend/sql_app/static/css/style.css +++ b/backend/sql_app/static/css/style.css @@ -28,12 +28,6 @@ body { font-weight: 400; } -@media screen and (min-width: 768px) { - .nav_contents { - max-width: 120rem; - } -} - .nav_contents { padding: 1.2rem 2rem; height: 5.6rem; @@ -96,6 +90,87 @@ body { .material-symbols-outlined { color: white; + cursor: pointer; +} + +@media screen and (min-width: 768px) { + .navBar { + background-color: white; + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + border-bottom: 10px double #85c124; + z-index: 999; + + font-family: "Do Hyeon", sans-serif; + font-weight: 400; + } + + .nav_contents { + padding: 1.2rem 2rem; + height: 5.6rem; + box-sizing: border-box; + justify-content: space-between; + display: flex; + align-items: center; + width: 100%; + margin: 0 auto; + position: relative; + } + + /* 홈화면 이동 */ + .nav_contents a { + font-size: 1.5em; + text-decoration: none; + color: #85c124; + } + + /* 회원가입, 로그인 버튼 */ + .nav_contents ul { + list-style: none; + display: flex; + gap: 1em; + } + + .nav_contents ul li { + display: inline-block; + list-style: none; + } + + /* 검색창 */ + .nav_contents .search-container { + /*width: max-content;*/ + width: 40%; + justify-content: space-between; + display: flex; + align-items: center; + padding: 14px; + background: #85c124; + border-radius: 28px; + } + + .nav_contents .search-container input { + width: 90%; + display: block; + font-size: 1.4em; + outline: none; + border: none; + background: transparent; + color: white; + + font-family: "Nanum Gothic", sans-serif; + font-weight: 400; + } + + .nav_contents .search-container input::placeholder { + color: white; + } + + .material-symbols-outlined { + color: white; + cursor: pointer; + } } main { @@ -103,6 +178,7 @@ main { display: flex; gap: 2em; padding-top: 8rem; + height: auto; } /* sign in/out main */ @@ -129,6 +205,12 @@ main { height: 100%; } +/* Swiper 좌우 버튼 */ +.swiper-button-next, +.swiper-button-prev { + color: #fff !important; +} + /* 대형폐기물, 근처 수거함 */ .contents .secondRow { width: 100%; @@ -143,28 +225,57 @@ main { width: 100%; height: 100%; display: flex; - background-color: #aa7b08; + background-color: #f7d300; border-radius: 50px; text-align: center; align-items: center; justify-content: center; color: white; - font-size: 50px; + font-size: 5vw; cursor: pointer; } +.nearText { + padding-left: 3%; + padding-bottom: 5%; + font-weight: bolder; + text-shadow: 5px 5px 5px #997009; +} +.overText { + padding-bottom: 7%; + font-weight: bolder; + text-shadow: 5px 5px 5px #dfbe04; +} +.imgWrapper { + width: 15vw; + padding-top: 7%; + padding-left: -5%; +} +.oversizeImg { + width: 15vw; + padding-top: 15%; +} +.battery1 { + width: 30%; + object-fit: contain; +} +.battery2 { + width: 40%; + object-fit: contain; +} + /* 근처 */ .contents .secondRow .near { width: 100%; height: 100%; display: flex; - background-color: #f7d300; + background-color: #aa7b08; border-radius: 50px; text-align: center; align-items: center; justify-content: center; color: white; - font-size: 50px; + font-size: 5vw; cursor: pointer; } @@ -194,6 +305,7 @@ footer a { display: flex; justify-content: center; align-items: center; + flex-direction: column; } .swiper-slide { @@ -204,11 +316,13 @@ footer a { color: white; } -.swiper-slide img { - display: block; - width: 100%; - height: 100%; - object-fit: cover; +.swiper-slide > .daily_contents { + display: flex; + height: 70%; + align-items: center; + + font-size: 30px; + font-weight: bold; } .swiper-slide-next { @@ -284,7 +398,7 @@ footer a { /* select box 디자인 */ #gugun { - width: 30%; + width: fit-content; height: 30px; padding: 0 10px; box-sizing: border-box; @@ -300,3 +414,266 @@ footer a { option { height: 25px; } + +.nearMain { + height: 75vh; +} + +/* 검색화면 css */ +.left { + width: 40vw; +} + +.left > img { + width: 40vw; +} + +.right { + font-family: "Nanum Gothic", sans-serif; + font-weight: 800; + font-size: 1.8vw; + + color: #4a4a4a; +} + +.right > .recycleAble { + display: flex; + flex-direction: row; +} + +.right > .recycleHow { + display: flex; + flex-direction: row; +} + +.warning > ul { + padding-inline-start: 1.5em; + line-height: 1.2; +} + +.warning > ul > li { + margin-bottom: 0.6em; +} + +.deco { + width: fit-content; + border-bottom: 3px dotted #578507; + padding-bottom: 2px; +} + +.S_main { + gap: 4em; +} + +/* 대형폐기물 텝메뉴 */ +.tab_menu { + overflow: hidden; + padding: 1px; + display: flex; + width: 40%; +} +.tab_menu > ul { + display: flex; + padding: 0; + margin: 0; + list-style: none; + flex-grow: 1; +} +.tab_menu > ul > li { + flex-grow: 1; +} +.tab_menu ul li a { + display: block; + border: #d0d0d0 solid 1px; + background-color: #f4f4f4; + line-height: 22px; + padding: 16px 0; + text-align: center; + color: #333333; + font-weight: 600; + text-decoration: none; +} + +.tab_menu ul li.on a, +.tab_menu ul li a:hover { + background-color: #578507; + color: #fff; +} + +.ovMain { + display: flex; + flex-direction: column; +} + +.tab_menu > ul > .active > a { + display: block; + border: #d0d0d0 solid 1px; + background-color: #578507; + color: #fff; + line-height: 22px; + padding: 16px 0; + text-align: center; + font-weight: 600; + text-decoration: none; +} + +/* 반응형 웹 디자인을 위한 미디어 쿼리 추가 */ +@media screen and (max-width: 1200px) { + .nav_contents { + padding: 1rem; + } + + .nav_contents a { + font-size: 1.4em; + } + + .nav_contents .search-container { + width: 50%; + padding: 12px; + } + + .nav_contents .search-container input { + font-size: 1.2em; + } + + .contents .secondRow .oversizedWaste, + .contents .secondRow .near { + font-size: 4.5vw; + } + + .left, + .left > img { + width: 50vw; + } + + .right { + font-size: 2vw; + } +} + +@media screen and (max-width: 1000px) { + .nav_contents { + padding: 0.8rem; + } + + .nav_contents a { + font-size: 1.3em; + } + + .nav_contents .search-container { + width: 60%; + padding: 10px; + } + + .nav_contents .search-container input { + font-size: 1.1em; + } + + .contents .secondRow .oversizedWaste, + .contents .secondRow .near { + font-size: 4.8vw; + } + + .left, + .left > img { + width: 60vw; + } + + .right { + font-size: 2.2vw; + } + + .tab_menu { + width: 60%; + } +} + +@media screen and (max-width: 768px) { + .nav_contents { + flex-direction: column; + align-items: flex-start; + padding: 0.5rem; + } + + .nav_contents a { + font-size: 1.2em; + } + + .nav_contents ul { + gap: 0.5em; + } + + .nav_contents .search-container { + width: 80%; + padding: 8px; + } + + .nav_contents .search-container input { + font-size: 1em; + } + + main { + flex-direction: column; + padding-top: 6rem; + } + + .contents .secondRow { + flex-direction: column; + height: auto; + } + + .contents .secondRow .oversizedWaste, + .contents .secondRow .near { + font-size: 5vw; + } + + .left, + .left > img { + width: 80vw; + } + + .right { + font-size: 2.4vw; + } + + .tab_menu { + width: 80%; + } +} + +@media screen and (max-width: 500px) { + .nav_contents { + padding: 0.3rem; + } + + .nav_contents a { + font-size: 1.1em; + } + + .nav_contents .search-container { + width: 100%; + padding: 6px; + } + + .nav_contents .search-container input { + font-size: 0.9em; + } + + .contents .secondRow .oversizedWaste, + .contents .secondRow .near { + font-size: 5.5vw; + } + + .left, + .left > img { + width: 100vw; + } + + .right { + font-size: 2.6vw; + } + + .tab_menu { + width: 100%; + } +} diff --git a/backend/sql_app/static/js/main.js b/backend/sql_app/static/js/main.js index 56da6c6..88fedeb 100644 --- a/backend/sql_app/static/js/main.js +++ b/backend/sql_app/static/js/main.js @@ -13,3 +13,41 @@ function swiperInitialize() { https: $.get("navigation.html", function (data) { $("#nav-placeholder").replaceWith(data); }); + +// 요일별 분리수거 업데이트 -- API 생성 후 다시 확인!!! +async function updateSchedule() { + const region = document.getElementById("gugun").value; + if (!region) return; + + try { + const schedule = await fetchSchedule(region); + populateSwiper(schedule); + } catch (error) { + console.error("Error fetching schedule:", error); + } +} + +document.getElementById("gugun").addEventListener("change", updateSchedule); + +//대형 폐기물 탭메뉴 선택 JS +document.addEventListener("DOMContentLoaded", function () { + const tabs = document.querySelectorAll(".tab-item"); + const tabPanes = document.querySelectorAll(".tab-pane"); + + tabs.forEach((tab) => { + tab.addEventListener("click", function (e) { + e.preventDefault(); + const target = tab.getAttribute("data-tab"); + + // Remove active class from all tabs + tabs.forEach((t) => t.classList.remove("active")); + // Remove active class from all tab panes + tabPanes.forEach((pane) => pane.classList.remove("active")); + + // Add active class to clicked tab + tab.classList.add("active"); + // Add active class to corresponding tab pane + document.getElementById(target).classList.add("active"); + }); + }); +}); diff --git a/backend/sql_app/static/navigation.html b/backend/sql_app/static/navigation.html index 8039cd5..39f6c0b 100644 --- a/backend/sql_app/static/navigation.html +++ b/backend/sql_app/static/navigation.html @@ -1,14 +1,31 @@