mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-26 13:08:02 +00:00
deploy: e344958224
This commit is contained in:
65
js/script.js
65
js/script.js
@@ -1,18 +1,10 @@
|
||||
const uniqueSwiper = new Swiper('.unique-swiper', {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 80,
|
||||
allowTouchMove: true,
|
||||
breakpoints: {
|
||||
1400: {
|
||||
allowTouchMove: false,
|
||||
},
|
||||
1200: {
|
||||
allowTouchMove: true,
|
||||
},
|
||||
768: {
|
||||
allowTouchMove: true,
|
||||
}
|
||||
},
|
||||
// autoplay: {
|
||||
// delay: 3000,
|
||||
// disableOnInteraction: false,
|
||||
// },
|
||||
direction: 'horizontal',
|
||||
pagination: {
|
||||
el: '.simplex-unique-swiper-pagination',
|
||||
@@ -70,18 +62,10 @@ const privateSwiper = new Swiper('.private-swiper', {
|
||||
const simplexExplainedSwiper = new Swiper(".simplex-explained-swiper", {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 80,
|
||||
allowTouchMove: true,
|
||||
breakpoints: {
|
||||
1400: {
|
||||
allowTouchMove: false,
|
||||
},
|
||||
1200: {
|
||||
allowTouchMove: true,
|
||||
},
|
||||
768: {
|
||||
allowTouchMove: true,
|
||||
}
|
||||
},
|
||||
// autoplay: {
|
||||
// delay: 3000,
|
||||
// disableOnInteraction: false,
|
||||
// },
|
||||
direction: "horizontal",
|
||||
pagination: {
|
||||
el: ".simplex-explained-swiper-pagination",
|
||||
@@ -89,11 +73,10 @@ const simplexExplainedSwiper = new Swiper(".simplex-explained-swiper", {
|
||||
}
|
||||
});
|
||||
|
||||
function closeOverlay(e) {
|
||||
function closeOverlay (e) {
|
||||
e.target.closest('.overlay').classList.remove('flex');
|
||||
e.target.closest('.overlay').classList.add('hidden');
|
||||
document.body.classList.remove('lock-scroll');
|
||||
history.replaceState(null, null, ' ');
|
||||
}
|
||||
|
||||
window.addEventListener('click', clickHandler)
|
||||
@@ -122,11 +105,14 @@ function clickHandler(e) {
|
||||
}
|
||||
else if (e.target.closest('.open-overlay-btn')) {
|
||||
let id = e.target.closest('.open-overlay-btn').dataset.showOverlay;
|
||||
window.location.hash = id;
|
||||
let overlay = document.getElementById(id);
|
||||
overlay.classList.remove('hidden');
|
||||
overlay.classList.add('flex');
|
||||
document.body.classList.toggle('lock-scroll');
|
||||
}
|
||||
// -----------------------------------------------
|
||||
// ---------- For Contact & Invitation Page tabs
|
||||
else if (e.target.closest('.contact-tab-btn')) {
|
||||
else if(e.target.closest('.contact-tab-btn')){
|
||||
e.target.closest('.contact-tab').classList.toggle('active')
|
||||
}
|
||||
}
|
||||
@@ -135,7 +121,7 @@ window.addEventListener('load', () => {
|
||||
const googlePlayBtn = document.querySelector('.google-play-btn');
|
||||
const appleStoreBtn = document.querySelector('.apple-store-btn');
|
||||
const fDroidBtn = document.querySelector('.f-droid-btn');
|
||||
if (!googlePlayBtn || !appleStoreBtn || !fDroidBtn) return;
|
||||
if(!googlePlayBtn || !appleStoreBtn || !fDroidBtn) return;
|
||||
|
||||
|
||||
if (isMobile.Android()) {
|
||||
@@ -151,24 +137,3 @@ window.addEventListener('load', () => {
|
||||
fDroidBtn.classList.remove('hidden');
|
||||
}
|
||||
})
|
||||
|
||||
function openOverlay() {
|
||||
let hash = window.location.hash
|
||||
if (hash) {
|
||||
const id = hash.split('#')[1];
|
||||
const el = document.getElementById(id)
|
||||
if (el.classList.contains('overlay')) {
|
||||
const scrollTo = el.getAttribute('data-scroll-to')
|
||||
if (scrollTo) {
|
||||
const scrollToEl = document.getElementById(scrollTo)
|
||||
if (scrollToEl) scrollToEl.scrollIntoView(true)
|
||||
}
|
||||
el.classList.remove('hidden')
|
||||
el.classList.add('flex')
|
||||
document.body.classList.add('lock-scroll')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('load', openOverlay);
|
||||
window.addEventListener('hashchange', openOverlay);
|
||||
|
||||
Reference in New Issue
Block a user