This commit is contained in:
ThatOneCalculator 2022-08-22 22:57:03 -07:00
parent 3b09e6f510
commit 2b2abd67a4
2 changed files with 4 additions and 69 deletions

View file

@ -1,6 +1,6 @@
{
"name": "calckey",
"version": "12.118.1-calc.12.3",
"version": "12.118.1-calc.12.4",
"codename": "aqua",
"repository": {
"type": "git",

View file

@ -25,7 +25,7 @@
{{ i18n.ts.newNoteRecived }}
</button>
</div>
<div v-if="isDesktop" class="tl _block">
<div v-if="!isMobile" class="tl _block">
<XTimeline
ref="tl"
:key="src"
@ -36,7 +36,7 @@
/>
</div>
<div v-else class="tl _block">
<swiper>
<swiper :modules="[Virtual]" virtual>
<swiper-slide>
<XTimeline
ref="tl"
@ -100,6 +100,7 @@
<script lang="ts" setup>
import { defineAsyncComponent, computed, watch, ref } from 'vue';
import { Virtual } from 'swiper';
import { Swiper, SwiperSlide } from 'swiper/vue';
import XTimeline from '@/components/timeline.vue';
import XPostForm from '@/components/post-form.vue';
@ -287,72 +288,6 @@ definePageMetadata(
: 'fas fa-home',
}))
);
/* if (isMobile.value) {
document.addEventListener('touchstart', handleTouchStart, false);
document.addEventListener('touchmove', handleTouchMove, false);
let xDown = null;
let yDown = null;
function getTouches(evt) {
return (
evt.touches || evt.originalEvent.touches
);
}
function handleTouchStart(evt) {
const firstTouch = getTouches(evt)[0];
xDown = firstTouch.clientX;
yDown = firstTouch.clientY;
}
function handleTouchMove(evt) {
if (!xDown || !yDown) return;
if (['INPUT', 'TEXTAREA', 'IMG', 'VIDEO', 'CANVAS'].includes(evt.target.tagName) || evt.target.attributes['contenteditable']) return;
let xUp = evt.touches[0].clientX;
let yUp = evt.touches[0].clientY;
let xDiff = xDown - xUp;
let yDiff = yDown - yUp;
let next = 'home';
let timelines = ['home'];
if (isLocalTimelineAvailable) {
timelines.push('local');
}
if (isRecommendedTimelineAvailable) {
timelines.push('recommended');
}
if (isLocalTimelineAvailable) {
timelines.push('social');
}
if (isGlobalTimelineAvailable) {
timelines.push('global');
}
if (Math.abs(xDiff) > Math.abs(yDiff)) {
if (xDiff < 0) {
console.log(Math.abs(xDiff));
if (src === 'home') {
next = 'global';
}
else {
next = timelines[(timelines.indexOf(src) - 1) % timelines.length];
}
} else {
next = timelines[(timelines.indexOf(src) + 1) % timelines.length];
}
saveSrc(next);
}
xDown = null;
yDown = null;
return;
}
} */
</script>
<style lang="scss" scoped>