Skip to content

Commit

Permalink
0
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroslav0102030405 committed Feb 13, 2024
1 parent f2d739b commit 9d3e071
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 109 deletions.
34 changes: 16 additions & 18 deletions care/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1077,68 +1077,66 @@ <h2>Find a Doctor near you</h2>

<!-- <button type="button" class="js-open-gallery">Open</button> -->
<ul class="gallery">
<li>
<li class="gallery__card">
<img
class="js-open-gallery"
class="gallery__image"
src="./src/image/doctor1.jpg"
width="350"
alt="doctor one"
/>
</li>
<li>
<img
class="js-open-gallery"
class="gallery__card gallery__image"
src="./src/image/doctor2.jpg"
width="350"
alt="doctor two"
/>
</li>
<li>
<img
class="js-open-gallery"
class="gallery__card gallery__image"
src="./src/image/doctor3.jpg"
width="350"
alt="doctor three"
/>
</li>
<li>
<img
class="js-open-gallery"
class="gallery__card gallery__image"
src="./src/image/doctor4.jpg"
width="350"
alt="doctor four"
/>
</li>
<li>
<img
class="js-open-gallery"
class="gallery__card gallery__image"
src="./src/image/doctor5.jpg"
width="350"
alt="doctor five"
/>
</li>
<li>
<img
class="js-open-gallery"
class="gallery__card gallery__image"
src="./src/image/doctor6.jpg"
width="350"
alt="doctor six"
/>
</li>
</ul>

<div class="backdrop-3 js-backdrop-gallery">
<div class="content-gallery">
<!-- <button type="button" class="prev">Prev</button> -->
<img
class="content-gallery__btn"
src="./src/image/doctor1.jpg"
width="750"
alt="doctopr"
/>
<!-- <button type="button" class="next">Next</button> -->
<!-- <button class="js-close-gallery" type="button">close</button> -->
<div class="slider hidden">
<div class="slider__container">
<button type="button" class="slider__btn slider__left">
Prev
</button>
<button type="button" class="slider__btn slider__right">
Next
</button>
</div>
<button type="button">CLOSE</button>
</div>
<!-- </div> -->

Expand Down
2 changes: 1 addition & 1 deletion care/src/js/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ backdropJs.addEventListener("click", onBackdropClick);
link.addEventListener("click", onCloseLinkClick);

function onOpenModal() {
document.body.classList.add("is-hidden");
// backdropJs.classList.toggle("is-open");
document.body.classList.add("show-modal-2");
document.body.classList.add("is-hidden");
}

function onCloseModal() {
Expand Down
3 changes: 2 additions & 1 deletion care/src/js/modal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Получаэмо доступ до елементів
const refs = {
openModalBtn: document.querySelector('[data-action="open-modal"]'),
Expand All @@ -16,11 +15,13 @@ refs.backdrop.addEventListener("click", onBackdropClick);
function onOpenModal() {
window.addEventListener("keydown", onEscKeyPress);
document.body.classList.add("show-modal");
document.body.classList.add("is-hidden");
}

function onCloseModal() {
window.removeEventListener("keydown", onEscKeyPress);
document.body.classList.remove("show-modal");
document.body.classList.remove("is-hidden");
}

function onBackdropClick(event) {
Expand Down
12 changes: 11 additions & 1 deletion care/src/sass/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,15 @@ img {
}

body.is-hidden {
overflow: hidden;
// height: 100vh;
// overflow-y: hidden;

height: 100vh;
overflow-y: hidden;
// убрать полосу прокрутки
padding-right: 15px;
}

// .hidden {
// display: none !important;
// }
198 changes: 110 additions & 88 deletions care/src/sass/components/gallery/gallery.scss
Original file line number Diff line number Diff line change
@@ -1,109 +1,131 @@
body.show-modal-2 .backdrop-3 {
opacity: 1;
visibility: visible;
pointer-events: initial;
// body.show-modal-2 .backdrop-3 {
// opacity: 1;
// visibility: visible;
// pointer-events: initial;
// }
// body.show-modal-2 .content-gallety {
// transform: scale(1);
// }

// .backdrop-3 {
// display: flex;
// justify-content: center;
// align-items: center;
// position: fixed;
// top: 0;
// left: 0;
// bottom: 0;
// right: 0;
// background-color: rgba(0, 0, 0, 0.3);

// opacity: 0;
// transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
// pointer-events: none;
// visibility: hidden;
// transition:
// opacity 200ms ease-in-out,
// visibility 200ms ease-in-out;
// }

// .content-gallety {
// display: flex;
// align-items: center;
// max-width: 900px;
// background-color: $white-color;
// transform: scale(0.8);
// transition: transform 200ms ease-in-out;
// }

// .gallery__image {
// transform: scale(1);

// transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 250ms;
// }

// .gallery__image:hover,
// .gallery__image:focus {
// transform: scale(1.1);
// }

.gallery {
display: flex;
justify-content: center;
flex-wrap: wrap;
// max-width: 900px;
width: 100%;
}

body.show-modal-2 .content-gallety {
transform: scale(1);
.gallery__card {
display: flex;
width: 300px;
}

.gallery__image {
width: 300px;
}

.backdrop-3 {
// @media screen and (max-width: 767px) {
// position: fixed;
// top: 0;
// left: 0;
// width: 100%;
// height: 100%;
// z-index: 40;
// background-color: rgba(0, 0, 0, 0.3);
// visibility: hidden;
// transition:
// background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
// visibility 0.45s cubic-bezier(0.4, 0, 0.2, 1);
// }
.gallery__card:hover .gallery__image {
transform: scale(1.1);
cursor: zoom-in;
}

.slider {
display: flex;
justify-content: center;
align-items: center;
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.3);
// z-index: 999;

opacity: 0;
transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
pointer-events: none;
visibility: hidden;
transition:
opacity 200ms ease-in-out,
visibility 200ms ease-in-out;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.89);
}

// .js-backdrop-gallery.is-open {
// // opacity: 1;
// // background-color: rgba(0, 0, 0, 0.3);
// visibility: visible;

// // pointer-events: none;
// }

.content-gallety {
.slider__container {
display: flex;
align-items: center;
// @media screen and (max-width: $tablet) {
// height: 100%;
// width: 60%;

// background-color: $accent-color;
// transform: translateX(-100%);
// // transition: transform 0.45s linear;
// transition-property: all;
// transition-duration: 0.65s;
// transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);

// // transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
// padding: 20px;
// // спрятать переполнение
// overflow: hidden;
// }
// padding: 30px;
max-width: 900px;
// min-height: 320px;
// width: 100%;
background-color: $white-color;
// border-radius: 10px;
// box-shadow:
// 0px 1px 3px 0px rgba(0, 0, 0, 0.2),
// 0px 1px 1px 0px rgba(0, 0, 0, 0.14),
// 0px 2px 1px -1px rgba(0, 0, 0, 0.12);
transform: scale(0.8);
transition: transform 200ms ease-in-out;

// @media screen and (max-width: $tablet) {
// max-width: 235px;
// }

// @media screen and (min-width: $tablet) and (max-width: $desktop) {
// max-width: 330px;
// }
}
.prev {
display: flex;

.slider__container img {
animation: anim 0.5s ease;
}

.next {
display: flex;
.slider__btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
text-decoration: none;
display: inline-flex;
padding: 14px 40px;
border-radius: 30px;
background-image: linear-gradient(#6ab1d7 0%, #33d9de 50%, #002878 100%);
background-position: 100% 0;
background-size: 200% 200%;
font-size: inherit;
font-size: 24px;
font-weight: 300;
color: $white-color;
box-shadow: 0 16px 32px 0 rgba(0, 40, 120, 0.35);
transition: 0.5s;
}

.content-gallery__btn {
display: flex;
.slider__btn-close:hover {
box-shadow:
0 0 10px 0 #f137a6 inset,
0 0 10px 4px #f137a6;
color: #f137a6;
}

// .backdrop-3.is-open .content-gallery {
// // opacity: 1;
// transform: translateX(0);
// }
@keyframes anim {
0% {
border-radius: 100%;
transform: scale(0);
}
50% {
border-radius: 50%;
transform: scale(1.2);
}
100% {
border-radius: 0;
transform: scale(1);
}
}

0 comments on commit 9d3e071

Please sign in to comment.