ادمین :
@Maryam3771
تعرفه تبلیغات:
https://t.me/alloadv/822
Post #308
4.75K
HT @htmlcss_channels
Showing posts older than #310 · Back to latest
➤ <h1> 😎 </h1> 😎
➤ <h1> 🙂 </h1> 😊
➤ <h1> 😍 </h1> 😍
➤ <h1> 🤬 </h1> 🤬
➤ <h1> 😂 </h1> 😂
➤ <h1> 😈 </h1> 😈
➤ <h1> 🤡 </h1> 🤡
➤ <h1> 😴 </h1> 😴
➤ <h1> 🤑 </h1> 🤑
Html and Css & Jsآموزش Creates a horizontally scrollable image gallery | HTML & CSS با ری اکشن بهمون انرژی بدید❤️ 💎 Channel: @htmlcss_channels
<div class="gallery-container">
<div class="thumbnails"></div>
<div class="scrollbar">
<div class="thumb"></div>
</div>
<div class="slides">
<div><img src="https://picsum.photos/id/1067/540/720"></div>
<div><img src="https://picsum.photos/id/122/540/720"></div>
<div><img src="https://picsum.photos/id/188/540/720"></div>
<div><img src="https://picsum.photos/id/249/540/720"></div>
<div><img src="https://picsum.photos/id/257/540/720"></div>
<div><img src="https://picsum.photos/id/259/540/720"></div>
<div><img src="https://picsum.photos/id/283/540/720"></div>
<div><img src="https://picsum.photos/id/288/540/720"></div>
<div><img src="https://picsum.photos/id/299/540/720"></div>
</div>
</div>
.gallery-container {
display: flex;
justify-content: center;
}
.thumbnails {
display: flex;
flex-direction: column;
gap: 8px;
}
.thumbnails img {
width: 40px;
height: 40px;
cursor: pointer;
}
.scrollbar {
width: 1px;
height: 720px;
background: #ccc;
display: block;
margin: 0 0 0 8px;
}
.thumb {
width: 1px;
position: absolute;
height: 0;
background: #000;
}
.slides {
margin: 0 16px;
display: grid;
grid-auto-flow: row;
gap: 1rem;
width: calc(540px + 1rem);
padding: 0 0.25rem;
height: 720px;
overflow-y: auto;
overscroll-behavior-y: contain;
scroll-snap-type: y mandatory;
scrollbar-width: none;
}
.slides > div {
scroll-snap-align: start;
}
.slides img {
width: 540px;
object-fit: contain;
}
.slides::-webkit-scrollbar {
display: none;
}
const slideGallery = document.querySelector('.slides');
const slides = slideGallery.querySelectorAll('div');
const scrollbarThumb = document.querySelector('.thumb');
const slideCount = slides.length;
const slideHeight = 720;
const marginTop = 16;
const scrollThumb = () => {
const index = Math.floor(slideGallery.scrollTop / slideHeight);
scrollbarThumb.style.height = `${((index + 1) / slideCount) * slideHeight}px`;
};
const scrollToElement = el => {
const index = parseInt(el.dataset.id, 10);
slideGallery.scrollTo(0, index * slideHeight + marginTop);
};
document.querySelector('.thumbnails').innerHTML += [...slides]
.map(
(slide, i) => `<img src="${slide.querySelector('img').src}" data-id="${i}">`
)
.join('');
document.querySelectorAll('.thumbnails img').forEach(el => {
el.addEventListener('click', () => scrollToElement(el));
});
slideGallery.addEventListener('scroll', e => scrollThumb());
scrollThumb();

Forwarded from تهران دیتا-دانشگاه تهران

Html and Css & Jsآموزش instagram Logo.zip
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
overflow: hidden;
}
.insta {
width: 150px;
height: 150px;
background: radial-gradient(
circle at 30% 107%,
#fdf497 0%,
#fdf497 5%,
#fd5949 45%,
#d6249f 60%,
#285aeb 90%
);
border-radius: 35px;
display: grid;
place-items: center;
}
.innerbox {
width: 120px;
height: 120px;
border: 10px solid #fff;
border-radius: 32px;
display: grid;
place-items: center;
position: relative;
}
.innerbox::before {
content: "";
width: 45px;
height: 45px;
border: 10px solid #fff;
border-radius: 50%;
background: transparent;
position: absolute;
}
.innerbox::after {
content: "";
width: 10px;
height: 10px;
border: 2px solid #fff;
border-radius: 50%;
background: #fff;
position: absolute;
top: 8px;
right: 10px;
}<div class="dropdown">
<button class="dropbtn">Menu</button>
<div class="dropdown-content">
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Contact</a>
</div>
</div>
.dropdown {
position: relative;
left: 200px;
top: 200px;
}
.dropdown-content {
display: none;
position: absolute;
z-index: 1;
}
.dropdown-content a {
display: block;
}
.dropdown:hover .dropdown-content {
display: block;
}