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-popup #48

Merged
merged 6 commits into from
Aug 5, 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
189 changes: 189 additions & 0 deletions submissions/KostiantynOkhorzin/html-css-popup/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
* {
padding: 0;
margin: 0;
border: 0;
}

*, *:before, *:after {
box-sizing: border-box;
}

html, body {
height: 100%;
width: 100%;
font-size: 100%;
line-height: 1;
font-size: 14px;
-ms-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}

input, button, textarea {
font: inherit;
}

input::-ms-clear {
display: none;
}

a, a:visited {
text-decoration: none;
color: inherit;
}

a:hover {
text-decoration: none;
}

ul li {
list-style: none;
}

* {
font-family: Arial, Helvetica, sans-serif;
}

.header {
padding: 15px 30px;
}

.navbar {
display: flex;
justify-content: flex-end;
height: 48px;
}
HannaSyn marked this conversation as resolved.
Show resolved Hide resolved
.navbar__menu {
display: flex;
align-items: center;
gap: 15px;
}
.navbar__link {
display: block;
padding: 10px 0;
outline: none;
border-radius: 5px;
transition: all 0.3s;
}
.navbar__link:focus, .navbar__link:hover {
box-shadow: 0px 0px 0px 2px #A4C6FD;
}
.navbar__profile {
display: block;
width: 32px;
height: 32px;
background-color: #C2185B;
border-radius: 50%;
border: 2px solid #fff;
}

.popap {
position: relative;
}
.popap__input {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
}
.popap__input:checked ~ .popap__body {
opacity: 1;
visibility: visible;
}
.popap__input:focus + .popap__trigger, .popap__input:hover + .popap__trigger {
box-shadow: 0px 0px 0px 2px #A4C6FD;
}
.popap__trigger {
display: flex;
width: 28px;
height: 28px;
border-radius: 5px;
cursor: pointer;
}
.popap__body {
position: absolute;
display: flex;
flex-direction: column-reverse;
gap: 30px;
right: -60px;
top: 50px;
width: 285px;
border-radius: 5px;
transition: all 0.5s;
opacity: 0;
visibility: hidden;
box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.1);
}
.popap__list {
width: 100%;
display: grid;
gap: 10px;
padding: 15px;
grid-template-columns: repeat(3, 1fr);
height: 390px;
overflow: hidden;
}
.popap__link {
padding: 10px 0;
display: grid;
justify-content: center;
grid-template-columns: 1fr;
grid-template-rows: 40px auto;
gap: 10px;
border-radius: 5px;
transition: all 0.3s;
outline: none;
}
.popap__link:hover, .popap__link:focus {
box-shadow: 0px 0px 0px 2px #A4C6FD;
}
.popap__link-icon {
width: 100%;
height: 100%;
-o-object-fit: contain;
object-fit: contain;
}
.popap__link-name {
text-align: center;
}
.popap__input-more {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
bottom: 0;
left: 0;
right: 0;
}
.popap__input-more:checked + .popap__btn {
background-color: transparent;
}
.popap__input-more:checked + .popap__btn::after {
content: "Even more from Kottans";
}
.popap__input-more:focus + .popap__btn {
box-shadow: 0px 0px 0px 2px #A4C6FD;
}
.popap__input-more:checked ~ .popap__list {
overflow: auto;
height: 485px;
}
.popap__btn {
display: flex;
justify-content: center;
align-items: center;
left: 0;
height: 40px;
width: 100%;
cursor: pointer;
background-color: #F5F5F5;
border-radius: 0 0 5px 5px;
}
.popap__btn::after {
content: "More";
}
.popap__btn:hover {
box-shadow: 0px 0px 0px 2px #A4C6FD;
}
148 changes: 148 additions & 0 deletions submissions/KostiantynOkhorzin/html-css-popup/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<!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="shortcut icon" href="icons/favicon.png" type="image/x-icon">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header class="header">
<nav class="navbar">
<ul class="navbar__menu">
<li class="navbar__item">
<a href="#" class="navbar__link">Mail</a>
</li>
<li class="navbar__item">
<a href="#" class="navbar__link">Images</a>
</li>
<li class="navbar__item popap">
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, replace popap with popup everywhere in project, it is a typo.

<input class="popap__input" id="popap__trigger" type="checkbox">
<label class="popap__trigger" for="popap__trigger">
<img class="popap__trigger-icon" src="icons/popup-button.png" alt="icon">
</label>
<div class="popap__body">
<input class="popap__input-more" id="popap__more" type="checkbox">
Copy link
Contributor

Choose a reason for hiding this comment

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

You need move this input because when you navigate with tab, focus should be at icons first, and on More after icons.

<label class="popap__btn" for="popap__more"></label>
<ul class="popap__list">
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/calendar.png" alt="icon">
<span class="popap__link-name">Calendar</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/mail.png" alt="icon">
Copy link
Contributor

Choose a reason for hiding this comment

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

For icons it's better set an empty alt attribute, read more here

<span class="popap__link-name">Mail</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/news.png" alt="icon">
<span class="popap__link-name">News</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/maps.png" alt="icon">
<span class="popap__link-name">Map</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/files.png" alt="icon">
<span class="popap__link-name">Files</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/contacts.png" alt="icon">
<span class="popap__link-name">Contacts</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/tanslation.png" alt="icon">
<span class="popap__link-name">Translate</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/videos.png" alt="icon">
<span class="popap__link-name">Videos</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/search.png" alt="icon">
<span class="popap__link-name">Search</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/photos.png" alt="icon">
<span class="popap__link-name">Photo</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/apps.png" alt="icon">
<span class="popap__link-name">Apps</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/documents.png" alt="icon">
<span class="popap__link-name">Documents</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/chat.png" alt="icon">
<span class="popap__link-name">Chat</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/classroom.png" alt="icon">
<span class="popap__link-name">Classroom</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/collection.png" alt="icon">
<span class="popap__link-name">Collection</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/mars.png" alt="icon">
<span class="popap__link-name">Mars</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/blogs.png" alt="icon">
<span class="popap__link-name">Blogs</span>
</a>
</li>
<li class="popap__item">
<a href="#" class="popap__link">
<img class="popap__link-icon" src="icons/promo.png" alt="icon">
<span class="popap__link-name">Promos</span>
</a>
</li>
</ul>
</div>
</li>
<li class="navbar__item">
<a href="#" class="navbar__link navbar__profile"></a>
</li>
</ul>
</nav>
</header>
</body>
</html>