mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
migracja assetów
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
methods: {
|
||||
getIcon(name: string, ext = 'svg') {
|
||||
return new URL(`../assets/icon-${name}.${ext}`, import.meta.url).href;
|
||||
},
|
||||
|
||||
getImage(name: string) {
|
||||
return new URL(`../assets/${name}`, import.meta.url).href;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1,34 +0,0 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import imageMixin from './imageMixin';
|
||||
|
||||
export default defineComponent({
|
||||
mixins: [imageMixin],
|
||||
|
||||
data() {
|
||||
return {
|
||||
icons: {
|
||||
arrow: this.getIcon('arrow-asc')
|
||||
},
|
||||
|
||||
showReturnButton: false
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
scrollToTop() {
|
||||
window.scrollTo({ top: 0 });
|
||||
},
|
||||
|
||||
handleScroll() {
|
||||
this.showReturnButton = window.scrollY > window.innerHeight * 0.35;
|
||||
}
|
||||
},
|
||||
|
||||
activated() {
|
||||
window.addEventListener('wheel', this.handleScroll);
|
||||
},
|
||||
|
||||
deactivated() {
|
||||
window.removeEventListener('wheel', this.handleScroll);
|
||||
}
|
||||
});
|
||||
@@ -1,11 +1,8 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import Train from '../scripts/interfaces/Train';
|
||||
import TrainStop from '../scripts/interfaces/TrainStop';
|
||||
import imageMixin from './imageMixin';
|
||||
|
||||
export default defineComponent({
|
||||
mixins: [imageMixin],
|
||||
|
||||
data: () => ({
|
||||
STATS: {
|
||||
main: [
|
||||
@@ -155,7 +152,7 @@ export default defineComponent({
|
||||
|
||||
onImageError(e: Event) {
|
||||
const imageEl = e.target as HTMLImageElement;
|
||||
imageEl.src = this.getImage('unknown.png');
|
||||
imageEl.src = '/images/icon-unknown.png';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user