Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

London class 8/harsheek thanki #267

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Binary file added .DS_Store
Binary file not shown.
Binary file added images/apple-pie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/birthday-cake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/burger-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/candle-cake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cupcake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/donut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/piece-of-cake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 58 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,65 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Responsive Cake webpage</title>
<!-- Add a link to your css file here -->
</head>

<body>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Rochester&display=swap"
rel="stylesheet"
/>

<link rel="stylesheet" href="style.css" />
</head>

<body>
<!-- Add your markup here -->
</body>
<header>
<img src="images/piece-of-cake.png" />
<p>The best cakes in town delivered to your door</p>
<div class="burger">
<img src="images/burger-menu.png" />
</div>
Comment on lines +23 to +27

Choose a reason for hiding this comment

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

Remember to provide alt to improve accessibility

</header>
<nav>
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">CAKES</a></li>
<li><a href="#">ORDERING</a></li>
<li><a href="#">LESSONS</a></li>
<li><a href="#">ABOUT</a></li>
</ul>
</nav>

</html>
<main>
<section class="welcome">
<div class="welcome-text">
<h1>Welcome</h1>
<p>
Welcome to Harsheek's Cakes, your favourite online cake shop!
Established in 1969, we bake and serve a tantalising selection of
traditional and affordable cakes and pies that brighten everyone’s
mood! Grab some cakes your family and friends for every occasion.
</p>
</div>
<div class="welcome-image">
<img src="images/birthday-cake.png" />
</div>
</section>
<section class="products">
<div class="product-img"><img src="images/apple-pie.png" /></div>
<div class="product-img"><img src="images/candle-cake.png" /></div>
<div class="product-img"><img src="images/cupcake.png" /></div>
<div class="product-img"><img src="images/donut.png" /></div>
</section>
</main>
<footer>
<img src="images/burger-menu.png" />
</footer>
</body>
</html>
221 changes: 221 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -1 +1,222 @@
/* Add your styling here */

body {
font-family: "Rochester", cursive;
-webkit-font-smoothing: antialiased;
color: black;
background-color: #fff1e6;
margin: 0;
text-align: center;
/* padding: 10px; */
}

main {
padding: 1em 3em;
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(2, 1fr);

grid-template-areas:
"header header"
"welcome welcome"
"products products"
"footer footer";
}

header,
footer,
.products img {
background-color: #eddcd2;
}

header {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-areas:
"image burger"
"image best-cakes";
}

header img {
grid-area: image;
width: 60%;
padding: 20px;
}

header p {
grid-area: best-cakes;
text-align: right;
padding-right: 1em;
}

nav {
display: grid;
justify-items: end;
padding-right: 1em;
}

nav img {
grid-area: burger;
width: 15%;
padding-top: 40px;
}

nav ul {
display: none;
}

h1 {
font-size: 4em;
font-weight: bold;
margin-top: 0;
text-align: left;
}

p {
font-size: 30px;
text-align: left;
}

.welcome {
grid-area: welcome;
padding-bottom: 30px;
}

.welcome img {
padding: 40px 80px;
width: 50%;
border: 3px solid black;
border-radius: 20px;
background-color: #ddbea9;
}

.products {
grid-area: products;
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 2rem;
}

.products img {
border: 3px solid black;
border-radius: 20px;
width: 100%;
padding: 10px;
}
Comment on lines +100 to +105

Choose a reason for hiding this comment

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

consider using relative units instead of hardcoding in px?


footer {
grid-area: footer;
justify-items: start;

border: 2px solid black;
}

footer img {
width: 200px;
}

@media screen and (min-width: 540px) {
main {
grid-template-columns: repeat (4, 1fr);

grid-area: "header header header header" "nav nav nav nav"
"image image welcome welcome" "products products products products"
"footer footer footer footer";
Comment on lines +122 to +124

Choose a reason for hiding this comment

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

improve readability by keeping rows at separate lines

}

header {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-areas: "image best-cakes";
}

header img {
grid-area: image;
width: 60%;
padding: 20px;
}

header p {
grid-area: best-cakes;
align-self: end;
}

.welcome-text {
display: welcome;
}

.welcome-image {
display: image;
}

.burger {
display: none;
}

header img {
width: 100px;
}

nav ul {
display: nav;
display: flex;
list-style: none;
font-size: 30px;
background-color: #eddcd2;
}

nav ul li {
/* padding: 0px 5px; */
margin: 0px 10px;
background-color: #ddbea9;
}

a {
text-decoration: none;
color: black;
}

a:visited {
text-decoration: none;
color: black;
}

a:hover {
text-decoration: none;
color: white;
}

.welcome {
display: flex;
flex-direction: row-reverse;
}

.welcome-text {
margin-left: 100px;
}

.welcome-image {
display: grid;
align-items: center;
margin: 10px;
}

.products {
display: flex;
}

.products img {
width: 70%;
}

footer img {
display: none;
}
}

@media screen and (min-width: 900px) {
nav ul li {
margin: 0px 40px;
background-color: #ddbea9;
}
}
Comment on lines +217 to +222
Copy link

@jackhclee jackhclee Dec 3, 2021

Choose a reason for hiding this comment

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

A well structured original work, well done! I see well coding practices and use of responsive media queries with confidence. Keep good work going!