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", "name": "calckey",
"version": "12.118.1-calc.12.3", "version": "12.118.1-calc.12.4",
"codename": "aqua", "codename": "aqua",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -25,7 +25,7 @@
{{ i18n.ts.newNoteRecived }} {{ i18n.ts.newNoteRecived }}
</button> </button>
</div> </div>
<div v-if="isDesktop" class="tl _block"> <div v-if="!isMobile" class="tl _block">
<XTimeline <XTimeline
ref="tl" ref="tl"
:key="src" :key="src"
@ -36,7 +36,7 @@
/> />
</div> </div>
<div v-else class="tl _block"> <div v-else class="tl _block">
<swiper> <swiper :modules="[Virtual]" virtual>
<swiper-slide> <swiper-slide>
<XTimeline <XTimeline
ref="tl" ref="tl"
@ -100,6 +100,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { defineAsyncComponent, computed, watch, ref } from 'vue'; import { defineAsyncComponent, computed, watch, ref } from 'vue';
import { Virtual } from 'swiper';
import { Swiper, SwiperSlide } from 'swiper/vue'; import { Swiper, SwiperSlide } from 'swiper/vue';
import XTimeline from '@/components/timeline.vue'; import XTimeline from '@/components/timeline.vue';
import XPostForm from '@/components/post-form.vue'; import XPostForm from '@/components/post-form.vue';
@ -287,72 +288,6 @@ definePageMetadata(
: 'fas fa-home', : '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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>