Skip to content

Commit

Permalink
Move images to assets directory for better control of them during rou…
Browse files Browse the repository at this point in the history
…ting
  • Loading branch information
nanoandrew4 committed Mar 26, 2024
1 parent 808cde5 commit 92498b6
Show file tree
Hide file tree
Showing 21 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

public/*.png
public/**/*.png

node_modules
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion generate_images.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

for pngImage in $(ls public/*png); do
for pngImage in $(ls public/assets/*png); do
convert -resize 15% -quality 100 -antialias $pngImage $(echo $pngImage | sed 's~.png~_high.webp~')
convert -resize 10% -quality 100 -antialias $pngImage $(echo $pngImage | sed 's~.png~_mid.webp~')
convert -resize 7.5% -quality 90 -antialias $pngImage $(echo $pngImage | sed 's~.png~_low.webp~')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 11 additions & 9 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
href="/create"
>{{ $t('home.button-text') }}</v-btn
>
<p :class="'subtext' + (areImagesLoaded ? '' : '--faded')">
<p :class="'subtext' + (showSubtext ? '' : '--faded')">
{{ $t('home.subtext') }}
<a href="https://github.com/nanoandrew4/adventure-tracks">{{ $t('home.source-code') }}</a>
</p>

</div>

<Carousel3d
Expand Down Expand Up @@ -82,15 +81,15 @@ export default defineComponent({
this.loadedImagesSet.clear()
if (this.isPortrait) {
this.carouselImages = [
this.getScaledImage('/sample_vert_1.png'),
this.getScaledImage('/sample_vert_2.png'),
this.getScaledImage('/sample_vert_3.png')
this.getScaledImage('/assets/sample_vert_1.png'),
this.getScaledImage('/assets/sample_vert_2.png'),
this.getScaledImage('/assets/sample_vert_3.png')
]
} else {
this.carouselImages = [
this.getScaledImage('/sample_hor_1.png'),
this.getScaledImage('/sample_hor_2.png'),
this.getScaledImage('/sample_hor_3.png')
this.getScaledImage('/assets/sample_hor_1.png'),
this.getScaledImage('/assets/sample_hor_2.png'),
this.getScaledImage('/assets/sample_hor_3.png')
]
}
}
Expand All @@ -102,6 +101,9 @@ export default defineComponent({
areImagesLoaded(): boolean {
return this.loadCarousel && this.loadedImagesSet.size == this.carouselImages.length
},
showSubtext(): boolean {
return this.areImagesLoaded && document.documentElement.clientWidth < document.documentElement.clientHeight *2
},
slideWidth(): number {
if (this.isPortrait) {
return document.documentElement.clientWidth * 0.55
Expand Down Expand Up @@ -198,7 +200,7 @@ h1 {
.main-text--bottom {
display: block;
top: calc(85%);
top: calc(80%);
}
@media (max-width: 768px) {
Expand Down

0 comments on commit 92498b6

Please sign in to comment.