-
Notifications
You must be signed in to change notification settings - Fork 14
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
Accelerate-cadence #3
base: main
Are you sure you want to change the base?
Conversation
</head> | ||
<body> | ||
<h1 class="title">Weather Report</h1> | ||
<p class=cityNameDisplay>For the lovely city of San Francisco`</p> |
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.
missing quotes around the class name
<p class=cityNameDisplay>For the lovely city of San Francisco`</p> | |
<p class="cityNameDisplay">For the lovely city of San Francisco`</p> |
<div class=skyIcon>☁️ ☁️ ☁️ ☀️ ☁️ ☁️</div> | ||
<img class=todayDisplay> | ||
<p class=landScape></p> |
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.
missing quotes around class name
<div class=skyIcon>☁️ ☁️ ☁️ ☀️ ☁️ ☁️</div> | |
<img class=todayDisplay> | |
<p class=landScape></p> | |
<div class="skyIcon">☁️ ☁️ ☁️ ☀️ ☁️ ☁️</div> | |
<img class="todayDisplay"> | |
<p class="landScape"></p> |
<section class="weatherDisplay"> | ||
<p class="todayWeather">Today's Weather</p> | ||
<div class=skyIcon>☁️ ☁️ ☁️ ☀️ ☁️ ☁️</div> | ||
<img class=todayDisplay> |
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.
add an alt attribute for the images
@@ -0,0 +1,47 @@ | |||
<!DOCTYPE html> | |||
<html lang="en"> |
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.
HTML page is clean and readable. Great job!
const downClick = document.getElementsByClassName('downClick')[0]; | ||
let parseTemperature= parseInt(temperature.innerHTML) | ||
|
||
const handleColorChange=()=>{ |
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.
You are doing more than handling the color change here. I would suggest a different name for this function.
if (parseTemperature >= 80){ | ||
temperature.style.color="red" ; | ||
todayDisplay.style.backgroundImage = "url('https://t3.ftcdn.net/jpg/02/68/48/90/240_F_268489083_Q5Vb8WaWyy3D5sYsmsheWq2cojgWDQ3T.jpg')"; | ||
landScape.textContent='🌵__🐍_🦂_🌵🌵__🐍_🏜_🦂' | ||
} | ||
else if(parseTemperature >=70 && parseTemperature <=79){ | ||
temperature.style.color="orange" | ||
todayDisplay.style.backgroundImage = "url('https://www.parkview.com/media/Image/Dashboard_952_COVID_heat_5_20.jpg')"; | ||
landScape.textContent="🌸🌿🌼__🌷🌻🌿_☘️🌱_🌻🌷" | ||
} | ||
else if(parseTemperature >=60 && parseTemperature <=69 ){ | ||
|
||
temperature.style.color="blue" | ||
todayDisplay.style.backgroundImage = "url('https://www.skymetweather.com/themes/skymet/images/gallery/toplists/10-ways-to-predict-weather-yourself/3.jpg')"; | ||
landScape.textContent="🌾🌾_🍃_🪨__🛤_🌾🌾🌾_🍃" | ||
} | ||
else if(parseTemperature >=50 && parseTemperature <=59){ | ||
temperature.style.color="green" | ||
todayDisplay.style.backgroundImage = "url('https://cdn.shopify.com/s/files/1/0847/5984/articles/winter_tips_blog_header_1600x.jpg?v=1608677258')"; | ||
landScape.textContent="🌲🌲⛄️🌲⛄️🍂🌲🍁🌲🌲⛄️🍂🌲" | ||
} | ||
else{ | ||
temperature.style.color="teal" | ||
todayDisplay.style.backgroundImage = "url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTmEOPhqiG5yG_yUSf48lanShE8P_Oi4Ev8sw&usqp=CAU')"; | ||
landScape.textContent="🌲🌲⛄️🌲⛄️🍂🌲🍁🌲🌲⛄️🍂🌲" | ||
} | ||
} |
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.
great way to handle all the things that change based on the temperature in one place!
const handleSky=(event)=>{ | ||
const skyIcon= document.getElementsByClassName("skyIcon")[0] | ||
const targetVal = event.target.value; | ||
|
||
if (targetVal === "Sunny") { | ||
console.log("1") | ||
skyIcon.textContent = "☁️☁️ ☁️ ☁️☁️ ☁️ 🌤 ☁️ ☁️☁️"; | ||
} else if (targetVal === "Cloudy") { | ||
console.log("2") | ||
skyIcon.textContent = "☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️☀️"; | ||
} else if (targetVal === "Rainy") { | ||
console.log("3") | ||
skyIcon.textContent = "🌧🌈⛈🌧🌧💧⛈🌧🌦🌧💧🌧🌧"; | ||
} else if (targetVal === "Snowy") { | ||
console.log("4") | ||
skyIcon.textContent = "🌨❄️🌨🌨❄️❄️🌨❄️🌨❄️❄️🌨🌨"; | ||
} | ||
} |
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.
💃🏽
const handleCityName=(event)=>{ | ||
event.preventDefault(); | ||
const cityName=document.getElementById("cityName").value | ||
console.log(cityName) |
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.
remove console log from debugging
const cityName=document.getElementById("cityName").value | ||
console.log(cityName) | ||
const cityNameDisplay =document.getElementsByClassName("cityNameDisplay")[0] | ||
console.log("dis",cityNameDisplay) |
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.
remove console log
img{ | ||
width:400px; | ||
height:300px; | ||
background-size:initial; | ||
background-repeat: no-repeat; | ||
|
||
} |
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.
I would suggest using a flex layout or grid layout so the user doesn't have to scroll to see the emojis when the the image changes. Here is a great place to start https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Great job Candence! I love the implementation of images for the sky change. I added a few comments about syntax. Make sure you adding quotation marks around class names. You were missing semicolons in a few places. Depending on your settings sometimes you won't get an error for that but make sure you add them. I like the implementation of your functions to get things working. I added some suggestions on naming for clarity. |
No description provided.