From e641ac9b6f1316854cd2e73484221a9ace31b5a4 Mon Sep 17 00:00:00 2001 From: VBsaini Date: Sun, 20 Oct 2024 17:43:20 +0530 Subject: [PATCH] issue #3 - Add localstorage to keep track of last-visited place and a list to showcase last 3 visited items --- css/style.css | 191 ++++++++++++---------- css/style.min.css | 2 +- index.html | 245 ++++++++++++++------------- js/main.js | 409 ++++++++++++++++++++++++++++------------------ 4 files changed, 484 insertions(+), 363 deletions(-) diff --git a/css/style.css b/css/style.css index 4cbf1fe..18a1fe2 100644 --- a/css/style.css +++ b/css/style.css @@ -1,174 +1,189 @@ html { - overflow-y: none; - overflow-x: none; + overflow-y: none; + overflow-x: none; } body { - font-family: 'Satoshi-Regular', sans-serif; - margin: 0px; - background: #000; + font-family: "Satoshi-Regular", sans-serif; + margin: 0px; + background: #000; } .whtrlive { - width: 100%; - display: flex; - flex-direction: row; - background: url('/img/background/day/clear.jpg'); - background-repeat: no-repeat; - background-size: cover; - min-height: 100vh; - max-height: 100vh; - opacity: 1; - transition: 500ms; + width: 100%; + display: flex; + flex-direction: row; + background: url("/img/background/day/clear.jpg"); + background-repeat: no-repeat; + background-size: cover; + min-height: 100vh; + max-height: 100vh; + opacity: 1; + transition: 500ms; } .sidebar { - width: 25%; - background: rgba(0, 0, 0, 0.1); - border-right: 0.2px solid #adadad; - backdrop-filter: blur(25px); - padding: 50px; - color: #fff; + width: 25%; + background: rgba(0, 0, 0, 0.1); + border-right: 0.2px solid #adadad; + backdrop-filter: blur(25px); + padding: 50px; + color: #fff; } #locationInput { - border-bottom: 1px solid #fff; - display: flex; - justify-content: space-between; - + border-bottom: 1px solid #fff; + display: flex; + justify-content: space-between; } #locationInput .search { - background: none; - border: none; - box-shadow: none; - margin: 0; - color: #fff; - font-family: 'Satoshi-Bold'; - font-size: 16px; - + background: none; + border: none; + box-shadow: none; + margin: 0; + color: #fff; + font-family: "Satoshi-Bold"; + font-size: 16px; } #locationInput .search:focus { - outline: none; + outline: none; } #locationInput .search::placeholder { - color: #ddd; - font-size: 16px; + color: #ddd; + font-size: 16px; } #locationInput button { - background: none; - color: #fff; - border: none; + background: none; + color: #fff; + border: none; } .cities { - list-style-type: none; - line-height: 3.3rem; - padding: 0px; + list-style-type: none; + line-height: 3.3rem; + padding: 0px; } .cities .city:hover { - font-family: 'Satoshi-Medium'; - transition: 0.5s ease; - transform: scale(1.05); - cursor: pointer; + font-family: "Satoshi-Medium"; + transition: 0.5s ease; + transform: scale(1.05); + cursor: pointer; } .sidebar hr { - border-color: rgba(255, 255, 255, 0.35); + border-color: rgba(255, 255, 255, 0.35); } .more-info { - list-style-type: none; - line-height: 3.3rem; - padding: 0px + list-style-type: none; + line-height: 3.3rem; + padding: 0px; } .more-info-item { - display: flex; - justify-content: space-between; + display: flex; + justify-content: space-between; } .more-info-item p { - margin: 0px + margin: 0px; } /*Container Starts */ .container { - width: 75%; - padding: 60px; - display: flex; - flex-direction: column; - justify-content: space-between; - color: #fff; - font-family: 'Satoshi-Bold'; + width: 75%; + padding: 60px; + display: flex; + flex-direction: column; + justify-content: space-between; + color: #fff; + font-family: "Satoshi-Bold"; } .container .top { - display: flex; - justify-content: space-between; - align-items: center; + display: flex; + justify-content: space-between; + align-items: center; } .container .top img { - width: 15%; + width: 15%; } .container .bottom { - display: flex; - justify-content: space-between; - align-items: end; + display: flex; + justify-content: space-between; + align-items: end; } .weather-temperature { - display: flex; - align-items: center; + display: flex; + align-items: center; } .weather-temperature .today-temperature { - font-size: 72px; - margin: 0px; - color: #D7E3FC; + font-size: 72px; + margin: 0px; + color: #d7e3fc; } .tomorrow-temperature { - margin: -10px 0px 0px 0px; + margin: -10px 0px 0px 0px; } .container .bottom .left h1, .container .bottom .left h2, .container .bottom .left h3 { - margin: 0px; + margin: 0px; } .container .bottom .day { - color: #D7E3FC; + color: #d7e3fc; } .sidebar h4 { - margin-bottom: 0px; + margin-bottom: 0px; } .time { - font-size: 60px; - margin: 0px; + font-size: 60px; + margin: 0px; } @media screen and (max-width: 500px) { - .weather-temperature .today-temperature, .time { - font-size: 30px; - } + .weather-temperature .today-temperature, + .time { + font-size: 30px; + } - html { - font-size: 12px; - } + html { + font-size: 12px; + } } @media screen and (max-height: 300px) { - .whtrlive { - min-height: 40em; - } -} \ No newline at end of file + .whtrlive { + min-height: 40em; + } +} +/* Codes for clear history button */ +#clearHistory { + background-color: transparent; + color: white; + font-family: "Satoshi"; + font-size: 20px; + border: 0.5px solid white; + padding: 10px; + margin-bottom: 10px; + cursor: pointer; + transition: all 0.25s; +} +#clearHistory:hover { + color: black; + background-color: white; +} diff --git a/css/style.min.css b/css/style.min.css index 0c53db7..416f627 100644 --- a/css/style.min.css +++ b/css/style.min.css @@ -1 +1 @@ -#locationInput .search,.container{color:#fff;font-family:Satoshi-Bold}html{overflow-y:none;overflow-x:none}body{font-family:Satoshi-Regular,sans-serif;margin:0;background:#000}.whtrlive{width:100%;display:flex;flex-direction:row;background:url('/img/background/day/clear.jpg') 0 0/cover no-repeat;min-height:100vh;max-height:100vh;opacity:1;transition:.5s}.sidebar{width:25%;background:rgba(0,0,0,.1);border-right:.2px solid #adadad;backdrop-filter:blur(25px);padding:50px;color:#fff}#locationInput{border-bottom:1px solid #fff;display:flex;justify-content:space-between}.container .top,.more-info-item{justify-content:space-between;display:flex}#locationInput .search{background:0 0;border:none;box-shadow:none;margin:0;font-size:16px}#locationInput .search:focus{outline:0}#locationInput .search::placeholder{color:#ddd;font-size:16px}#locationInput button{background:0 0;color:#fff;border:none}.cities,.more-info{list-style-type:none;line-height:3.3rem;padding:0}.cities .city:hover{font-family:Satoshi-Medium;transition:.5s;transform:scale(1.05);cursor:pointer}.sidebar hr{border-color:rgba(255,255,255,.35)}.container .bottom .left h1,.container .bottom .left h2,.container .bottom .left h3,.more-info-item p{margin:0}.container{width:75%;padding:60px;display:flex;flex-direction:column;justify-content:space-between}.container .top{align-items:center}.container .top img{width:15%}.container .bottom{display:flex;justify-content:space-between;align-items:end}.weather-temperature{display:flex;align-items:center}.weather-temperature .today-temperature{font-size:72px;margin:0;color:#d7e3fc}.tomorrow-temperature{margin:-10px 0 0}.container .bottom .day{color:#d7e3fc}.sidebar h4{margin-bottom:0}.time{font-size:60px;margin:0}@media screen and (max-width:500px){.time,.weather-temperature .today-temperature{font-size:30px}html{font-size:12px}}@media screen and (max-height:300px){.whtrlive{min-height:40em}} .mobile{display:none;} @media screen and (max-width:1000px){.whtrlive{display:none;} .mobile{display:inherit;} .mobile{display:flex; flex-direction:column; color:#fff; min-height: 100vh; justify-content: center; align-items: center;} .mobile h1,p{ margin:0px;}} \ No newline at end of file +#locationInput .search,.container{font-family:Satoshi-Bold;color:#fff}html{overflow-y:none;overflow-x:none}body{font-family:Satoshi-Regular,sans-serif;margin:0;background:#000}.whtrlive{width:100%;display:flex;flex-direction:row;background:url("/img/background/day/clear.jpg") 0 0/cover no-repeat;min-height:100vh;max-height:100vh;opacity:1;transition:.5s}.sidebar{width:25%;background:rgba(0,0,0,.1);border-right:.2px solid #adadad;backdrop-filter:blur(25px);padding:50px;color:#fff}#locationInput{border-bottom:1px solid #fff;display:flex;justify-content:space-between}.container .top,.more-info-item{justify-content:space-between;display:flex}#locationInput .search{background:0 0;border:none;box-shadow:none;margin:0;font-size:16px}#locationInput .search:focus{outline:0}#locationInput .search::placeholder{color:#ddd;font-size:16px}#locationInput button{background:0 0;color:#fff;border:none}.cities,.more-info{list-style-type:none;line-height:3.3rem;padding:0}.cities .city:hover{font-family:Satoshi-Medium;transition:.5s;transform:scale(1.05);cursor:pointer}.sidebar hr{border-color:rgba(255,255,255,.35)}.container .bottom .left h1,.container .bottom .left h2,.container .bottom .left h3,.more-info-item p{margin:0}.container{width:75%;padding:60px;display:flex;flex-direction:column;justify-content:space-between}.container .top{align-items:center}.container .top img{width:15%}.container .bottom{display:flex;justify-content:space-between;align-items:end}.weather-temperature{display:flex;align-items:center}.weather-temperature .today-temperature{font-size:72px;margin:0;color:#d7e3fc}.tomorrow-temperature{margin:-10px 0 0}.container .bottom .day{color:#d7e3fc}.sidebar h4{margin-bottom:0}.time{font-size:60px;margin:0}@media screen and (max-width:500px){.time,.weather-temperature .today-temperature{font-size:30px}html{font-size:12px}}@media screen and (max-height:300px){.whtrlive{min-height:40em}}#clearHistory{background-color:transparent;color:#fff;font-family:Satoshi;font-size:20px;border:.5px solid #fff;padding:10px;margin-bottom:10px;cursor:pointer;transition:.25s}#clearHistory:hover{color:#000;background-color:#fff} \ No newline at end of file diff --git a/index.html b/index.html index eea2da7..adb03db 100644 --- a/index.html +++ b/index.html @@ -5,145 +5,164 @@ - - + - - - - + + + + whtr.live - Minimalistic Weather Website - + - - - + + + - + - - + + - - - - - - - - - + + + + + + + + - +
-