Skip to content

Commit 7b7692e

Browse files
adding transtion in vue
1 parent d5e4247 commit 7b7692e

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

src/components/Extra.vue

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,14 @@
239239
height: 100%;
240240
"
241241
></canvas>
242-
<div id="miniMap">
243-
<canvas
244-
id="miniMapArea"
245-
style="position: absolute; left: 0; top: 0; z-index: 3"
246-
></canvas>
247-
</div>
248-
242+
<transition>
243+
<div id="miniMap" style="height: 253px; width: 255px">
244+
<canvas
245+
id="miniMapArea"
246+
style="position: absolute; left: 0; top: 0; z-index: 3"
247+
></canvas>
248+
</div>
249+
</transition>
249250
<div id="Help"></div>
250251
<div
251252
class="sk-folding-cube loadingIcon"
@@ -320,4 +321,16 @@ import CustomShortcut from './DialogBox/CustomShortcut.vue'
320321
import InsertSubcircuit from './DialogBox/InsertSubcircuit.vue'
321322
import OpenOffline from './DialogBox/OpenOffline.vue'
322323
import ReportIssue from './ReportIssue/ReportIssue.vue'
323-
</script>
324+
</script>
325+
326+
<style>
327+
.v-enter-active,
328+
.v-leave-active {
329+
transition: opacity 0.8s linear;
330+
display: none;
331+
}
332+
333+
.v-leave-to {
334+
opacity: 0;
335+
}
336+
</style>

src/simulator/src/minimap.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export default miniMapArea = {
166166
},
167167
clear() {
168168
if (lightMode) return
169-
document.querySelector('#miniMapArea').style.zIndex = '-1';
169+
document.getElementById('miniMapArea').style.zIndex = '-1';
170170
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height)
171171
},
172172
}
@@ -189,7 +189,4 @@ export function removeMiniMap() {
189189
)
190190
return
191191
}
192-
let miniMap = document.getElementById('miniMap');
193-
miniMap.style.transition = 'opacity 0.2s';
194-
miniMap.style.opacity = '0';
195192
}

0 commit comments

Comments
 (0)