From f16f22cb2502b1791803e37c11d3dc65856c5c60 Mon Sep 17 00:00:00 2001 From: why-Mia Date: Sun, 14 Sep 2025 00:37:05 +0100 Subject: [PATCH 01/10] implement timecolumn col & row options --- src/components/MapDetails.vue | 4 ++ src/components/PlayerDetails.vue | 4 ++ src/components/RecentTimes.vue | 77 +++++++++++++++---------- src/components/TimesListItem.vue | 31 ++++++++-- src/components/TimesListItemContent.vue | 2 +- src/types/TimeListColumn.ts | 4 ++ 6 files changed, 84 insertions(+), 38 deletions(-) diff --git a/src/components/MapDetails.vue b/src/components/MapDetails.vue index a0455bb..b8bceba 100644 --- a/src/components/MapDetails.vue +++ b/src/components/MapDetails.vue @@ -42,6 +42,7 @@ data: 'name', placement: true, width:'25%', + col:1, alignmentClasses: 'text-left', link: timeLinks.playerLink }, @@ -49,6 +50,7 @@ label: 'Server', data: 'server', width: '30%', + col:2, classes: 'text-sm text-gray-400', alignmentClasses: 'text-left text-gray-300' }, @@ -56,12 +58,14 @@ label: 'Date', data: 'date', width:'15%', + col:3, alignmentClasses: 'text-right justify-end', }, { label: 'Time', data: 'time', width: '30%', + col:4, alignmentClasses: 'text-right justify-end monospace', numFormat: dateTimeFormats.time }]" diff --git a/src/components/PlayerDetails.vue b/src/components/PlayerDetails.vue index f7f6c69..bfa67fd 100644 --- a/src/components/PlayerDetails.vue +++ b/src/components/PlayerDetails.vue @@ -163,6 +163,7 @@ label: 'Map', data: 'map', width:'25%', + col:1, alignmentClasses: 'text-left', link: timeLinks.mapLink }, @@ -170,6 +171,7 @@ label: 'Server', data: 'server', width: '30%', + col:2, classes: 'text-sm text-gray-400', alignmentClasses: 'text-left text-gray-300' }, @@ -177,12 +179,14 @@ label: 'Date', data: 'date', width:'15%', + col:3, alignmentClasses: 'text-right justify-end', }, { label: 'Time', data: 'time', width: '30%', + col:4, alignmentClasses: 'text-right justify-end monospace', numFormat: dateTimeFormats.time }]" diff --git a/src/components/RecentTimes.vue b/src/components/RecentTimes.vue index 3abe8fa..f254696 100644 --- a/src/components/RecentTimes.vue +++ b/src/components/RecentTimes.vue @@ -25,14 +25,16 @@ const currentStyle: Ref = ref(urlParams.getAsObject().style ? Number(urlParams.getAsObject().style) : Style.all); - const showStyleColumn = computed(() => currentStyle.value === Style.all); - const tableColumns = computed((): TimeListColumn[] => { const columns: TimeListColumn[] = [ { label: 'Player', data: 'name', - width: showStyleColumn.value ? '18%' : '20%', + col:1, + colSpan:1, + row:1, + rowSpan:2, + width: '20%', classes: 'font-semibold', alignmentClasses: 'text-left', link: timeLinks.playerLink @@ -40,47 +42,60 @@ { label: 'Map', data: 'map', - width: showStyleColumn.value ? '18%' : '20%', + col:2, + colSpan:1, + row:1, + rowSpan:1, + width: '35%', classes: 'text-gray-200', alignmentClasses: 'text-right justify-end md:justify-start md:text-left', link: timeLinks.mapLink - } - ]; - - if (showStyleColumn.value) { - columns.push({ - label: 'Style', - data: 'style', - width: '12%', - classes: 'text-sm text-gray-400', - alignmentClasses: 'text-right justify-end md:justify-start md:text-left', - numFormat: styleFormat.name - }); - } - - columns.push( + }, { label: 'Server', data: 'server', - width: showStyleColumn.value ? '18%' : '20%', - classes: 'text-sm text-gray-400', - alignmentClasses: 'text-right justify-end md:justify-start md:text-left text-gray-300' + col:2, + colSpan:1, + row:2, + rowSpan:1, + classes: 'text-xs text-gray-400', + alignmentClasses: 'justify-start text-left' + }, + { + label: 'Time', + data: 'time', + col:3, + colSpan:1, + row:1, + rowSpan:2, + width: '25%', + alignmentClasses: 'text-right justify-end monospace', + numFormat: dateTimeFormats.time + }, + { + label: 'Style', + data: 'style', + col:4, + colSpan:1, + row:1, + rowSpan:1, + width: '20%', + classes: '', + alignmentClasses: 'text-right justify-end', + numFormat: styleFormat.name }, { label: 'Date', data: 'date', - width: showStyleColumn.value ? '12%' : '15%', + col:4, + colSpan:1, + row:2, + rowSpan:1, + classes: 'text-xs text-gray-400', alignmentClasses: 'text-right justify-end', numFormat: dateTimeFormats.date }, - { - label: 'Time', - data: 'time', - width: showStyleColumn.value ? '22%' : '25%', - alignmentClasses: 'text-right justify-end monospace', - numFormat: dateTimeFormats.time - } - ); + ]; return columns; }); diff --git a/src/components/TimesListItem.vue b/src/components/TimesListItem.vue index 5c0975a..8a59b52 100644 --- a/src/components/TimesListItem.vue +++ b/src/components/TimesListItem.vue @@ -25,21 +25,39 @@ 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) + .sort((a,b)=>a.col - b.col) + .map((v)=>v.width ? v.width : 'auto').join(' '); }) + + const rowWidthsStyle = computed(()=>{ + return totalRows.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,8 +140,8 @@ 'pb-2' : ''" @click="toggleDetails()" @contextmenu="handleRightClick"> - -
+
@@ -163,6 +181,7 @@ \ No newline at end of file diff --git a/src/components/TimeLists/TimesListItem.vue b/src/components/TimeLists/TimesListItem.vue index cb774c5..6ee0214 100644 --- a/src/components/TimeLists/TimesListItem.vue +++ b/src/components/TimeLists/TimesListItem.vue @@ -34,9 +34,9 @@ }) const colWidthsStyle = computed(()=>{ - return props.cols.filter((v)=>v.row === undefined || v.row === 1) - .sort((a,b)=>a.col - b.col) - .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(()=>{ @@ -203,32 +203,4 @@ grid-column:span 2; } } - - - - - \ No newline at end of file From a09dfd29ae3c8a1ce41fcd53803b99feb6867aac Mon Sep 17 00:00:00 2001 From: why-Mia Date: Mon, 15 Sep 2025 00:18:41 +0100 Subject: [PATCH 06/10] adjust recent times column spacing --- src/components/RecentTimes.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/RecentTimes.vue b/src/components/RecentTimes.vue index eef2e3f..aecea29 100644 --- a/src/components/RecentTimes.vue +++ b/src/components/RecentTimes.vue @@ -68,8 +68,9 @@ colSpan:1, row:1, rowSpan:2, - width: '25%', - alignmentClasses: 'text-right justify-end monospace', + width: '30%', + classes: 'monospace', + alignmentClasses: 'text-right justify-end lg:text-left lg:justify-start lg:ml-12', numFormat: dateTimeFormats.time }, { @@ -79,7 +80,7 @@ colSpan:1, row:1, rowSpan:1, - width: '20%', + width: '15%', classes: '', alignmentClasses: 'text-right justify-end', numFormat: styleFormat.name From fd27bc15e91481c57c6a3ab8ad8362e07c0b249f Mon Sep 17 00:00:00 2001 From: why-Mia Date: Mon, 15 Sep 2025 15:33:13 +0100 Subject: [PATCH 07/10] [WIP] support for separate mobile & desktop styling --- src/components/RecentTimes.vue | 10 --- src/components/TimeLists/TimesListItem.vue | 10 +-- .../TimeLists/TimesListItemContent.vue | 62 +++++++++++-------- 3 files changed, 38 insertions(+), 44 deletions(-) diff --git a/src/components/RecentTimes.vue b/src/components/RecentTimes.vue index aecea29..e274b97 100644 --- a/src/components/RecentTimes.vue +++ b/src/components/RecentTimes.vue @@ -31,7 +31,6 @@ label: 'Player', data: 'name', col:1, - colSpan:1, row:1, rowSpan:2, width: '20%', @@ -43,9 +42,7 @@ label: 'Map', data: 'map', col:2, - colSpan:1, row:1, - rowSpan:1, width: '35%', classes: 'text-gray-200', alignmentClasses: 'text-right justify-end md:justify-start md:text-left', @@ -55,9 +52,7 @@ label: 'Server', data: 'server', col:2, - colSpan:1, row:2, - rowSpan:1, classes: 'text-xs text-gray-400', alignmentClasses: 'justify-start text-left' }, @@ -65,7 +60,6 @@ label: 'Time', data: 'time', col:3, - colSpan:1, row:1, rowSpan:2, width: '30%', @@ -77,9 +71,7 @@ label: 'Style', data: 'style', col:4, - colSpan:1, row:1, - rowSpan:1, width: '15%', classes: '', alignmentClasses: 'text-right justify-end', @@ -89,9 +81,7 @@ label: 'Date', data: 'date', col:4, - colSpan:1, row:2, - rowSpan:1, classes: 'text-xs text-gray-400', alignmentClasses: 'text-right justify-end', numFormat: dateTimeFormats.date diff --git a/src/components/TimeLists/TimesListItem.vue b/src/components/TimeLists/TimesListItem.vue index 6ee0214..5f0192e 100644 --- a/src/components/TimeLists/TimesListItem.vue +++ b/src/components/TimeLists/TimesListItem.vue @@ -140,15 +140,7 @@ 'pb-2' : ''" @click="toggleDetails()" @contextmenu="handleRightClick"> -
- - - -
- -
-
+
diff --git a/src/components/TimeLists/TimesListItemContent.vue b/src/components/TimeLists/TimesListItemContent.vue index 3c5fb78..1884c61 100644 --- a/src/components/TimeLists/TimesListItemContent.vue +++ b/src/components/TimeLists/TimesListItemContent.vue @@ -13,6 +13,7 @@ time: Time, wrTime: Time | undefined, col: TimeListColumn, + key: number | string, }>(); const data = computed(()=>{ @@ -38,35 +39,46 @@ - \ No newline at end of file From 8b3188543a75d5cf3290b57d13917fece98b0f07 Mon Sep 17 00:00:00 2001 From: why-Mia Date: Wed, 17 Sep 2025 01:24:25 +0100 Subject: [PATCH 08/10] add separate time list cols/rows on mobile --- src/components/MapDetails.vue | 26 +++++++++++----- src/components/PlayerDetails.vue | 25 +++++++++++----- src/components/RecentTimes.vue | 19 +++++++++++- src/components/TimeLists/TimesListHeading.vue | 23 +++++++++++--- src/components/TimeLists/TimesListItem.vue | 30 ++++++++++++++----- ...temContent.vue => TimesListItemColumn.vue} | 21 ++++++++----- src/types/TimeListColumn.ts | 5 ++++ 7 files changed, 113 insertions(+), 36 deletions(-) rename src/components/TimeLists/{TimesListItemContent.vue => TimesListItemColumn.vue} (80%) diff --git a/src/components/MapDetails.vue b/src/components/MapDetails.vue index 6203947..fac011d 100644 --- a/src/components/MapDetails.vue +++ b/src/components/MapDetails.vue @@ -43,6 +43,8 @@ placement: true, width:'25%', col:1, + colMobile:1, + widthMobile:'40%', alignmentClasses: 'text-left', link: timeLinks.playerLink }, @@ -51,23 +53,31 @@ data: 'server', width: '30%', col:2, + colMobile:1, + rowMobile:2, classes: 'text-sm text-gray-400', alignmentClasses: 'text-left text-gray-300' }, - { - label: 'Date', - data: 'date', - width:'15%', - col:3, - alignmentClasses: 'text-right justify-end', - }, { label: 'Time', data: 'time', width: '30%', - col:4, + col:3, + colMobile:2, + colSpanMobile:2, + rowMobile:1, + widthMobile:'20%', alignmentClasses: 'text-right justify-end monospace', numFormat: dateTimeFormats.time + }, + { + label: 'Date', + data: 'date', + width:'15%', + col:4, + colMobile:3, + rowMobile:2, + alignmentClasses: 'text-right justify-end', }]" @refresh-data="() => emit('updateMap', props.mapName)" > diff --git a/src/components/PlayerDetails.vue b/src/components/PlayerDetails.vue index 301bb3c..11c12e8 100644 --- a/src/components/PlayerDetails.vue +++ b/src/components/PlayerDetails.vue @@ -164,6 +164,8 @@ data: 'map', width:'25%', col:1, + colMobile:1, + widthMobile:'35%', alignmentClasses: 'text-left', link: timeLinks.mapLink }, @@ -172,23 +174,30 @@ data: 'server', width: '30%', col:2, + colMobile:1, + rowMobile:2, classes: 'text-sm text-gray-400', alignmentClasses: 'text-left text-gray-300' }, - { - label: 'Date', - data: 'date', - width:'15%', - col:3, - alignmentClasses: 'text-right justify-end', - }, { label: 'Time', data: 'time', width: '30%', - col:4, + col:3, + colMobile:2, + colSpanMobile:2, + widthMobile:'20%', alignmentClasses: 'text-right justify-end monospace', numFormat: dateTimeFormats.time + }, + { + label: 'Date', + data: 'date', + width:'15%', + col:4, + colMobile:3, + rowMobile:2, + alignmentClasses: 'text-right justify-end', }]" @refresh-data="() => emit('updatePlayer', props.playerSteamId)" > diff --git a/src/components/RecentTimes.vue b/src/components/RecentTimes.vue index e274b97..e71b8f9 100644 --- a/src/components/RecentTimes.vue +++ b/src/components/RecentTimes.vue @@ -33,7 +33,10 @@ col:1, row:1, rowSpan:2, + colMobile: 1, + rowMobile: 1, width: '20%', + widthMobile:'30%', classes: 'font-semibold', alignmentClasses: 'text-left', link: timeLinks.playerLink @@ -43,9 +46,12 @@ data: 'map', col:2, row:1, + colMobile:1, + colSpanMobile:2, + rowMobile:2, width: '35%', classes: 'text-gray-200', - alignmentClasses: 'text-right justify-end md:justify-start md:text-left', + alignmentClasses: 'text-left justify-start', link: timeLinks.mapLink }, { @@ -53,6 +59,9 @@ data: 'server', col:2, row:2, + colMobile:1, + colSpanMobile:2, + rowMobile:3, classes: 'text-xs text-gray-400', alignmentClasses: 'justify-start text-left' }, @@ -62,7 +71,11 @@ col:3, row:1, rowSpan:2, + colMobile:2, + colSpanMobile:2, + rowMobile:1, width: '30%', + widthMobile: '20%', classes: 'monospace', alignmentClasses: 'text-right justify-end lg:text-left lg:justify-start lg:ml-12', numFormat: dateTimeFormats.time @@ -72,6 +85,8 @@ data: 'style', col:4, row:1, + colMobile:3, + rowMobile:2, width: '15%', classes: '', alignmentClasses: 'text-right justify-end', @@ -82,6 +97,8 @@ data: 'date', col:4, row:2, + colMobile:3, + rowMobile:3, classes: 'text-xs text-gray-400', alignmentClasses: 'text-right justify-end', numFormat: dateTimeFormats.date diff --git a/src/components/TimeLists/TimesListHeading.vue b/src/components/TimeLists/TimesListHeading.vue index d1cf9f1..125a222 100644 --- a/src/components/TimeLists/TimesListHeading.vue +++ b/src/components/TimeLists/TimesListHeading.vue @@ -5,7 +5,7 @@ cols: TimeListColumn[] }>(); - const totalCols = computed(()=>{ + const totalCols = computed(()=>{ return Math.max(...props.cols.map((v)=>{return v.col && v.colSpan ? v.col+v.colSpan : 1})); }) const totalRows = computed(()=>{ @@ -21,13 +21,28 @@ const rowWidthsStyle = computed(()=>{ return '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'; + }) + \ No newline at end of file diff --git a/src/types/TimeListColumn.ts b/src/types/TimeListColumn.ts index d09fe86..944aad6 100644 --- a/src/types/TimeListColumn.ts +++ b/src/types/TimeListColumn.ts @@ -8,7 +8,12 @@ export interface TimeListColumn { colSpan?:number, row?:number, rowSpan?:number, + colMobile?:number, + colSpanMobile?:number, + rowMobile?:number, + rowSpanMobile?:number, width?: string, + widthMobile?: string, classes?: string, alignmentClasses?: string, link?: ((value: Time) => string), From 22bcddd25064d7c4f27e4fb3f87f7f1458777628 Mon Sep 17 00:00:00 2001 From: why-Mia Date: Wed, 17 Sep 2025 22:14:51 +0100 Subject: [PATCH 09/10] adjust recent times column spacing --- src/components/RecentTimes.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/RecentTimes.vue b/src/components/RecentTimes.vue index e71b8f9..397c358 100644 --- a/src/components/RecentTimes.vue +++ b/src/components/RecentTimes.vue @@ -77,7 +77,7 @@ width: '30%', widthMobile: '20%', classes: 'monospace', - alignmentClasses: 'text-right justify-end lg:text-left lg:justify-start lg:ml-12', + alignmentClasses: 'text-right justify-end lg:text-left lg:justify-start lg:ml-16', numFormat: dateTimeFormats.time }, { From 96edf2e8009b55392f93705ab9989d6d154b9fb9 Mon Sep 17 00:00:00 2001 From: why-Mia Date: Wed, 17 Sep 2025 22:15:55 +0100 Subject: [PATCH 10/10] fix time list column headings on mobile --- src/components/TimeLists/TimesListHeading.vue | 13 +++++---- .../TimeLists/TimesListHeadingColumn.vue | 29 +++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 src/components/TimeLists/TimesListHeadingColumn.vue diff --git a/src/components/TimeLists/TimesListHeading.vue b/src/components/TimeLists/TimesListHeading.vue index 125a222..355d35d 100644 --- a/src/components/TimeLists/TimesListHeading.vue +++ b/src/components/TimeLists/TimesListHeading.vue @@ -1,5 +1,6 @@ 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