-
Notifications
You must be signed in to change notification settings - Fork 85
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
Min Weather Report App #70
base: main
Are you sure you want to change the base?
Changes from all commits
443ab48
c80e3b9
fed152b
0bf36da
adefcf5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,9 +4,70 @@ | |||||
<meta charset="UTF-8"> | ||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||||||
<title>Weather Report</title> | ||||||
<title > Min's Weather Report</title> | ||||||
<link href = styles/index.css rel = "stylesheet"> | ||||||
</head> | ||||||
<body> | ||||||
|
||||||
<main > | ||||||
<header> | ||||||
<h1 id = "weather-title"> Min's Weather Report </h1> | ||||||
<span> | ||||||
For the lovely city of | ||||||
<span id= "CityName" class = "headerCityName">Miami</span> | ||||||
|
||||||
</span> | ||||||
</header> | ||||||
</main> | ||||||
<section class = " Big-Container " > | ||||||
|
||||||
<div class="Temp-Container"> | ||||||
|
||||||
<div class =Temp-Content> | ||||||
|
||||||
<h1>Temperature</h1> | ||||||
<span id="tempvalue" class="plum">50</span> | ||||||
<div id = tempButtons> | ||||||
<button id= "increaseButton">+</button> | ||||||
<button id = "decreaseButton">-</button> | ||||||
</div> | ||||||
|
||||||
</div> | ||||||
</div> | ||||||
|
||||||
<div class="Sky-Container"> | ||||||
<h1>Sky</h1> | ||||||
<select class = "skyDropMenu"> | ||||||
<option value = sunny >Sunny</option> | ||||||
<option value = cloudy>Cloudy</option> | ||||||
<option value = rainy>Rainy</option> | ||||||
<option value =snowy>Snowy</option> | ||||||
</select> | ||||||
</div> | ||||||
<div class="City-Container"> | ||||||
<h1>City</h1> | ||||||
<div id = cityNameAndBtn> | ||||||
<input type ="text" id ="cityNameInput" value = "Miami"> | ||||||
<input type = "reset" value = "Reset"></input> | ||||||
</div> | ||||||
</div> | ||||||
|
||||||
</section > | ||||||
|
||||||
<section class="smallContainer"> | ||||||
|
||||||
<div class= "gardenContainer "> | ||||||
<h2 id=gardenText></h2> | ||||||
|
||||||
</div> | ||||||
<br> | ||||||
<div class = "landscape">🥵🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🥵</div> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</section> | ||||||
<script async src="src/index.js"></script> | ||||||
</body> | ||||||
</html> | ||||||
</html> | ||||||
|
||||||
<!-- ‼️❗️🤯😳☀️😎 🌆🌇🎇🥵💃🏾💋‼️❗️🤯 --> | ||||||
<!-- 🥶🧊💎🥶🧊💎🥶🧊💎🥶🧊💎🥶🧊💎🥶🧊💎🥶🧊💎🥶🧊💎🥶🧊💎🥶 | ||||||
✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️ | ||||||
🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂 --> | ||||||
Comment on lines
+70
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would remove these emojis in your HTML file because you are using them in your JS file. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
console.log("loaded") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove your console.log |
||
|
||
const state = { | ||
tempchange: 50 | ||
|
||
} | ||
//selecting the variable increase the value of temperature(tempvalue) so we can use | ||
const clickButtonUp = () => { | ||
state.tempchange += 1; | ||
const increseButtonElement = document.getElementById('tempvalue'); | ||
increseButtonElement.textContent = `${state.tempchange}`; | ||
console.log("clickly click click"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove your console log |
||
|
||
} | ||
const clickButtonDown = () => { | ||
state.tempchange -= 1; | ||
const decreaseButtonElement = document.getElementById('tempvalue'); | ||
decreaseButtonElement.textContent = `${state.tempchange}`; | ||
console.log("downbutton click") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove console log |
||
|
||
|
||
} | ||
|
||
const changeSky = () => { | ||
const inputSky = document.querySelector(".skyDropMenu").value | ||
|
||
// let gardenGifs = "cloudy"; | ||
|
||
// if (inputSky === "cloudy") { | ||
// gardenGifs = "cloudy" | ||
|
||
// } else if (inputSky === "sunny") { | ||
// gardenGifs = "sunny"; | ||
// } else if (inputSky === "rainy") { | ||
// gardenGifs = "rainy"; | ||
// } else if (inputSky === "snowy") { | ||
// gardenGifs = "snowy"; | ||
// } | ||
|
||
Comment on lines
+27
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this unused code |
||
|
||
const gardenContent = document.querySelector(".gardenContainer"); | ||
gardenContent.className = "gardenContainer" | ||
gardenContent.classList.add(inputSky); | ||
} | ||
const changeCityName = () => { | ||
|
||
const cityNameInputEl= document.getElementById("cityNameInput").value; | ||
const headerCityEl = document.getElementById("CityName"); | ||
headerCityEl.textContent = cityNameInputEl; | ||
console.log("citygirls") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove console.log |
||
} | ||
const cityReset = () => { | ||
|
||
const cityNameInput = document.getElementsById("cityNameInput"); | ||
cityNameInput.value = "Miami"; | ||
cityNameInput.value.classList.add(cityNameInput); | ||
console.log("inthecitygirls") | ||
changeCityName(); | ||
|
||
|
||
}; | ||
|
||
const changeTempColor = () => { | ||
|
||
const tempColor = document.getElementById("tempvalue"); | ||
let color = "blue"; | ||
if (state.tempchange >=80){ | ||
color = "rgba(24, 17, 24, 0.836)"; | ||
console.log("hotttttttttt") | ||
}else if (state.tempchange >=70){ | ||
color = "rgb(117, 87, 117)"; | ||
}else if (state.tempchange >=60){ | ||
color = "rgb(175, 124, 175)"; | ||
}else if (state.tempchange >=50){ | ||
color = "black"; | ||
} | ||
tempColor.classList = color; | ||
|
||
Comment on lines
+65
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in css you need to add properties for each of the colors and then the value you want. For example, if color = "black" then in CSS you should have
|
||
|
||
} | ||
|
||
const changeGarden = ()=> { | ||
|
||
const landContainer = document.querySelector("#landscape") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. your landscape is a class name in HTML not an id. So you could do |
||
let landscape = "🥶🧊💎🥶🧊💎🥶🧊💎🥶🧊💎🥶🧊💎🥶🧊💎🥶🧊💎🥶"; | ||
if (state.tempchange>=80){ | ||
landscape = "🥵🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🥵"; | ||
} else if (state.tempchange >=70){ | ||
landscape = "✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️✌🏾✈️☁️"; | ||
}else if (state.tempchange >=60){ | ||
landscape = "🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂🌧☔️🌂"; | ||
} | ||
|
||
landContainer.textContent = landscape | ||
|
||
|
||
} | ||
const changeTemp = tempvalue => { | ||
|
||
const changeTempContainer = document.getElementById('tempvalue'); | ||
changeTempContainer.textContent = tempvalue; | ||
tempGardenvlue(tempvalue); | ||
changeGarden(tempvalue); | ||
|
||
|
||
|
||
} | ||
|
||
|
||
|
||
//register the button, telling the website to listen for a click | ||
const registerEventHandlers = () =>{ | ||
const increseButtonElement = document.getElementById('increaseButton'); | ||
increseButtonElement.addEventListener("click", clickButtonUp) | ||
console.log("registerEventHandlers") | ||
|
||
const decreaseButtonElement = document.getElementById('decreaseButton'); | ||
decreaseButtonElement.addEventListener("click", clickButtonDown) | ||
console.log("registerTheseHands") | ||
|
||
const inputSky = document.querySelector(".skyDropMenu"); | ||
inputSky.addEventListener("change",changeSky) | ||
|
||
changeCityName(); | ||
const cityNameInputEl= document.getElementById("cityNameInput"); | ||
cityNameInputEl.addEventListener("input", changeCityName) | ||
|
||
const resetButton = document.getElementById("cityNameInput") | ||
resetButton.addEventListener("click", changeCityName) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of calling the changeCityName function, you should create a function to reset the city name back to the default city name |
||
|
||
} | ||
|
||
// document.addEventListener("DOMContentLoaded", registerEventHandlers); | ||
|
||
registerEventHandlers() | ||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
|
||
|
||
body{ | ||
|
||
|
||
|
||
font-family: ui-monospace; | ||
background-image: url("/ada-project-docs/assets/kaleidoscope.jpg"); | ||
background-image: url("/ada-project-docs/assets/pinkstoredisplay.jpg"); | ||
color: plum; | ||
|
||
|
||
} | ||
|
||
|
||
.plum{ | ||
|
||
font-size: 5em; | ||
margin-left: 0.2cm; | ||
|
||
|
||
} | ||
.Temperature{ | ||
|
||
margin-left: 0.2cm; | ||
align-content: right; | ||
|
||
} | ||
|
||
.City-Container, | ||
.Sky-Container, | ||
.Temp-Container | ||
|
||
{ | ||
width: 300px; | ||
height: 200px; | ||
border: 7px solid black; | ||
display: flex; | ||
flex-direction: row; | ||
background-color: clear; | ||
justify-content: space-between; | ||
margin-left: auto; | ||
margin-right: auto; | ||
background-color:rgba(102, 255, 0, 0.116); | ||
} | ||
|
||
.Big-Container{ | ||
width: 1300px; | ||
height: 200px; | ||
border: 3rem; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-content: center; | ||
|
||
} | ||
|
||
.smallContainer{ | ||
width: 1000px; | ||
height: 430px; | ||
border: 0; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
align-content: center; | ||
margin-top: auto; | ||
|
||
} | ||
|
||
.gardenContainer | ||
{ | ||
width: 480px; | ||
height: 265px; | ||
align-self:center; | ||
margin-left: 40%; | ||
margin-right: auto; | ||
border: 10px solid black; | ||
background-color: white; | ||
background-image:url(/ada-project-docs/assets/rihaan.gif); | ||
margin-top: 10%; | ||
|
||
} | ||
|
||
.cloudy{ | ||
|
||
background-image: url(/ada-project-docs/assets/upintheclouds.webp) ; | ||
} | ||
.rainy{ | ||
|
||
background-image: url(/ada-project-docs/assets/rihaan.gif); | ||
} | ||
.sunny{ | ||
|
||
background-image: url(/ada-project-docs/assets/BeyFireYellow.gif); | ||
} | ||
.snowy{ | ||
|
||
background-image: url(/ada-project-docs/assets/diamondhands.webp); | ||
background-repeat: round; | ||
|
||
} | ||
.landscape{ | ||
|
||
width: 480px; | ||
height: 30px; | ||
align-self: flex-end; | ||
/* display: block; */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove unused code |
||
align-self:center; | ||
margin-left: 30%; | ||
font-size: larger; | ||
/* background-image: linear-gradient(315deg, #000000 0%, #ffffff 74%); */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove unused code |
||
background-color:rgba(51, 255, 0, 0.24); | ||
border: 8.5px solid black; | ||
|
||
|
||
} | ||
|
||
|
||
|
||
|
||
.skyDropMenu{ | ||
|
||
width: 70px; | ||
height: 35px; | ||
align-self: flex-end; | ||
color: plum; | ||
font-weight: bold; | ||
|
||
|
||
} | ||
#cityNameAndBtn{ | ||
|
||
|
||
align-self: flex-end; | ||
|
||
|
||
|
||
} | ||
#increasebuttons,#decreasebuttons{ | ||
|
||
font-size: 2.0em; | ||
width: 70px; | ||
height: 35px; | ||
align-self: flex-end; | ||
color:plum; | ||
margin-left: 0.2cm; | ||
|
||
} | ||
|
||
|
||
#hotCity{ | ||
|
||
margin-bottom: 50%; | ||
font-size: medium; | ||
} |
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.
instead of using a br you could add margins to your divs to create space