diff options
-rw-r--r-- | src/css/dumbymap.css | 15 | ||||
-rw-r--r-- | src/dumbyUtils.mjs | 5 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/css/dumbymap.css b/src/css/dumbymap.css index e87e228..f4abaad 100644 --- a/src/css/dumbymap.css +++ b/src/css/dumbymap.css | |||
@@ -101,12 +101,17 @@ | |||
101 | left: 0.8rem; | 101 | left: 0.8rem; |
102 | 102 | ||
103 | border-left: 0.5em solid #e0e0e0; | 103 | border-left: 0.5em solid #e0e0e0; |
104 | transition: border-color .5s linear; | ||
104 | } | 105 | } |
105 | 106 | ||
106 | &.focus { | 107 | &.focus { |
107 | background: var(--block-focus-color); | 108 | /* background: var(--block-focus-color); */ |
109 | &::before { | ||
110 | border-color: chocolate; | ||
111 | } | ||
108 | 112 | ||
109 | &::after { | 113 | &::after { |
114 | z-index: 9999; | ||
110 | content: counter(block) "/" attr(data-total); | 115 | content: counter(block) "/" attr(data-total); |
111 | padding: .3rem .5rem; | 116 | padding: .3rem .5rem; |
112 | 117 | ||
@@ -126,7 +131,7 @@ | |||
126 | font-weight: bold; | 131 | font-weight: bold; |
127 | 132 | ||
128 | opacity: 0; | 133 | opacity: 0; |
129 | animation: 1s forwards fade-out cubic-bezier(.44,.18,.86,-0.21); | 134 | animation: 1.5s forwards fade-out cubic-bezier(.44,.18,.86,-0.21); |
130 | } | 135 | } |
131 | } | 136 | } |
132 | } | 137 | } |
@@ -400,9 +405,9 @@ | |||
400 | background: linear-gradient(0deg, rgb(255 255 255 / 0%), white 60%); | 405 | background: linear-gradient(0deg, rgb(255 255 255 / 0%), white 60%); |
401 | } | 406 | } |
402 | 407 | ||
403 | &.focus::before { | 408 | /* &.focus::before { */ |
404 | background: linear-gradient(0deg, rgb(255 255 255 / 0%), var(--block-focus-color) 60%); | 409 | /* background: linear-gradient(0deg, rgb(255 255 255 / 0%), var(--block-focus-color) 60%); */ |
405 | } | 410 | /* } */ |
406 | 411 | ||
407 | .map-container { | 412 | .map-container { |
408 | min-width: 200px; | 413 | min-width: 200px; |
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs index ba0bbf8..fc9eab9 100644 --- a/src/dumbyUtils.mjs +++ b/src/dumbyUtils.mjs | |||
@@ -49,7 +49,10 @@ export function focusNextBlock(reverse = false) { | |||
49 | const nextBlock = blocks[nextIndex] | 49 | const nextBlock = blocks[nextIndex] |
50 | blocks.forEach(b => b.classList.remove('focus')) | 50 | blocks.forEach(b => b.classList.remove('focus')) |
51 | nextBlock?.classList?.add('focus') | 51 | nextBlock?.classList?.add('focus') |
52 | nextBlock.scrollIntoView({ behavior: 'smooth', block: "nearest" }) | 52 | const scrollBlock = nextBlock.getBoundingClientRect().height > nextBlock.parentElement.getBoundingClientRect().height * 0.8 |
53 | ? 'nearest' | ||
54 | : 'center' | ||
55 | nextBlock.scrollIntoView({ behavior: 'smooth', block: scrollBlock }) | ||
53 | } | 56 | } |
54 | 57 | ||
55 | export function removeBlockFocus() { | 58 | export function removeBlockFocus() { |