diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-12-29 22:56:11 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-12-29 23:37:37 +1100 |
| commit | 0d27e899cf580a90784a7ac929a027c456ef30b0 (patch) | |
| tree | f6f079db1a56bf52885bbb37a7f2a2d9981fc31b /src/components/TimeLine.vue | |
| parent | a3c5a73fae39de296cd05bde1a6853e20f84305a (diff) | |
Adjust event-count-indicator styling
Use solid color, and skip transitions on screen size change
Diffstat (limited to 'src/components/TimeLine.vue')
| -rw-r--r-- | src/components/TimeLine.vue | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue index d68cff0..5e52b9c 100644 --- a/src/components/TimeLine.vue +++ b/src/components/TimeLine.vue @@ -6,7 +6,7 @@ ref="rootRef"> <template v-if="store.showEventCounts"> <div v-for="[tickIdx, count] in tickToCount.entries()" :key="ticks[tickIdx].date.toInt()" - :style="countDivStyles(tickIdx, count)" class="absolute bg-yellow-300/30 animate-fadein"></div> + :style="countDivStyles(tickIdx, count)" class="absolute animate-fadein"></div> </template> <svg :viewBox="`0 0 ${width} ${height}`" class="relative z-10"> <defs> @@ -278,7 +278,7 @@ const ticks = computed((): Tick[] => { let numUnits = getNumDisplayUnits(); let majorUnitSz = availLen.value / numUnits; // Get before-startDate ticks (including start-offset ticks and hidden ticks) - let panUnits = Math.floor(getNumDisplayUnits() * store.scrollRatio); // Potential shift distance upon a pan action + let panUnits = Math.floor(numUnits * store.scrollRatio); // Potential shift distance upon a pan action let date = startDate.value; for (let i = 0; i < panUnits + Math.ceil(startOffset.value); i++){ if (MIN_DATE.equals(date, scale.value)){ @@ -1154,11 +1154,12 @@ function countDivStyles(tickIdx: number, count: number): Record<string,string> { let countLevel = Math.min(Math.ceil(Math.log10(count+1)), 4); let breadth = countLevel * 4 + 4; return { + backgroundColor: store.color.altBg, top: props.vert ? pxOffset + 'px' : (mainlineOffset.value - breadth / 2) + 'px', left: props.vert ? (mainlineOffset.value - breadth / 2) + 'px' : pxOffset + 'px', width: props.vert ? breadth + 'px' : len + 'px', height: props.vert ? len + 'px' : breadth + 'px', - transitionProperty: 'top, left, width, height', + transitionProperty: skipTransition.value ? 'none' : 'top, left, width, height', transitionDuration: store.transitionDuration + 'ms', transitionTimingFunction: 'linear', } |
