-
Notifications
You must be signed in to change notification settings - Fork 3
Add CSS assignment - responsive profile page #4
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| const button = document.querySelector("#theme-toggle"); | ||
|
|
||
| button.addEventListener("click", function () { | ||
| document.body.classList.toggle("dark-mode"); | ||
| }); | ||
|
|
||
| const form = document.querySelector("#contact-form"); | ||
|
|
||
| const formMessage = document.querySelector("#form-message"); | ||
|
|
||
| form.addEventListener("submit", function (event) { | ||
| event.preventDefault(); | ||
| formMessage.textContent = | ||
| "Thanks for reaching out! I'll get back to you soon."; | ||
| form.reset(); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| *, | ||
| *::before, | ||
| *::after { | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| body { | ||
| font-family: Arial, Helvetica, sans-serif; | ||
| display: grid; | ||
| grid-template-areas: | ||
| "header" | ||
| "main" | ||
| "footer"; | ||
| min-height: 100vh; | ||
| padding: 1rem; | ||
| } | ||
|
|
||
| footer { | ||
| grid-area: footer; | ||
| } | ||
|
|
||
| main { | ||
| grid-area: main; | ||
| width: 90%; | ||
| max-width: 1200px; | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
| .interests-list { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 0.5rem; | ||
| list-style: none; | ||
| padding: 0; | ||
| } | ||
|
|
||
| header { | ||
| grid-area: header; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| width: 90%; | ||
| max-width: 1200px; | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
| .btn { | ||
| margin: 2rem; | ||
| } | ||
|
|
||
| #contact-form { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 1rem; | ||
| width: 20rem; | ||
| } | ||
|
|
||
| img { | ||
| border-radius: 50%; | ||
| width: 10rem; | ||
| height: 10rem; | ||
| max-width: 100%; | ||
| } | ||
|
Comment on lines
+58
to
+63
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. All |
||
|
|
||
| @media (min-width: 600px) { | ||
|
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. Well done one making mobile-first! |
||
| header { | ||
| flex-direction: row; | ||
| gap: 4rem; | ||
| padding: 1rem 2rem; | ||
| justify-content: flex-start; | ||
| } | ||
| } | ||
|
|
||
| @media (min-width: 900px) { | ||
| main { | ||
| display: grid; | ||
| grid-template-columns: 2fr 1fr; | ||
| gap: 2rem; | ||
| padding: center; | ||
|
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. According to padding documentation, center value is not possible. How would you change it? |
||
| } | ||
|
|
||
| .about { | ||
| grid-column: 1; | ||
| } | ||
| .contact { | ||
| grid-column: 2; | ||
| border-left: 1px solid #ccc; | ||
| padding-left: 2rem; | ||
| background-color: #9fa480; | ||
| border-radius: 5%; | ||
| padding: 2rem; | ||
| padding-top: 4rem; | ||
| } | ||
|
Comment on lines
+85
to
+93
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. 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. And contact form only has a background in Desktop view. For mobile and tablet this formatting is not being applied |
||
| } | ||
|
|
||
| :focus-visible { | ||
| outline: 3px solid #6366f1; | ||
| outline-offset: 3px; | ||
| border-radius: 4px; | ||
| } | ||
|
Comment on lines
+96
to
+100
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. Well done in the accescibility approach! |
||
|
|
||
| #contact-form input:focus, | ||
| #contact-form textarea:focus { | ||
| outline: none; | ||
| border-color: #6366f1; | ||
| box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25); | ||
| } | ||
| #contact-form label { | ||
| margin-bottom: -0.5rem; | ||
| } | ||
|
|
||
| .dark-mode { | ||
| background-color: #301708; | ||
| color: #f1f5f9; | ||
| } | ||
| @media (prefers-reduced-motion: reduce) { | ||
| *, | ||
| *::before, | ||
| *::after { | ||
| transition-duration: 0.01ms; | ||
| } | ||
| } | ||
|
Comment on lines
+116
to
+122
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. Good accessibility approach! |
||
|
|
||
| button[type="submit"] { | ||
| border-radius: 2rem; | ||
| padding: 0.75rem 2rem; | ||
| width: 50%; | ||
| display: block; | ||
| margin: 0 auto; | ||
| transition: background-color 0.5s ease; | ||
| } | ||
|
|
||
| button[type="submit"]:hover { | ||
| background-color: #4c3f02; | ||
| } | ||
|
Comment on lines
+133
to
+135
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. |
||


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.
As required, you used flex in the contact form. Well done!