Skip to content
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
Binary file added .DS_Store
Binary file not shown.
61 changes: 23 additions & 38 deletions newsletter-sign-up-with-success-message-main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,35 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- displays site properly based on user's device -->

<link rel="icon" type="image/png" sizes="32x32" href="./assets/images/favicon-32x32.png">

<link rel="icon" type="image/png" sizes="32x32" href="./assets/images/favicon-32x32.png">
<link rel="stylesheet" href="./style.css">
<title>Frontend Mentor | Newsletter sign-up form with success message</title>

<!-- Feel free to remove these styles or customise in your own stylesheet 👍 -->
<style>
.attribution { font-size: 11px; text-align: center; }
.attribution a { color: hsl(228, 45%, 44%); }
</style>
</head>
<body>
<div class="container">

<div class="text-container">
<h1>Stay updated!</h1>
<div>60,000+ product managers receiving monthly updates on:</div>
<ul>
<li>Product discovery and building what matters</li>
<li>Measuring to ensure updates are a success</li>
<li>And much more!</li>
</ul>

<div>Email address</div>
<input type="email" placeholder="email@company.com">

<button>Subscribe to monthly newsletter</button>

</div>

<img class="img-desktop" src="./assets/images/illustration-sign-up-desktop.svg">
<img class="img-mobile" src="./assets/images/illustration-sign-up-mobile.svg">

<!-- Sign-up form start -->

Stay updated!

Join 60,000+ product managers receiving monthly updates on:

Product discovery and building what matters
Measuring to ensure updates are a success
And much more!

Email address
email@company.com

Subscribe to monthly newsletter

<!-- Sign-up form end -->

<!-- Success message start -->

Thanks for subscribing!

A confirmation email has been sent to ash@loremcompany.com.
Please open it and click the button inside to confirm your subscription.

Dismiss message

<!-- Success message end -->

<div class="attribution">
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
Coded by <a href="#">Your Name Here</a>.
</div>

</body>
</html>
126 changes: 126 additions & 0 deletions newsletter-sign-up-with-success-message-main/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
body {
background-color: hsl(235, 18%, 26%);

Choose a reason for hiding this comment

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

use css variables

height: 100vh;
display: flex;
align-items: center;
justify-content: center;
margin: 0;
font-family: "Roberto", sans-serif;
}

@font-face {
font-family: "Roberto";
src: url("./fonts/MyFont-Regular.ttf") format("truetype");

Choose a reason for hiding this comment

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

Consider importing fonts in HTML ( in ) rather than only via CSS for better performance and compatibility

}

.container {
display: flex;
height: 65%;
width: 55%;
background-color: white;
border-radius: 30px;

Choose a reason for hiding this comment

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

Dont use px, use responsive units like rem or em (read about the differences)

padding: 20px;
max-width: 800px;
width: 90%;
}

.container img {
flex: 1;
}

.text-container {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 60px 40px;
gap: 10px;
}

.text-container * {
margin: 0;
}

.text-container ul {
list-style: none;
padding: 0;
}

.text-container li {
position: relative;
line-height: 30px;
padding-left: 25px;
background-image: url("./assets/images/icon-list.svg");
background-repeat: no-repeat;
background-size: 16px;
background-position: 0px 7px;
font-size: 16px;
}


.text-container h1 {
color: hsl(234, 29%, 20%);
text-align: center;
font-weight: 700;
width: 100%;
}

.text-container p {
font-size: 16px;
text-align: left;
}

.text-container input,
.text-container button {
width: 100%;
border-radius: 8px;
}

.text-container input {
border: 2px solid hsl(0, 0%,58%) ;
color: hsl(0, 0%,58%);
height: 40px;
}

.text-container button {
background-color: hsl(234, 29%, 20%);
height: 45px;
color: white;
border: none;
cursor: pointer;
}

.img-mobile {
display: none;
}

@media (max-width: 700px) {

Choose a reason for hiding this comment

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

nice use of @media


body {
height: auto;
padding: 10px 0;
align-items: flex-start;
}

.container {
flex-direction: column;
width: 90%;
height: auto;
}

.img-desktop {
display: none;
}

.img-mobile {
display: block;
width: 100%;
align-self: center;
order: -1;
border-radius: 20px;
}

.text-container {
padding: 30px 20px;
}
}
55 changes: 55 additions & 0 deletions newsletter-sign-up-with-success-message-main/success.css

Choose a reason for hiding this comment

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

love that you seperated the css files! good work

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
body {
background-color: hsl(235, 18%, 26%);
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
margin: 0;
font-family: "Roberto", sans-serif;
}

@font-face {
font-family: "Roberto";
src: url("./fonts/MyFont-Regular.ttf") format("truetype");

Choose a reason for hiding this comment

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

Consider importing fonts in HTML ( in ) rather than only via CSS for better performance and compatibility

}

.container {
display: flex;
width: 300px;

Choose a reason for hiding this comment

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

same note for this file as well: dont use px

height: 300px;
background-color: white;
border-radius: 30px;
padding: 40px;
flex-direction: column;
}

.container img {
height: 40px;
width: 40px;
}

.container button {
background-color: hsl(235, 18%, 26%);
color: white;
height: 40px;
width: 100%;
border: 0px;
border-radius: 7px;
}

@media (max-width: 400px) {

body {
background-color: white;
height: 100%;
justify-content: flex-start;
}

.container {
width: 100%;
height: auto;
padding: 20px;
padding-top: 80px;
}

}
23 changes: 23 additions & 0 deletions newsletter-sign-up-with-success-message-main/success.html

Choose a reason for hiding this comment

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

love the seperated files!! good practice!

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Subscription Success</title>
<link rel="stylesheet" href="./success.css">
</head>
<body>
<div class="container">

<img src="./assets/images/icon-list.svg">

<h1>Thanks for subscribing!</h1>

<p>A confirmation email has been sent to ash@loremcompany.com.
Please open it and click the button inside to confirm your subscription.</p>

<button>Dismiss message</button>
</div>

</body>
</html>