From 7fac9ee7a844be2cca1b78dd641bae6509a2e2c7 Mon Sep 17 00:00:00 2001 From: Hannah Lin Date: Mon, 4 Nov 2024 22:18:26 -0500 Subject: [PATCH] recovering prior commit --- .github/workflows/static.yml | 43 +++++++++++++ LICENSE | 21 +++++++ README.md | 38 ++++++++++++ index.html | 59 ++++++++++++++++++ public/icon.png | Bin 0 -> 22527 bytes script.js | 40 ++++++++++++ styles.css | 117 +++++++++++++++++++++++++++++++++++ temperature.html | 53 ++++++++++++++++ weather | 1 - windspeed.html | 50 +++++++++++++++ 10 files changed, 421 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/static.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 index.html create mode 100644 public/icon.png create mode 100644 script.js create mode 100644 styles.css create mode 100644 temperature.html delete mode 160000 weather create mode 100644 windspeed.html diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000..6ee98fb --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,43 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + # Upload entire repository + path: '.' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a36f142 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Hannah Lin + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1713a8d --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + +# Deployment + +I've deployed my site here: +🚀[https://ht-l1.github.io/weather/](https://ht-l1.github.io/weather/) + +Please ensure you allow the browser to know your location as the weather info is user location specific: + + +# Weather Now + +A weather app that shows the current temperature and condition based on user location using the Open-Meteo API. It is built using JavaScript, HTML, and CSS. +It offers a few key features: +- a client-side JavaScript snippet that allows a user to see the weather condition based on their own geography +- a server-side API that fetches the weather information from Open-Meteo.com +- a web application that displays the captured information for each user + +## How to Run + +1. Clone this repository. +2. Open `index.html` in your web browser. + +## Project Timeline + +Milestone 2: Implementations and Design (Completed by October 28th) +- Redesigned the home page +- Added the light dark theme toggle +- Added fun facts section + +Milestone 1: Framework Setup and API Fetching (Completed by October 4th) +- Set up the basic framework for the weather app +- Implemented functionality to fetch temperature and wind speed data from the API + +## Website Screenshot + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..154715f --- /dev/null +++ b/index.html @@ -0,0 +1,59 @@ + + + + + + + + + Weather App + + + +
+

Weather Now 

+ + + + +

+

+ +
+
+
+
+ +
+
+ View Temperature +
+
+
+
+ +
+
+ View Wind Speed +
+
+ + +
+ + + + + + + + + diff --git a/public/icon.png b/public/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1cfab195798e61fcc6f05701635d9c521ac75b4b GIT binary patch literal 22527 zcmb?@byQSe^zWrhKw3#9l@L)Hh7^$oDQP665u_PXRHQ+qM7l(}heqif8iwv>5P=~E zn0N8}dvCoz-ye^)Sa-Obv(G;Job%avCQMUZk(8L87ytlLr5Dd$0suDn5gQ=H2Or1Y z;}_tA$mNBB8vu|{-TYz!-@e}gfO~+_Gg%$)@B3*)ezX(yn8iuuH`w8mHOQHt6M9Z% zb&pDBc1_>bq2CtO)igKPdDiStH0U}t4>b;0-Nz+_PFr*JMfcF&M%_!n>6CAW+dvG<@68>97u-EgCpxZ%<1@R?{%{3#fr`-Cg&jQU|q`ehKmQI z$(MsE1uB;r+_-C}*@QRmu+`@Te5(b|F_waDTfhA0Zr;71@+}R_e~ozxA#3}7^Wt7+ zhf@yJAs!>mjCW_gK8EGyrQPki!JT6gpz0g?>}Kp(e4<&&SZ6F5>3;vqn+7jJs^bIW z=eo(k&q0DRH*El``wwm&LAbhJx?(zY#iO7G7DCW;0AQ%3wjf5w&X~iFOopnfKZ^>q z`8s^+!eSFEgSEs23&aBMk*@f3%@fT|&p5vPvM9gU@82Ygg%>2Ubd3kj;h8@lA6G> z5$j}H#Y3*1N`QShD4v?Cp3ZPucEMpc0-cUk@{^k(>JygwQ9WZi;7=BSj~4_TZdN?a zl*5t;Ml*s^i-I{hYAI>{-9)=&gk;EKEitGIZ!oi ztUtF-&%ps0JoL7V5zxgfu1tDN_y1`!rd>`iv9+)%1y0ml0l%Zb19#$s6Y~q&J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TTxA$8}6WRc}${P;uI1CmV{RSaMce5kJZ$$lmz% z{Eb1RC{Xgfrpga=%36wf{rYtUwF(@3vRFaaR{dm&`ibIx|aIs^3khKI3Je92Wd;XiY)nZtz8*b8P5{he_I>!3yAEsOh z;D4t`i0bbEn(r?b_HtwKW^)+iet0yp8b1TDLky_?S_C_qq-a-mGvk4l2*9M2SG{`m zN|`Xnh6=Aii%&~1O?^?lg1Z0yUvMw3_?E1bCn*E{Td`UN;#DpeAt8`$D13gY9w=P; z_deU(v_v0_EgWrLjGxdov89^WEGKqmYZpD zo)_EP+L=Acl`hIq`p1%d`R`wHpIKG8i`^wecyf3G}^28)59b_2<;kA`*l`oeqL)#JQjfI z4Ho#hRKGrZ{ya^P%O>8=1N9mN3&ICuOWByHxvtV0EVf>|fO9Il!`ZwT2NP_s2n;-FUR4@2x`%Byz zMS?`Ygw(_sKjp6`g%;4kyXg}#jS#u}cYrFZ z_75z&W9ChxQd5lJ>7QN6i2_XHT!sksklqIlUIx)g*hyvS%>s}T#&7*+C6!cfH=qfqq0{iqte=vwq#XF`!XGK3(IWz-FF2A;Ru}HCIeCDBb1puPZ$6DpHNqHV7N5J})_derN}kk-2-U1 zd&SLZ>1=O01@-GGC-3k?ddNh&o6H0KXNHMtuEpD>5>KzpBGoBxJfkj4&?W}-vijcq zaI+Caee-;>y>baRs&WvdFwx&u!l}i3ZB9WOuK)f1iy45+(}eSWUZ literal 0 HcmV?d00001 diff --git a/script.js b/script.js new file mode 100644 index 0000000..5341e82 --- /dev/null +++ b/script.js @@ -0,0 +1,40 @@ +function fetchWeatherData(dataType, elementId) { + // Get the user's location + navigator.geolocation.getCurrentPosition(position => { + const latitude = position.coords.latitude; + const longitude = position.coords.longitude; + + // Make the API request + fetch(`https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&hourly=${dataType}`) + .then(response => response.json()) + .then(data => { + const value = data.hourly[dataType][0]; + const unit = dataType === 'temperature_2m' ? '°C' : 'm/s'; + + // Display the data + document.getElementById(elementId).innerHTML = `${dataType === 'temperature_2m' ? 'Temperature' : 'Wind Speed'}: ${value} ${unit}`; + }) + .catch(error => { + console.error("Error fetching weather data: ", error); + }); + }); +} + + +// theme toggle +document.getElementById('theme-toggler').addEventListener('click', function () { + const body = document.body; + const themeIcon = document.getElementById('theme-icon'); + + if (body.classList.contains('light-theme')) { + body.classList.remove('light-theme'); + body.classList.add('dark-theme'); + themeIcon.classList.remove('fa-regular', 'fa-sun'); + themeIcon.classList.add('fa-regular', 'fa-moon'); + } else { + body.classList.remove('dark-theme'); + body.classList.add('light-theme'); + themeIcon.classList.remove('fa-regular', 'fa-moon'); + themeIcon.classList.add('fa-regular', 'fa-sun'); + } +}); diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..bb65628 --- /dev/null +++ b/styles.css @@ -0,0 +1,117 @@ +body { + font-family: Arial, sans-serif; + /* background-color: #f0f0f0; */ + background-color: #222222; + padding: 20px; + color: #DEE4E7; + /* toggle theme */ + transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out; +} + +/* toggle theme */ +.light-theme { + background-color: white; + color: black; +} + +.dark-theme { + background-color: black; + color: white; +} + +#fun-fact { + color: grey; +} + +hr { + border: none; + background-color: #333; + height: 2px; + width: 50%; + margin: 20px auto; +} + + +#temperature-data, +#windspeed-data { + color: lightcoral; + font-weight: bold; +} + +#message { + font-style: oblique; +} + +#weather-container { + /* background-color: #fff; */ + background-color: #37474F; + border-radius: 10px; + padding: 20px; + max-width: 400px; + margin: auto; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +h1 { + margin-bottom: 20px; +} + +a { + display: block; + margin: 10px 0; + text-align: center; + text-decoration: none; + color: #0066cc; +} + +a:hover { + text-decoration: underline; +} + +.parent { + display: flex; + flex-direction: row; + align-items: stretch; +} + +.children-1 { + width: 50%; + text-align: center; +} + + +.main-page-icon { + font-size: 400%; +} + +.children-2 { + width: 50%; + text-align: center; + /* overflow-y: hidden; */ +} + +/* For the hyperlinks */ + +a:link { + color: green; + background-color: transparent; + text-decoration: none; +} + +a:visited { + color: pink; + background-color: transparent; + text-decoration: none; +} + +a:hover { + color: red; + background-color: transparent; + text-decoration: underline; +} + +a:active { + color: yellow; + background-color: transparent; + text-decoration: underline; +} \ No newline at end of file diff --git a/temperature.html b/temperature.html new file mode 100644 index 0000000..d187377 --- /dev/null +++ b/temperature.html @@ -0,0 +1,53 @@ + + + + + + + + + Temperature + + + + +

+

 Temperature

+ In your location:

+
+

 Hope it's nice out there for ya!

+ + + +
+
+ Would you like learning some fun + facts of Temperature? +
    +
  • 57.8 °C (136 °F) is the hottest temperature ever recorded on Earth. It was recorded on September 13, 1922 in + Al ‘Aziziyah located in Libya.
  • +
  • −89.2 °C (−128.6 °F) is the coldest temperature ever recorded on Earth. It was recorded at Vostok Station + located in Antarctica on July 21, 1983.
  • +
+
+ +  Back to Home +  View Wind Speed +
+ + + + + + + + + + + \ No newline at end of file diff --git a/weather b/weather deleted file mode 160000 index ae27f29..0000000 --- a/weather +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ae27f29a702e662480be3ed636bc865b05199288 diff --git a/windspeed.html b/windspeed.html new file mode 100644 index 0000000..d21a54e --- /dev/null +++ b/windspeed.html @@ -0,0 +1,50 @@ + + + + + + + + + Wind Speed + + + + +
+

 Wind Speed

+ In your Location:

+
+

 Hope it's the perfect wind!

+ + + +
+
+ Would you like learning some fun + facts of Wind Speed? +
    +
  • The strongest winds in the solar system are on Saturn where they reach speeds of over 1,100mph.
  • +
  • Wind power now provides four per cent of the world’s energy.
  • +
  • The first house in the world to have its electricity supplied by wind power was in Kincardineshire, Scotland + in 1887.
  • +
+
+ + + + +  Back to Home +  View Temperature +
+ + + + + \ No newline at end of file