Changeset 35779
- Timestamp:
- 2021-12-09T13:18:40+13:00 (2 years ago)
- Location:
- main/trunk/model-interfaces-dev/atea/ocr/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/ocr/src/components/OcrImageDisplay.vue
r35776 r35779 13 13 /** @type {DOMRect} */ 14 14 magnifierBounds: null, 15 magnifierZoom: 1.5 15 magnifierZoom: 1.5, 16 showControls: false, 17 enableMagnifier: false 16 18 } 17 19 }, … … 91 93 // Convert the offset to valid CSS values 92 94 const actualX = imageX < 0 93 ? "0"95 ? `${(imageX * this.magnifierZoom * -1)}px` 94 96 : `-${(imageX * this.magnifierZoom)}px` 95 97 96 98 const actualY = imageY < 0 97 ? "0"99 ? `${(imageY * this.magnifierZoom * -1)}px` 98 100 : `-${(imageY * this.magnifierZoom)}px` 99 101 … … 147 149 } 148 150 }, 100); 151 }, 152 magnifierZoom() { 153 if (this.showThresholdedImage) { 154 this.updateMagnifier(this.$refs.thresholdedImage); 155 } 156 else { 157 this.updateMagnifier(this.$refs.ocrImage); 158 } 149 159 } 150 160 }, … … 160 170 <template> 161 171 <div ref="magContainer" class="ocr-image-container"> 162 <div ref="magnifier" class="magnifier" @mousemove="moveMagnifier" />172 <div ref="magnifier" class="magnifier" @mousemove="moveMagnifier" :style="{ 'visibility': enableMagnifier ? 'visible' : 'collapse' }" /> 163 173 <img ref="ocrImage" class="ocr-image" :src="imageUrl" /> 164 174 <img v-if="showThresholdedImage" ref="thresholdedImage" class="ocr-image" :src="thresholdedImageUrl" /> 165 175 166 <div v-if="thresholdedImageUrl" class="thresholded-image-controls card"> 167 <input id="chk-show-thresholded-image" type="checkbox" v-model="showThresholdedImage" /> 168 <label for="chk-show-thresholded-image">{{ translations.get('MainPage_ShowThresholdedImage') }}</label> 169 170 <span class="body2">{{ translations.get('MainPage_ThresholdedImageDescription') }}</span> 176 <button class="control-tip btn-fab" @click="showControls = !showControls"> 177 <span class="material-icons mdi-l">settings</span> 178 </button> 179 180 <div v-if="showControls" class="controls card"> 181 <button class="spacer btn-fab"> 182 <span class="material-icons mdi-l">settings</span> 183 </button> 184 185 <div class="flex-h"> 186 <input id="chk-enable-magnifier" type="checkbox" v-model="enableMagnifier" /> 187 <label for="chk-enable-magnifier">{{ translations.get('OcrImageDisplay_EnableMagnifier') }}</label> 188 </div> 189 190 <div class="flex-h"> 191 <span>1.5x</span> 192 <input :disabled="!enableMagnifier" type="range" min="1.5" max="3" step="0.1" v-model="magnifierZoom" /> 193 <span>3x</span> 194 </div> 195 196 <div v-if="thresholdedImageUrl" class="flex-h"> 197 <input id="chk-show-thresholded-image" type="checkbox" v-model="showThresholdedImage" /> 198 <label for="chk-show-thresholded-image">{{ translations.get('OcrImageDisplay_ShowThresholdedImage') }}</label> 199 </div> 200 201 <span v-if="thresholdedImageUrl" class="body2">{{ translations.get('OcrImageDisplay_ThresholdedImageDescription') }}</span> 171 202 </div> 172 203 </div> … … 187 218 188 219 &:hover { 189 .thresholded-image-controls { 190 opacity: 0.99; 220 .control-tip { 221 opacity: 1; 222 } 223 224 .controls { 225 opacity: 1; 191 226 } 192 227 } … … 202 237 } 203 238 204 . thresholded-image-controls{239 .control-tip { 205 240 position: absolute; 206 top: 1em; 207 left: 1em; 241 top: 0.5em; 242 left: 0.5em; 243 244 opacity: 0; 245 z-index: 3; 246 } 247 248 .controls { 249 position: absolute; 250 left: 0.2em; 251 top: 0.2em; 208 252 max-width: 50%; 209 253 210 display: grid; 211 grid-template-columns: auto 1fr; 212 grid-template-rows: auto auto; 213 align-items: center; 214 justify-items: start; 254 display: flex; 255 flex-direction: column; 215 256 gap: 0.5em; 216 257 217 258 transition-duration: var(--transition-duration); 218 259 opacity: 0; 260 z-index: 2; 261 262 .spacer { 263 visibility: hidden; 264 } 219 265 220 266 span { … … 228 274 height: 175px; 229 275 276 background-color: white; 230 277 background-repeat: no-repeat; 231 278 border: 2px solid #000; -
main/trunk/model-interfaces-dev/atea/ocr/src/styles/_material.scss
r35751 r35779 460 460 } 461 461 462 /* Helpers */ 463 464 .flex-h { 465 display: flex; 466 align-items: center; 467 gap: 0.5em; 468 } 469 462 470 /* === Start Theme Definitions === */ 463 471
Note:
See TracChangeset
for help on using the changeset viewer.