-
Notifications
You must be signed in to change notification settings - Fork 679
Добавляет рецепт с написанием попапа и демку к нему #4805
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
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
c1ae00e
Добавляет рецепт с написанием попопа и демку к нему
AnnaBaraulina 738f51a
Делает код консистентнее, добавляет пробел
TatianaFokina 0fdaef0
Разбирается с отступами
TatianaFokina 479c93b
Исправляет `title` в демке
TatianaFokina 8af4e85
Удаляет лишние пробелы
TatianaFokina 2048b12
Расставляет тире, ссылки, исправляет ошибки
TatianaFokina c50183f
Форматирует код
TatianaFokina 0f16082
Добавляет исключение в словарь
TatianaFokina 6b53d56
Обновляет индекс раздела
TatianaFokina cb38851
сохраняет последние изменения перед тем, как забрать коммиты ревьюера…
AnnaBaraulina 6b17845
Merge branch 'recipes/popup' of github.com:AnnaBaraulina/content into…
AnnaBaraulina 3362902
Исправляет статью согласно комментариям ревьюера
AnnaBaraulina 5d221ce
Форматирует код
TatianaFokina 67900fd
Форматирует примеры, добавляет ссылки
TatianaFokina da1186b
Расставляет/удаляет запятые
TatianaFokina e5e0b49
добавляет в демо лучшую коллекцию мемов с котиками
AnnaBaraulina 9a2eefa
исправляет позиционирование попапа после добавления мемов
AnnaBaraulina 753cffe
Update recipes/popup/demos/popup-demo/index.html
AnnaBaraulina b1003fb
Merge branch 'main' into recipes/popup
TatianaFokina 4e94893
Слегка причёсывает демку
TatianaFokina 02b4623
Удаляет лишний пробел
TatianaFokina c840fd8
Увеличивает высоту демки
TatianaFokina f9a5582
Возвращает нужное
TatianaFokina cff33d0
Уменьшает высоту демки (。_。)
TatianaFokina c33d296
центрирует кнопку открытия попапа для мобильного разрешения и удаляет…
AnnaBaraulina bca0cf2
центрирует попопа посередине окна просмотра с помощью фиксированного …
AnnaBaraulina bae8d98
исправляет совет по централизации попапа в тексте статьи
AnnaBaraulina 19e28a7
Удаляет ненужные картинки
TatianaFokina f53c76b
Меняет `title` демки
TatianaFokina 9158f33
Обновляет мету, нееемного редачит
TatianaFokina 8fe18f0
Добавляет папку автора
TatianaFokina b7fd797
добавляет текст в фай автора
AnnaBaraulina 162fb93
заменяет изображения на облегченные
AnnaBaraulina 941db43
исправляет текст на странице автора
AnnaBaraulina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: 'Анна Бараулина' | ||
url: https://github.com/AnnaBaraulina | ||
photo: photo.jpeg | ||
badges: | ||
- first-contribution-small | ||
--- | ||
|
||
|
||
Привет! Меня зовут Аня, я занимаюсь веб-разработкой и ищу интересные проекты, чтобы применить то, что уже умею, а также научиться новому! В прошлом я преподаватель философии, училась и преподавала в Москве и в Париже. Любовь к логике и работе с формализованным языком несколько лет назад навели меня на мысль попробовать изучить java-script и с тех пор этим и занимаюсь и хочу продолжать и продолжать! | ||
|
||
Со мной можно связаться по почте: anna.baraulina@gmail.com |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,227 @@ | ||
<!DOCTYPE html> | ||
<html lang="ru"> | ||
|
||
<head> | ||
<title>Пример попапа — Попап — Дока</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap"> | ||
<style> | ||
*, | ||
*::before, | ||
*::after { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
html, | ||
body { | ||
scrollbar-gutter: stable; | ||
} | ||
|
||
html { | ||
height: 100vh; | ||
color-scheme: dark; | ||
font-size: 18px; | ||
} | ||
|
||
body { | ||
min-height: 100vh; | ||
padding: 50px; | ||
display: grid; | ||
justify-items: center; | ||
align-items: center; | ||
background-color: #18191C; | ||
color: #FFFFFF; | ||
font-family: "Roboto", sans-serif; | ||
} | ||
|
||
dialog { | ||
position: fixed; | ||
height: 250px; | ||
width: 350px; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
border: none; | ||
padding: 0; | ||
background-color: #FFFFFF; | ||
color: #000000; | ||
text-align: center; | ||
} | ||
|
||
.button { | ||
min-width: 210px; | ||
padding: 9px 15px; | ||
border: 2px solid transparent; | ||
border-radius: 6px; | ||
font-size: 1rem; | ||
font-weight: 300; | ||
font-family: inherit; | ||
transition: background-color 0.2s linear; | ||
color: #000000; | ||
} | ||
|
||
.openDialogBtn { | ||
position: fixed; | ||
bottom: 50px; | ||
right: 50px; | ||
min-width: 210px; | ||
border: 2px solid transparent; | ||
border-radius: 6px; | ||
font-size: 18px; | ||
font-weight: 300; | ||
font-family: inherit; | ||
transition: background-color 0.2s linear; | ||
} | ||
|
||
.closeDialogBtn { | ||
margin: 10% auto 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.memes { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: 0 20px; | ||
gap: 15px; | ||
} | ||
|
||
.memes img { | ||
max-width: 420px; | ||
opacity: 0.8; | ||
} | ||
|
||
h2 { | ||
margin-top: 10%; | ||
font-weight: 500; | ||
font-size: 1.375rem; | ||
} | ||
|
||
.button:hover { | ||
background-color: #FFFFFF; | ||
cursor: pointer; | ||
transition: background-color 0.2s linear; | ||
} | ||
|
||
.closeDialogBtn:hover { | ||
border: 2px solid #000000; | ||
} | ||
|
||
.button:focus-visible { | ||
border: 2px solid #FFFFFF; | ||
outline: none; | ||
} | ||
|
||
.closeDialogBtn:focus-visible { | ||
border: 2px solid #000000; | ||
} | ||
|
||
.button:focus { | ||
border: 2px solid #FFFFFF; | ||
outline: none; | ||
} | ||
|
||
.closeDialogBtn:focus { | ||
border: 2px solid #000000; | ||
} | ||
|
||
.button-violet { | ||
background-color: #C56FFF; | ||
} | ||
|
||
.dialog__wrapper { | ||
padding: 1em; | ||
} | ||
|
||
dialog::backdrop { | ||
background-color: rgba(0, 0, 0, 0.8); | ||
} | ||
|
||
.scroll-lock { | ||
overflow: hidden; | ||
} | ||
|
||
@media (max-width: 768px) { | ||
body { | ||
padding: 30px; | ||
} | ||
|
||
.openDialogBtn { | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
width: 250px; | ||
height: 50px; | ||
} | ||
|
||
.memes img { | ||
max-width: 100%; | ||
} | ||
} | ||
</style> | ||
</head> | ||
|
||
<body class="parent"> | ||
<div class="memes"> | ||
<img src="images/cute.jpg" alt="Мем про голодного котика"> | ||
<img src="images/home.jpg" alt="Мем про котика на дороге"> | ||
<img src="images/partie.jpg" alt="Мем про кота и вечеринку"> | ||
<img src="images/grechka.jpg" alt="Мем про кота и гречку"> | ||
</div> | ||
<button class="openDialogBtn button button-violet" type="button" aria-haspopup="dialog" | ||
aria-controls="myDialog">Открыть | ||
попап</button> | ||
<dialog class="child" id="myDialog"> | ||
<div class="dialog__wrapper"> | ||
<h2>Дока — самая добрая документация 🙃</h2> | ||
<button class="closeDialogBtn button button-violet" type="button"> | ||
Согласен 💜 | ||
</button> | ||
</div> | ||
</dialog> | ||
|
||
<script> | ||
const dialog = document.getElementById('myDialog') | ||
const dialogOpener = document.querySelector('.openDialogBtn') | ||
const dialogCloser = document.querySelector('.closeDialogBtn') | ||
|
||
function closeOnBackDropClick({ currentTarget, target }) { | ||
const dialog = currentTarget | ||
const isClickedOnBackDrop = target === dialog | ||
if (isClickedOnBackDrop) { | ||
dialog.close() | ||
returnScroll() | ||
} | ||
} | ||
|
||
function openModalAndLockScroll() { | ||
dialog.showModal() | ||
document.body.classList.add('scroll-lock') | ||
} | ||
|
||
function returnScroll() { | ||
document.body.classList.remove('scroll-lock') | ||
} | ||
|
||
function close() { | ||
dialog.close() | ||
returnScroll() | ||
} | ||
|
||
dialog.addEventListener('click', closeOnBackDropClick) | ||
dialogOpener.addEventListener('click', openModalAndLockScroll) | ||
dialogCloser.addEventListener('click', (event) => { | ||
event.stopPropagation() | ||
close() | ||
}) | ||
</script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.