diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d8763cc..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Sadee - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index a4e25fe..0000000 --- a/README.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Project Title - -A brief description of what this project does and who it's for - -## Tech Stack - -**Client:** HTML, CSS, JavaScript, API - -## Demo - -Insert gif or link to demo - -## Features - -- Feature 1 -- Feature 2 -- Feature 3 - -## Screenshots - -![App Screenshot](https://via.placeholder.com/468x300?text=App+Screenshot+Here) - -## Run Locally - -Clone the project - -```bash - git clone https://link-to-project -``` - -Go to the project directory - -```bash - cd my-project -``` - -Open with VSCode - -```bash - code . -``` - -Open with live server - -```bash - npm run start -``` - - -## Authors - -- [@codewithsadee](https://www.github.com/codewithsadee) - -## License - -[MIT](https://choosealicense.com/licenses/mit/) - -## Support - -For support, Join my [Patreon Comunity](https://www.patreon.com/codewithsadee/membership) or Subscribe My [YouTube Channel](https://youtube.com/@codewithsadee). \ No newline at end of file diff --git a/assets/js/api.js b/assets/js/api.js index 431669c..22edf34 100644 --- a/assets/js/api.js +++ b/assets/js/api.js @@ -1,10 +1,3 @@ -/** - * @license MIT - * @fileoverview All api related stuff like api_key, api request etc. - * @copyright codewithsadee 2023 All rights reserved - * @author codewithsadee - */ - 'use strict' const api_key = '612fe0c2c22681284f5bdf0b1f77bd17' const BAIDU_KEY = '26711937b3cbee60212cdf3af91b0ed8' diff --git a/assets/js/app.js b/assets/js/app.js index ac8020d..13cc116 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,9 +1,3 @@ -/** - * @license MIT - * @copyright codewithsadee 2023 All rights reserved - * @author codewithsadee - */ - "use strict"; import { fetchData, url } from "./api.js"; @@ -50,7 +44,6 @@ searchField.addEventListener("input", (e) => { if (searchField.value.trim()) { searchTimeout = setTimeout(() => { fetchData(url.geo(searchField.value), function (locations) { - console.log("πŸš€ ~ locations:", locations); searchField.classList.remove("searching"); searchResult.classList.add("active"); searchResult.innerHTML = ` @@ -85,24 +78,6 @@ searchField.addEventListener("input", (e) => { searchResult.classList.remove("active"); }); }); - // for (const { lat, lon, name, state, country } of locations) { - // const searchItem = document.createElement("li"); - // searchItem.classList.add("view-item"); - // searchItem.innerHTML = ` - // location_on - //
- //

${name}

- //

${state || ""} ${country}

- //
- // - // ` - // searchResult.querySelector("[data-search-list]").appendChild(searchItem); - // items.push(searchItem.querySelector("[data-search-toggler]")); - // addEvernOnElements(items, "click", function () { - // toggleSearch(); - // searchResult.classList.remove("active"); - // }); - // } }); }, searchTimeoutDuration); } @@ -180,7 +155,9 @@ export const updateWeather = (lat, lon) => { fetchData( url.reverseGeo(lat.split("=")[1], lon.split("=")[1]), function (result) { - const { regeocode: {addressComponent} } = result; + const { + regeocode: { addressComponent }, + } = result; const { province, city } = addressComponent; card.querySelector( "[data-location]" @@ -400,9 +377,7 @@ export const updateWeather = (lat, lon) => {

${parseInt(temp_max)}°

-

${date.getDate()} ${ - module.monthNames[date.getMonth()] - }

+

${module.monthNames[date.getMonth()]} / ${date.getDate()}

${module.weekDayNames[date.getDay()]}

`; forecastSection.querySelector("[data-forecast-list]").appendChild(li); diff --git a/assets/js/module.js b/assets/js/module.js index 5d66db3..b7d2921 100644 --- a/assets/js/module.js +++ b/assets/js/module.js @@ -7,29 +7,66 @@ 'use strict'; +// export const weekDayNames = [ +// "Sunday", +// "Monday", +// "Tuesday", +// "Wednesday", +// "Thursday", +// "Friday", +// "Saturday" +// ]; export const weekDayNames = [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" + "星期倩", + "ζ˜ŸζœŸδΈ€", + "星期二", + "ζ˜ŸζœŸδΈ‰", + "ζ˜ŸζœŸε››", + "ζ˜ŸζœŸδΊ”", + "ζ˜ŸζœŸε…­" ]; +// export const monthNames = [ +// "Jan", +// "Feb", +// "Mar", +// "Apr", +// "May", +// "Jun", +// "Jul", +// "Aug", +// "Sep", +// "Oct", +// "Nov", +// "Dec" +// ]; +// export const monthNames = [ +// "δΈ€ζœˆ", +// "二月", +// "δΈ‰ζœˆ", +// "ε››ζœˆ", +// "δΊ”ζœˆ", +// "ε…­ζœˆ", +// "δΈƒζœˆ", +// "ε…«ζœˆ", +// "九月", +// "十月", +// "εδΈ€ζœˆ", +// "十二月" +// ]; export const monthNames = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12" ]; /** @@ -43,7 +80,7 @@ export const getDate = function (dateUnix, timezone) { const weekDayName = weekDayNames[date.getUTCDay()]; const monthName = monthNames[date.getUTCMonth()]; - return `${weekDayName} ${date.getUTCDate()}, ${monthName}`; + return `${weekDayName} ${monthName} / ${date.getUTCDate()}`; } /** * diff --git a/favicon.svg b/favicon.svg deleted file mode 100644 index 2714899..0000000 --- a/favicon.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/index.html b/index.html index 7f7e843..c125bef 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - Document + Weather Io
-
    - -
+
    @@ -86,411 +77,28 @@ class="section current-weather" aria-label="current weather" data-current-weather - > - - + >
    - -
    + >
    - -
    + >
    - -
    + >
    -

    Copyright © 2021. All Rights Reserved.

    Powered by Feels Like

    -
    -
    +

    404

    -

    - Page not found! -

    +

    Page not found!

    Go Home diff --git a/index.txt b/index.txt deleted file mode 100644 index f53ad2c..0000000 --- a/index.txt +++ /dev/null @@ -1,86 +0,0 @@ -weatherio -weatherio is a weather app made by codewithsadee - - - -#---------- HEADER ----------# - -alt = logo - -placeholder = Search city... - -search - -arrow_back - -London -GB - -Current Location - - - -#---------- CURRENT WEATHER ----------# - -Now - -25Β°c - -Overcast Clouds - -calendar_today -Thursday 16, Feb - -location_on -London, GB - - - -#---------- HIGHLIGHTS ----------# - -Todays Highlights - -Air Quality Index - -air - -23.3 -PM -2.5 - -Good - -Sunrise & Sunset -Sunrise -Sunset -6:30 AM -5:54 PM - - - -#---------- HOURLY FORECAST ----------# - -Today at - -03 PM -25 - - - - -#---------- FORECAST ----------# - -5 Days Forecast - -25 -25 -17 Feb -Friday - - - -#---------- HERO ----------# - - - -#---------- FOOTER ----------# \ No newline at end of file diff --git a/style-guide.md b/style-guide.md deleted file mode 100644 index 1727e71..0000000 --- a/style-guide.md +++ /dev/null @@ -1,89 +0,0 @@ -# Essential Stuff - -## Html import links - -Google font - -``` html - - - -``` - ---- - -## Colors - -``` css ---primary: #B5A1E5; ---on-primary: #100E17; ---background: #131214; ---on-background: #EAE6F2; ---surface: #1D1C1F; ---on-surface: #DDDAE5; ---on-surface-variant: #7B7980; ---on-surface-variant-2: #B9B6BF; ---outline: #3E3D40; ---bg-aqi-1: #89E589; ---on-bg-aqi-1: #1F331F; ---bg-aqi-2: #E5DD89; ---on-bg-aqi-2: #33311F; ---bg-aqi-3: #E5C089; ---on-bg-aqi-3: #332B1F; ---bg-aqi-4: #E58989; ---on-bg-aqi-4: #331F1F; ---bg-aqi-5: #E589B7; ---on-bg-aqi-5: #331F29; ---white: hsl(0, 0%, 100%); ---white-alpha-4: hsla(0, 0%, 100%, 0.04); ---white-alpha-8: hsla(0, 0%, 100%, 0.08); ---black-alpha-10: hsla(0, 0%, 0%, 0.1); -``` - -### Gradient color - -``` css ---gradient-1: linear-gradient(180deg, hsla(270, 5%, 7%, 0) 0%, hsla(270, 5%, 7%, 0.8) 65%, hsl(270, 5%, 7%) 100%); ---gradient-2: linear-gradient(180deg, hsla(260, 5%, 12%, 0) 0%, hsla(260, 5%, 12%, 0.8) 65%, hsl(260, 5%, 12%) 100%); -``` - -## Typography - -``` css ---ff-nunito-sans: 'Nunito Sans', sans-serif; - ---heading: 5.6rem; ---title-1: 2rem; ---title-2: 1.8rem; ---title-3: 1.6rem; ---body-1: 2.2rem; ---body-2: 2rem; ---body-3: 1.6rem; ---label-1: 1.4rem; ---label-2: 1.2rem; - ---weight-regular: 400; ---weight-semiBold: 600; -``` - -## Shadow - -``` css ---shadow-1: 0px 1px 3px hsla(0, 0%, 0%, 0.5); ---shadow-2: 0px 3px 6px hsla(0, 0%, 0%, 0.4); -``` - -## Border Radius - -``` css ---radius-28: 28px; ---radius-16: 16px; ---radius-pill: 500px; ---radius-circle: 50%; -``` - -## Transition - -``` css ---transition-short: 100ms ease; -```