forked from AdaGold/weather-report
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paper - Nandita G. #56
Open
pancakes4lyfe
wants to merge
9
commits into
Ada-C15:main
Choose a base branch
from
pancakes4lyfe:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
16df7db
creates html skeleton with all required elements
pancakes4lyfe 28af286
adds functionality to temp up and temp down buttons
pancakes4lyfe d607d6f
adds color changing functionality to temperature
pancakes4lyfe 929c8f3
adds functionality to landscape changing as temperature changes
pancakes4lyfe 9cdab78
adds functionality to sky selector changing the displayed sky, also r…
pancakes4lyfe 64c00ac
adds functionality to city input so that city name changes when user …
pancakes4lyfe a55ddb1
adds functionality to city reset button so that input and display are…
pancakes4lyfe 8ba300d
adds enhancements like images and css formatting
pancakes4lyfe 4511dba
changes city wording and font styles
pancakes4lyfe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Weather Time!</title> | ||
<meta name="description" content=""> | ||
<link rel="stylesheet" href="styles/index.css"> | ||
</head> | ||
<body class="sunny"> | ||
<header> | ||
<h1>Weather Time!</h1> | ||
<h3 id="cityDisplay">City: Seattle</h3> | ||
</header> | ||
<main> | ||
<section id="sky"> | ||
<h3>Sky</h3> | ||
<select id="skyChoices"> | ||
<option value="sunny" selected>Sunny</option> | ||
<option value="partlyCloudy">Partly Cloudy</option> | ||
<option value="cloudy">Cloudy</option> | ||
<option value="rainy">Rainy</option> | ||
<option value="thunder">Thunder Showers</option> | ||
<option value="snowy">Snowy</option> | ||
</select> | ||
</section> | ||
|
||
<section id="temp"> | ||
<h3>Temperature</h3> | ||
<p id=tempDisplay>65</p> | ||
<button id="tempUp">▲</button> | ||
<button id="tempDown">▼</button> | ||
</section> | ||
|
||
<section id="city"> | ||
<h3>City Name</h3> | ||
<input id="cityChoice" type="text" value="Seattle"/> | ||
<button id="reset">Reset</button> | ||
</section> | ||
|
||
<section id="landscape" class="mild"> | ||
<h3>Landscape Display</h3> | ||
<!-- <p id="skyDisplay">☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️</p> --> | ||
<!-- <p id="groundDisplay">🌳_🌿__🌳_🌿__🌿__🌳_🌿__🌳__🌳</p> --> | ||
</section> | ||
|
||
</main> | ||
<script src="scripts/index.js" type="text/javascript"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
const state = { | ||
temp: 65, | ||
tempRange: "mild", | ||
sky: "sunny", | ||
city: "Seattle" | ||
}; | ||
|
||
// TEMPERATURE FUNCTIONALITY// | ||
const tempUp = (event) => { | ||
state.temp += 1; | ||
const count = document.querySelector("#tempDisplay"); | ||
count.textContent = `${state.temp}`; | ||
checkTemp(); | ||
}; | ||
|
||
const tempDown = (event) => { | ||
state.temp -= 1; | ||
const count = document.querySelector("#tempDisplay"); | ||
count.textContent = `${state.temp}`; | ||
checkTemp(); | ||
}; | ||
|
||
const checkTemp = (event) => { | ||
if (state.temp === 105) { | ||
state.tempRange = "extreme" | ||
textColor("#tempDisplay", "black"); | ||
} else if (state.temp === 90 || state.temp === 104) { | ||
state.tempRange = "hot" | ||
textColor("#tempDisplay", "red"); | ||
} else if (state.temp === 75 || state.temp === 89) { | ||
state.tempRange = "warm" | ||
textColor("#tempDisplay", "rgb(255, 162, 0)"); | ||
} else if (state.temp === 60 || state.temp === 74) { | ||
state.tempRange = "mild" | ||
textColor("#tempDisplay", "rgb(255, 247, 0)"); | ||
} else if (state.temp === 45 || state.temp === 59) { | ||
state.tempRange = "cool" | ||
textColor("#tempDisplay", "rgb(73, 150, 26)"); | ||
} else if (state.temp === 30 || state.temp === 44) { | ||
state.tempRange = "cold" | ||
textColor("#tempDisplay", "rgb(0, 94, 255)"); | ||
} else if (state.temp === 29) { | ||
state.tempRange = "freezing" | ||
textColor("#tempDisplay", "rgb(0, 251, 255)"); | ||
} | ||
const landscape = document.querySelector("#landscape"); | ||
landscape.className = state.tempRange; | ||
} | ||
|
||
const textColor = function(selector, color) { | ||
document.querySelector(selector).style.color = color; | ||
} | ||
|
||
// const backgroundColor = function(selector, color) { | ||
// document.querySelector(selector).style.backgroundColor = color; | ||
// } | ||
|
||
const selectSky = (event) => { | ||
state.sky = event.target.value; | ||
const body = document.querySelector("body"); | ||
body.className = state.sky | ||
}; | ||
|
||
|
||
// CITY FUNCTIONALITY // | ||
const selectCity = (event) => { | ||
state.city = event.target.value; | ||
const city = document.querySelector("#cityDisplay"); | ||
city.textContent = `City: ${state.city}`; | ||
}; | ||
|
||
const resetCity = (event) => { | ||
document.querySelector("#cityChoice").value = "Seattle"; | ||
const city = document.querySelector("#cityDisplay"); | ||
city.textContent = "For the city of: Seattle"; | ||
}; | ||
|
||
// REGISTER EVENT HANDLERS // | ||
const registerEventHandlers = (event) => { | ||
const tempUpButton = document.querySelector("#tempUp"); | ||
tempUpButton.addEventListener("click", tempUp); | ||
|
||
const tempDownButton = document.querySelector("#tempDown"); | ||
tempDownButton.addEventListener("click", tempDown); | ||
|
||
const skyDisplay = document.querySelector("#skyChoices"); | ||
skyDisplay.addEventListener("change", selectSky) | ||
|
||
const cityInput = document.querySelector("#cityChoice"); | ||
cityInput.addEventListener("change", selectCity) | ||
|
||
const resetCityButton = document.querySelector("#reset"); | ||
resetCityButton.addEventListener("click", resetCity); | ||
}; | ||
|
||
document.addEventListener("DOMContentLoaded", registerEventHandlers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@700&display=swap'); | ||
@import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap'); | ||
|
||
body { | ||
background-image: url(../assets/sunny.jpg); | ||
background-size: 100%; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
font-family: 'Noto Sans', sans-serif; | ||
} | ||
|
||
body.sunny { | ||
background-image: url(../assets/sunny.jpg); | ||
} | ||
|
||
body.partlyCloudy { | ||
background-image: url(../assets/partlyCloudy.jpg); | ||
} | ||
|
||
body.cloudy { | ||
background-image: url(../assets/cloudy.jpg); | ||
} | ||
|
||
body.rainy { | ||
background-image: url(../assets/rainy.jpg); | ||
} | ||
|
||
body.thunder { | ||
background-image: url(../assets/thunder.jpg); | ||
} | ||
body.snowy { | ||
background-image: url(../assets/snow.jpg); | ||
} | ||
|
||
header { | ||
text-align: center; | ||
padding: 1px; | ||
background-color:rgb(255, 255, 255, 0.5); | ||
font-family: 'Do Hyeon', sans-serif; | ||
font-size: 1.5em; | ||
} | ||
|
||
main { | ||
margin-top: 10px; | ||
text-align: center; | ||
display: grid; | ||
grid-template-columns: 1fr 1fr 1fr; | ||
grid-template-rows: 1fr 1fr 1fr 1fr 1fr 1fr; | ||
} | ||
|
||
#temp { | ||
border-radius: 25px; | ||
background-color:rgb(255, 255, 255, 0.5); | ||
margin: 5px; | ||
grid-column: 1 / 2; | ||
grid-row: 1 / 3; | ||
} | ||
|
||
#tempDisplay { | ||
color: rgb(255, 247, 0); | ||
font-size: 2em; | ||
} | ||
|
||
#sky { | ||
border-radius: 25px; | ||
background-color:rgb(255, 255, 255, 0.5); | ||
margin: 5px; | ||
grid-column: 1 / 2; | ||
grid-row: 3 / 5; | ||
} | ||
|
||
#city { | ||
border-radius: 25px; | ||
background-color:rgb(255, 255, 255, 0.5); | ||
margin: 5px; | ||
grid-column: 1 / 2; | ||
grid-row: 5 / 7; | ||
} | ||
|
||
#landscape { | ||
background-color:rgb(255, 255, 255, 0.5); | ||
background-size: 100%; | ||
background-position: center; | ||
background-size: cover; | ||
border-radius: 25px; | ||
margin: 5px; | ||
grid-column: 2 / 4; | ||
grid-row: 2 / 6; | ||
} | ||
|
||
#landscape h3 { | ||
background-color:rgb(255, 255, 255, 0.5); | ||
border-radius: 25px; | ||
} | ||
|
||
#landscape.extreme { | ||
background-image: url(../assets/extreme.jpg); | ||
} | ||
|
||
#landscape.hot { | ||
background-image: url(../assets/hot.jpg); | ||
} | ||
|
||
#landscape.warm { | ||
background-image: url(../assets/warm.jpg); | ||
} | ||
|
||
#landscape.mild { | ||
background-image: url(../assets/mild.jpg); | ||
} | ||
|
||
#landscape.cool { | ||
background-image: url(../assets/cool.jpg); | ||
} | ||
|
||
#landscape.cold{ | ||
background-image: url(../assets/cold.jpg); | ||
} | ||
|
||
#landscape.freezing { | ||
background-image: url(../assets/freezing.jpg); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of things:
event
parameter so you can leave it off.You can then use an anonymous function in the event registration like this: