diff --git a/src/components/MapDetails.vue b/src/components/MapDetails.vue index a0455bb..fac011d 100644 --- a/src/components/MapDetails.vue +++ b/src/components/MapDetails.vue @@ -1,5 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/components/TimeLists/TimesListHeadingColumn.vue b/src/components/TimeLists/TimesListHeadingColumn.vue new file mode 100644 index 0000000..352f549 --- /dev/null +++ b/src/components/TimeLists/TimesListHeadingColumn.vue @@ -0,0 +1,29 @@ + + + + + + \ No newline at end of file diff --git a/src/components/TimesListItem.vue b/src/components/TimeLists/TimesListItem.vue similarity index 71% rename from src/components/TimesListItem.vue rename to src/components/TimeLists/TimesListItem.vue index 5c0975a..389ff1a 100644 --- a/src/components/TimesListItem.vue +++ b/src/components/TimeLists/TimesListItem.vue @@ -3,9 +3,9 @@ import type { TimeListColumn } from '@/types/TimeListColumn'; import type { Ref } from 'vue'; import { computed, ref } from 'vue'; - import TimesListItemContent from './TimesListItemContent.vue'; + import TimesListItemColumn from './TimesListItemColumn.vue'; import TimesListItemMoreDetails from './TimesListItemMoreDetails.vue'; - import ModerationModal from './Moderation/ModerationModal.vue'; + import ModerationModal from '../Moderation/ModerationModal.vue'; import { useModerationStore, type ModerationTarget } from '@/stores/moderation'; const props = defineProps<{ @@ -25,21 +25,53 @@ const contextMenuX: Ref = ref(0); const contextMenuY: Ref = ref(0); + + const totalCols = computed(()=>{ + return Math.max(...props.cols.map((v)=>{return v.col && v.colSpan ? v.col+v.colSpan : 1})); + }) + const totalRows = computed(()=>{ + return Math.max(...props.cols.map((v)=>{return v.row && v.rowSpan ? v.row+v.rowSpan : 1})); + }) + const colWidthsStyle = computed(()=>{ - return props.cols.map((v)=>v.width ? v.width : 'auto').join(' '); + return props.cols.filter((v)=>v.row === undefined || v.row === 1) //only first row + .sort((a,b)=>a.col - b.col) //sort into correct col order + .map((v)=>v.width ? v.width : 'auto').join(' '); //make css }) + + const rowWidthsStyle = computed(()=>{ + return totalRows.value > 1 ? '1fr 0.5fr' : '1fr'; + }) + + const totalRowsMobile = computed(()=>{ + return Math.max(...props.cols.map((v)=>{return v.rowMobile && v.rowSpanMobile ? v.rowMobile+v.rowSpanMobile : 1})); + }) + + const colWidthsStyleMobile = computed(()=>{ + return props.cols.filter((v)=>(v.rowMobile === undefined || v.rowMobile === 1)) //only first row + .sort((a,b)=>(a.colMobile ?? 1) - (b.colMobile ?? 1)) //sort into correct col order + .map((v)=>v.widthMobile ? v.widthMobile : 'auto').join(' '); //make css + }) + + const rowWidthsStyleMobile = computed(()=>{ + return totalRowsMobile.value > 1 ? '1fr 0.5fr' : '1fr'; + }) + const moreDetailsCols: TimeListColumn[] = [ { label:'Jumps', - data:'jumps' + data:'jumps', + col:1, }, { label: 'Strafes', - data:'strafes' + data:'strafes', + col:2, }, { label: 'Sync', - data:'sync' + data:'sync', + col:3, }, ]; @@ -122,15 +154,7 @@ 'pb-2' : ''" @click="toggleDetails()" @contextmenu="handleRightClick"> - -
- - - -
- -
-
+ @@ -161,41 +185,16 @@ - - - - \ No newline at end of file diff --git a/src/components/TimesListItemMoreDetails.vue b/src/components/TimeLists/TimesListItemMoreDetails.vue similarity index 61% rename from src/components/TimesListItemMoreDetails.vue rename to src/components/TimeLists/TimesListItemMoreDetails.vue index 34b5bc8..5e78cc8 100644 --- a/src/components/TimesListItemMoreDetails.vue +++ b/src/components/TimeLists/TimesListItemMoreDetails.vue @@ -3,31 +3,31 @@ import type { TimeListColumn } from '@/types/TimeListColumn'; import timeLinks from '@/utils/timeLinks'; import { computed } from 'vue'; - import RelativeDate from './RelativeDate.vue'; + import RelativeDate from '../RelativeDate.vue'; const props = defineProps<{ time: Time, cols: TimeListColumn[] }>(); const colWidthsStyle = computed(()=>{ - return props.cols.map((v)=>v.width ? v.width : 'auto').join(' '); + return props.cols.map((v)=>v.width ? v.width : '1fr').join(' '); })