-
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
Cedar- Roza #61
base: main
Are you sure you want to change the base?
Cedar- Roza #61
Changes from all commits
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 | ||||
---|---|---|---|---|---|---|
|
@@ -5,8 +5,61 @@ | |||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||||||
<title>Weather Report</title> | ||||||
<link href = "styles/index.css" rel="stylesheet" type="text/css"> | ||||||
</head> | ||||||
<body> | ||||||
|
||||||
<section id ="headers"> | ||||||
<div id ="weather-header"><span class='bigger'>Weather Report</span> | ||||||
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. Generally we try to avoid using something like
Suggested change
|
||||||
<span class="small">For the lovely city of </span> ✨<span class="dynamic">city</span>✨</div> | ||||||
<!-- <div id ="lovely-city"> For the lovely city of</div> | ||||||
<div id ="header-city">here change the city dynamically</div> --> | ||||||
</section> | ||||||
<section id ="whole-body"> | ||||||
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. This probably wants to be a
Suggested change
|
||||||
<section id ="three-boxes"> | ||||||
<div id="temp"> | ||||||
|
||||||
<label for="temps">Temperature</p> | ||||||
<section id="button-tempvalue"> | ||||||
<section id="buttons"> | ||||||
<button id="up-arrow">⬆️</button> | ||||||
<button id ="down-arrow">⬇️</button> | ||||||
</section> | ||||||
<h2 id="temp-value"></h2> | ||||||
</section> | ||||||
</div> | ||||||
<div id="sky"> | ||||||
<label for ="skies">Sky</label><br> | ||||||
<select id="sky-options"> | ||||||
<option value="sunny">Sunny</option> | ||||||
<option value="cloudy">Cloudy</option> | ||||||
<option value="rainy">Rainy</option> | ||||||
<option value="snowy">Snowy</option> | ||||||
</select> | ||||||
</div> | ||||||
|
||||||
<div id="city-name"> | ||||||
<label for="city">City Name</label> | ||||||
<input type="text" id = "city"> | ||||||
<input type="reset" id="reset"> | ||||||
</div> | ||||||
|
||||||
</section> | ||||||
<section id="landscape"> | ||||||
<h3 id="weather-garden-title">Weather Garden</h3> | ||||||
<div id="emojis-container"> | ||||||
<div id="sky-emoji"><p>I will display the sky</p></div> | ||||||
<div id="plant-emoji"><p>I will display seasonal creatures</p></div> | ||||||
</div> | ||||||
|
||||||
</section> | ||||||
|
||||||
|
||||||
|
||||||
</section> | ||||||
<!-- <button name="button" id="selectbutton">Select </button> | ||||||
|
||||||
<input id="number" type="number"> --> | ||||||
<footer id"footer">©ByRoza</footer> | ||||||
<script src="src/index.js"></script> | ||||||
</body> | ||||||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
const tempValue = document.getElementById('temp-value'); | ||
tempValue.className = 'special'; | ||
tempValue.textContent = 71; | ||
const skyEmojis = document.querySelector('#sky-emoji'); | ||
const plantEmoji = document.querySelector('#plant-emoji'); | ||
const landBackground = document.querySelector('#emojis-container'); | ||
plantEmoji.textContent = '🌸🌿🌼__🌷🌻🌿_☘️🌱_🌻🌷'; | ||
skyEmojis.textContent = '☁️ ☁️ ☁️ ☀️ ☁️ ☁️'; | ||
landBackground.className = 'sunny-color'; | ||
document.getElementById('city').value = 'Enter your city'; | ||
let initialTempValue = 71; | ||
|
||
// create event handler | ||
|
||
const changingTemps = (value) => { | ||
if (value >= 80) { | ||
tempValue.className = 'red'; | ||
plantEmoji.textContent = '🌵__🐍_🦂_🌵🌵__🐍_🏜_🦂'; | ||
} else if (value < 80 && value >= 70) { | ||
tempValue.className = 'orange'; | ||
plantEmoji.textContent = '🌸🌿🌼__🌷🌻🌿_☘️🌱_🌻🌷'; | ||
} else if (value < 70 && value >= 60) { | ||
tempValue.className = 'yellow'; | ||
plantEmoji.textContent = '🌾🌾_🍃_🪨__🛤_🌾🌾🌾_🍃'; | ||
} else if (value < 60 && value >= 50) { | ||
tempValue.className = 'green'; | ||
plantEmoji.textContent = '🌲🌲⛄️🌲⛄️🍂🌲🍁🌲🌲⛄️🍂🌲'; | ||
} else { | ||
tempValue.className = 'teal'; | ||
plantEmoji.textContent = '🌲🌲⛄️🌲⛄️🍂🌲🍁🌲🌲⛄️🍂🌲'; | ||
} | ||
}; | ||
|
||
const increaseTemps = () => { | ||
initialTempValue += 1; | ||
tempValue.textContent = initialTempValue; | ||
changingTemps(initialTempValue); | ||
}; | ||
|
||
const decreaseTemps = () => { | ||
initialTempValue -= 1; | ||
tempValue.textContent = initialTempValue; | ||
changingTemps(initialTempValue); | ||
}; | ||
|
||
const changeSkyLandscape = (skyStatus) => { | ||
if (skyStatus === 'sunny') { | ||
skyEmojis.textContent = '☁️ ☁️ ☁️ ☀️ ☁️ ☁️'; | ||
landBackground.className = 'sunny-color'; | ||
} else if (skyStatus === 'cloudy') { | ||
skyEmojis.textContent = '☁️☁️ ☁️ ☁️☁️ ☁️ 🌤 ☁️ ☁️☁️'; | ||
landBackground.className = 'cloudy-color'; | ||
} else if (skyStatus === 'rainy') { | ||
skyEmojis.textContent = '🌧🌈⛈🌧🌧💧⛈🌧🌦🌧💧🌧🌧'; | ||
landBackground.className = 'rainy-color'; | ||
} else if (skyStatus === 'snowy') { | ||
skyEmojis.textContent = '🌨❄️🌨🌨❄️❄️🌨❄️🌨❄️❄️🌨🌨'; | ||
landBackground.className = 'snowy-color'; | ||
} | ||
}; | ||
|
||
const changeToDefault = () => { | ||
document.getElementById('city').value = 'Enter your city'; | ||
}; | ||
const changeCityName = (changeCity) => { | ||
const city = document.querySelector('.dynamic'); | ||
city.textContent = changeCity; | ||
}; | ||
//this is registering the event handler | ||
const registerHandlers = () => { | ||
const upArrow = document.getElementById('up-arrow'); | ||
const downArrow = document.getElementById('down-arrow'); | ||
upArrow.addEventListener('click', increaseTemps); | ||
downArrow.addEventListener('click', decreaseTemps); | ||
|
||
const selectElement = document.querySelector('#sky-options'); | ||
selectElement.addEventListener('change', (event) => { | ||
changeSkyLandscape(event.target.value); | ||
}); | ||
|
||
const cityName = document.getElementById('city'); | ||
cityName.addEventListener('change', (event) => { | ||
changeCityName(event.target.value); | ||
}); | ||
|
||
const resetButton = document.getElementById('reset'); | ||
resetButton.addEventListener('click', changeToDefault); | ||
}; | ||
|
||
document.addEventListener('DOMContentLoaded', registerHandlers); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
body { | ||
background-color: #324DF7; | ||
} | ||
|
||
#selectbutton | ||
{ | ||
cursor:pointer; | ||
} | ||
|
||
#headers { | ||
color: white; | ||
} | ||
.bigger { | ||
font-size:1.5em; | ||
} | ||
.small { | ||
font-size: 75%; | ||
} | ||
|
||
.dynamic { | ||
font-style: italic; | ||
font-size: 1em; | ||
|
||
} | ||
#headers { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
justify-content: space-around; | ||
margin-top : 30px; | ||
|
||
} | ||
#whole-body { | ||
display: flex; | ||
flex-wrap: column; | ||
flex-direction: row; | ||
justify-content: space-evenly; | ||
} | ||
|
||
#landscape{ | ||
width: 30vw; | ||
height: 30vh; | ||
/* border:violet 2px solid; */ | ||
margin-top: 100px;; | ||
padding: 20px; | ||
} | ||
#weather-garden-title{ | ||
|
||
color: white; | ||
} | ||
|
||
#emojis-container{ | ||
border-radius: 10px; | ||
border: 1px solid beige; | ||
/* border:hidden; */ | ||
|
||
} | ||
|
||
p { | ||
color: white; | ||
} | ||
#sky-emoji{ | ||
padding: 20px; | ||
margin-bottom: 40px; | ||
} | ||
#plant-emoji{ | ||
padding:20px; | ||
} | ||
#three-boxes { | ||
display : flex; | ||
flex-direction: column; | ||
align-content:center; | ||
width: 30vw; | ||
justify-content: space-between; | ||
justify-self: center; | ||
justify-items: center; | ||
margin-top: 50px; | ||
margin-left: 10px; | ||
} | ||
|
||
#temp, #sky, #city-name { | ||
height:20vh; | ||
width:30vw; | ||
background-color: white; | ||
margin-bottom: 15px; | ||
margin-left: 5px; | ||
border-radius: 7px; | ||
padding: 15px; | ||
} | ||
|
||
#sky-options { | ||
margin-top: 15px; | ||
margin-left: -3px; | ||
|
||
} | ||
|
||
#city { | ||
margin-top:15px; | ||
} | ||
#buttons { | ||
display: flex; | ||
flex-direction:column; | ||
} | ||
#up-arrow, #down-arrow{ | ||
width:2vw; | ||
background-color: Transparent; | ||
border: none; | ||
cursor:pointer; | ||
} | ||
#button-tempvalue { | ||
display:flex; | ||
} | ||
|
||
#temp-value{ | ||
margin-left: 15px; | ||
margin-top: 10px; | ||
} | ||
|
||
.red { | ||
color: red; | ||
} | ||
.orange, .special { | ||
color:orange; | ||
} | ||
.yellow { | ||
color:#F4D10A; | ||
} | ||
.green { | ||
color: green; | ||
} | ||
.teal { | ||
color: #256D6C; | ||
} | ||
.sunny-color { | ||
background-color: #D6FFFF; | ||
} | ||
.cloudy-color{ | ||
background-color: #C9C9C9; | ||
} | ||
.rainy-color { | ||
background-color: #9FCFE0; | ||
} | ||
.snowy-color { | ||
background-color: #A1B6D6; | ||
} | ||
.footer { | ||
position:fixed; | ||
margin-bottom:0; | ||
margin-right:0; | ||
} | ||
|
||
|
||
|
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 section with an id of headers you should instead use a header tag: