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

Popup is done #100

Merged
merged 9 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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
138 changes: 138 additions & 0 deletions submissions/Neskazhuk/popup/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<!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">
<title>Popup</title>
<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=Montserrat:wght@400;600&display=swap" rel="stylesheet">
<link href="styles.css" rel="stylesheet">
</head>

<body>
<header class="header">
<nav class="nav">
<ul class="nav-list">
<li class="nav-item"><a class="link" href="#">Hello</a></li>
<li class="nav-item"><a class="link" href="#">World</a></li>
<li class="nav-item popup">
<input id="popup-input-id" class="popup-input" type="checkbox" tabindex="0">
Neskazhuk marked this conversation as resolved.
Show resolved Hide resolved
<label for="popup-input-id" class="popup-btn">
<img class="popup-icon" src="./icons/popup-button.png" alt="">
</label>
<div class="popup-container">
<input id="more-input" class="more-input" type="checkbox">
A-Ostrovnyy marked this conversation as resolved.
Show resolved Hide resolved
<label for="more-input" class="more-btn">
</label>
<ul class="popup-list">
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/calendar.png" alt="Calendar">
<p class="popup-name">Calendar</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/mail.png" alt="Mail">
<p class="popup-name">Mail</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/maps.png" alt="Map">
<p class="popup-name">Map</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/files.png" alt="Files">
<p class="popup-name">Files</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/tanslation.png" alt="Translate">
A-Ostrovnyy marked this conversation as resolved.
Show resolved Hide resolved
<p class="popup-name">Translate</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/videos.png" alt="Video">
<p class="popup-name">Video</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/search.png" alt="Search">
<p class="popup-name">Search</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/photos.png" alt="Photo">
<p class="popup-name">Photo</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/apps.png" alt="Apps">
<p class="popup-name">Apps</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/documents.png" alt="Documents">
<p class="popup-name">Documents</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/chat.png" alt="Chat">
<p class="popup-name">Chat</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/classroom.png" alt="Classrom">
<p class="popup-name">Classrom</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/collection.png" alt="Collection">
<p class="popup-name">Collection</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/mars.png" alt="Mars">
<p class="popup-name">Mars</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/blogs.png" alt="Blogs">
<p class="popup-name">Blogs</p>
</a>
</li>
<li class="popup-item">
<a class="popup link" href="#">
<img class="popup-img" src="./icons/promo.png" alt="Promos">
<p class="popup-name">Promos</p>
</a>
</li>
</ul>
</div>
</li>
<li class="nav-item">
<a class="link" href="#">
<img class="avatar" src="./icons/fried_egg.png" alt="avatar">
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
167 changes: 167 additions & 0 deletions submissions/Neskazhuk/popup/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
/* General */
* {
A-Ostrovnyy marked this conversation as resolved.
Show resolved Hide resolved
padding: 0;
margin: 0;
border: 0;
}

body {
font-family: 'Montserrat', sans-serif;
A-Ostrovnyy marked this conversation as resolved.
Show resolved Hide resolved
font-size: 16px;
line-height: 1.5;
font-weight: 600;
color: gray;
}

.link {
text-decoration: none;
color: inherit;
}

.nav-list,
.popup-list {
list-style: none;
}

/* Nav */
.nav {
height: 50px;
}

.nav-list {
display: flex;
justify-content: flex-end;
align-items: center;
gap: 20px;
margin-right: 40px;
margin-top: 25px;
}

.nav-item {
padding:5px;
cursor: pointer;
border:2px solid transparent;
A-Ostrovnyy marked this conversation as resolved.
Show resolved Hide resolved
border-radius: 10px;
}

.nav-item:hover {
border-color: #7b68ee;
}

/* Icons */
.popup-icon,
.avatar {
display: block;
width: 1.6em;
height: 1.6em;
cursor: pointer;
}

/* Checkboxes */
.popup-input,
.more-input {
position: absolute;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}

.popup-input:focus-visible ~ .popup-btn > .popup-icon {
outline: 2px solid #7b68ee;
border-radius: 10px;
}

.more-input:focus + .more-btn {
outline: 2px solid #7b68ee;
border-radius: 10px;
}

/* Checked */
.popup-input:checked ~ .popup-container {
visibility: visible;
}

.more-input:checked + .more-btn::after {
content: 'Less';
}

.more-input ~ .popup-list li:nth-child(n + 13) {
display: none;
}

.more-input:checked ~ .popup-list li {
display: block;
}

.more-btn {
font-weight: 400;
display: flex;
justify-content: center;
padding: 8px;
margin: 2px;
cursor: pointer;
}

.more-btn::after {
content: 'More';
}

.more-btn:hover,
.more-btn:focus {
border: 2px solid #7b68ee;
border-radius: 10px;
}
/* Popup */
.popup-container {
position: absolute;
display: flex;
flex-direction: column-reverse;
top: 75px;
right: 25px;

width: 340px;
max-height: 80%;
border-radius: 10px;
background-color: #fff;
box-shadow: 0px 0px 10px 1px rgb(0 0 0 / 10%);

overflow: auto;
visibility: collapse;
}

.popup-list {
font-size: 16px;
display: grid;
grid-template-columns: repeat(3, 1fr);
padding: 9px;
}

.popup.link {
width: 100%;
display: grid;
grid-template-columns: 1fr;
justify-content: center;
grid-template-rows: 50px auto;
gap: 10px;
padding: 10px 0;
border: 2px solid transparent;
border-radius: 10px;
}

.popup.link:hover,
.popup.link:focus {
border-color: #7b68ee;
outline: none;
transition: .1s;
}

.popup-img {
width: 100%;
height: 100%;
object-fit: contain;
}

.popup-name {
text-align: center;
font-size: 14px;
}