migracja assetów

This commit is contained in:
2023-10-04 17:30:30 +02:00
parent 085238fada
commit 12ece46089
86 changed files with 91 additions and 176 deletions
-13
View File
@@ -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;
}
}
});
-34
View File
@@ -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 -4
View File
@@ -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';
}
}
});