Skip to content

Commit c13ce3b

Browse files
committed
Switch to static imports for card images
1 parent 09423c2 commit c13ce3b

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/assets/logo.png

-120 KB
Binary file not shown.

src/components/ProjectCard.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
22
<div class="project">
33
<h1 class="project-title">{{ title }}</h1>
4-
<img class="project-image" :alt="title" :src="imageUrl">
4+
<img class="project-image" :alt="title" :src="image">
55
<p class="project-text"><slot /></p>
66
</div>
77
</template>
88

99
<script setup>
10-
const props = defineProps({
10+
defineProps({
1111
title: {
1212
type: String,
1313
required: true
@@ -17,8 +17,6 @@ const props = defineProps({
1717
required: true
1818
}
1919
})
20-
21-
const imageUrl = new URL(props.image, import.meta.url).href
2220
</script>
2321

2422
<style scoped>

src/components/Projects.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
22
<div class="container">
3-
<ProjectCard title="Weather Station" image="../assets/weather_station.png">
3+
<ProjectCard title="Weather Station" :image="weatherStationUrl">
44
This is our <a href="https://weather.codihacks.org/" target="_blank">weather station</a> web app project!
55
It features a physical weather station, an API server written in Rust, and a web app frontend written in Vue.
66

77
</ProjectCard>
8-
<ProjectCard title="Space Race" image="../assets/space_race.png">
8+
<ProjectCard title="Space Race" :image="spaceRaceUrl">
99
This is our Spaceship Race project! It is a spaceship game created with the Lua framework <a href="https://love2d.org/" target="_blank">Love2D</a>.
1010
It lacks levels, so if you are interested in helping, please open an issue on our GitHub.
1111
</ProjectCard>
@@ -14,6 +14,8 @@
1414

1515
<script setup>
1616
import ProjectCard from './ProjectCard.vue'
17+
import weatherStationUrl from '../assets/weather_station.png'
18+
import spaceRaceUrl from '../assets/space_race.png'
1719
</script>
1820

1921
<style scoped>

vite.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { defineConfig } from "vite";
2-
import vue from "@vitejs/plugin-vue";
1+
import { defineConfig } from 'vite'
2+
import vue from '@vitejs/plugin-vue'
33

44
export default defineConfig({
55
plugins: [
66
vue({
77
template: {
8-
compilerOptions: {},
9-
},
10-
}),
11-
],
12-
});
8+
compilerOptions: {}
9+
}
10+
})
11+
]
12+
})

0 commit comments

Comments
 (0)