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

Html & CSS Practice. Popup #43

Merged
merged 4 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix mistake according to previous PR
  • Loading branch information
pro authored and pro committed Aug 4, 2022
commit 0cd4607e9d3ad49b18c1168bbf406f737c34349e
44 changes: 32 additions & 12 deletions submissions/HelenGreent/task_html_css_popup/index.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@500;700&display=swap");

:root {
--main-color: lightgrey;
--bg-color: #fff;
--text-color: #333;
--main-color: #d3d3d3;
--bg-color: #ffffff;
--text-color: #333333;
--box-shadow: rgba(35, 35, 35, 0.2) 0px 2px 8px 0px;
--border-focus: 1px solid rgb(8, 74, 179);
--border-hover: 1px solid rgb(138, 146, 148);
}

*,
*::before,
*::after {
* {
margin: 0;
padding: 0;
border: 0;
Expand All @@ -30,9 +28,9 @@ body {
position: relative;
}

.header__wrapper {
/* .header__wrapper {
max-width: 1800px;
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not looks good on big screens
image

}
} */

.main__nav {
display: flex;
Expand All @@ -48,6 +46,7 @@ body {
color: var(--text-color);
text-decoration: none;
outline: none;
border: 1px solid transparent;
}

.main__nav-item > img {
Expand Down Expand Up @@ -103,6 +102,7 @@ body {
appearance: none;
outline: none;
cursor: pointer;
border: 2px solid transparent;
}

.popup__control:focus {
Expand All @@ -120,19 +120,32 @@ body {
.popup__content {
display: none;
position: absolute;
top: 3rem;
right: 1rem;
top: 3.5rem;
right: -5.5rem;
min-width: 300px;
max-height: 500px;
padding: 0.6rem;
overflow-y: auto;
overflow-x: hidden;
background-color: var(--bg-color);
box-shadow: var(--box-shadow);
}

.popup__content::before {
content: "";
position: fixed;
top: 2.25rem;
right: 10rem;
transform: translateX(-50%);
border: 15px solid;
border-color: transparent transparent var(--bg-color) transparent;
z-index: 1;
}

.popup__list {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
display: flex;
justify-content: space-around;
flex-wrap: wrap;
list-style: none;
}

Expand All @@ -145,6 +158,11 @@ body {
text-decoration: none;
outline: none;
color: inherit;
border: 1px solid transparent;
}

.popup__link-title {
Copy link
Contributor

Choose a reason for hiding this comment

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

Too complicated approach for just a text inside span. Try to optimize your code and play with properties, it can be fun :) I am sure that you don't need flex here, just in the container popup__list-item.

text-align: center;
}

.popup__link:focus {
Expand All @@ -160,7 +178,9 @@ body {
}

.popup__link-icon {
max-width: 3rem;
height: 2rem;
object-fit: contain;
}

.add-popup {
Expand Down
16 changes: 10 additions & 6 deletions submissions/HelenGreent/task_html_css_popup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
<ul class="nav__list">
<li class="nav__list-item">
<div class="popup">
<input class="popup__control" id="popup-1" type="checkbox" />
<label class="popup__toggler" for="popup-1">
<input
class="popup__control"
id="popup-inner"
type="checkbox"
/>
<label class="popup__toggler" for="popup-inner">
<img
src="./images/popup-button.png"
alt="open/close popup"
Expand Down Expand Up @@ -63,7 +67,7 @@
src="./images/blogs.png"
alt="contacts"
/>
<span class="popup__link-title">Contacts</span>
<span class="popup__link-title">News</span>
</a>
</li>
<li class="popup__list-item">
Expand All @@ -83,7 +87,7 @@
src="./images/classroom.png"
alt="classroom"
/>
<span class="popup__link-title">Classroom</span>
<span class="popup__link-title">Sketch</span>
</a>
</li>
<li class="popup__list-item">
Expand Down Expand Up @@ -122,9 +126,9 @@
<input
class="add-popup__control"
type="checkbox"
id="popup-2"
id="popup-more"
/>
<label class="add-popup__toggler" for="popup-2">
<label class="add-popup__toggler" for="popup-more">
<span class="add-popup__title">More</span>
</label>
<div class="add-popup__content">
Expand Down