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

Rock -Brittany #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="./styles/index.css" rel="stylesheet" />
<script src="./scripts/index.js"></script>
<title>Weather Report</title>
</head>
<body>
<!--Wave 2-->
<div class="header">
<h1>Weather Report</h1>
<h2>For the loveley city of</h2>
<p class="city-name">🌊 🌙 Oceanville🌙🌊</p>
</div>
Comment on lines +13 to +17

Choose a reason for hiding this comment

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

don't forget to use semantic html, like header, section, main rather than div


<div class="horizontal-container">
<div class="container">
<div class="card">
<!--Clickable element that displays the temp-->
<h3>Temperature</h3>
<!--Clickable element to increase temp-->
<div class="horizontal-container">
<div class="button-container">
<button id="upButton" class="temp-button">🔼</button>
<button id="downButton" class="temp-button">🔽</button>
</div>
<div id="value" class="temp-value">32</div>

Choose a reason for hiding this comment

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

let's use something other than a div here. a div is for dividing similar html elements together. this should more likely be a heading like h3 or a p elements. these are for text.

</div>
</div>

<div class="card">
<h3>Sky</h3>
</div>
Comment on lines +34 to +36

Choose a reason for hiding this comment

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

not everything needs a parent element. an h3 can stand on its own!

<div class="card">
<h3>City Name</h3>
<!--City Name Form-->
<form class="form" action="/action_page.php">

Choose a reason for hiding this comment

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

in this instance we don't need an action attribute. This is necessary for more traditional websites to trigegr a request to a backend

Suggested change
<form class="form" action="/action_page.php">
<form class="form">

<input type="text" id="city-name" /><br /><br />
<input type="reset" value="Reset" />
</form>
</div>
</div>

<div class="weather-garden">
<h3>Weather Garden</h3>
<div class="grey-card"></div>
</div>
</div>

<!--Clickable element to decrease temp-->

<!--Element that displays a landscape (Animal Crossing seasons)-->
</body>
</html>
12 changes: 12 additions & 0 deletions scripts/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function registerEventHandlers() {
const upButton = document.querySelector("#upButton");
const currentTemp = document.querySelector("#value");

upButton.addEventListener("click", function () {
console.log("current value is: " + currentTemp.textContent);

currentTemp.textContent = parseInt(currentTemp.textContent) + 1;
});
}

document.addEventListener("DOMContentLoaded", registerEventHandlers);
96 changes: 96 additions & 0 deletions styles/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
body {
background-color: blue;
color: white;
}

h1 {
font-size: xx-large;
}

h2 {
font-size: x-small;
margin-left: 35px;
margin-bottom: 45px;
letter-spacing: 3px;
}

h3 {
font-size: x-small;
text-indent: 15px;
}
.city-name {
font-size: x-large;
text-indent: 15px;
margin-bottom: 40px;
font-style: italic;
}

.header {
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: flex-start;
}

.container {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
}

.horizontal-container {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}

.card {
width: 300px;
height: 150px;
background: white;
color: black;
margin-bottom: 10px;
border-radius: 10px;
}

.button-container {
display: flex;
flex-direction: column;
align-items: flex-start;
margin-left: 20px;
}

.temp-button {
padding: 0;
margin: 0;
cursor: pointer;
outline: none;
border: none;
background: transparent;
}

.temp-value{
margin-left: 20px;
flex: 1;
}

.weather-garden {
margin-right: 75px;
margin-bottom: 100px;
text-align: center;
}
.grey-card {
width: 375px;
height: 175px;
background: rgb(174, 198, 252);

color: black;
margin-bottom: 10px;
border-radius: 10px;
}
.form {
margin-left: 10px;
margin-top: 10px;
}