Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Accelerate-cadence #3

wants to merge 2 commits into from

Conversation

cadence09
Copy link

No description provided.

</head>
<body>
<h1 class="title">Weather Report</h1>
<p class=cityNameDisplay>For the lovely city of San Francisco`</p>
Copy link

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

Suggested change
<p class=cityNameDisplay>For the lovely city of San Francisco`</p>
<p class="cityNameDisplay">For the lovely city of San Francisco`</p>

Comment on lines +41 to +43
<div class=skyIcon>☁️ ☁️ ☁️ ☀️ ☁️ ☁️</div>
<img class=todayDisplay>
<p class=landScape></p>
Copy link

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

Suggested change
<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>
Copy link

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">
Copy link

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=()=>{
Copy link

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.

Comment on lines +9 to +35
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="🌲🌲⛄️🌲⛄️🍂🌲🍁🌲🌲⛄️🍂🌲"
}
}
Copy link

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!

Comment on lines +51 to +68
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 = "🌨❄️🌨🌨❄️❄️🌨❄️🌨❄️❄️🌨🌨";
}
}
Copy link

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)
Copy link

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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console log

Comment on lines +1 to +7
img{
width:400px;
height:300px;
background-size:initial;
background-repeat: no-repeat;

}
Copy link

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/

@tgoslee
Copy link

tgoslee commented Jul 11, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants