2022-07-31 12:33:10 -06:00
|
|
|
<template>
|
2022-08-02 15:00:04 -06:00
|
|
|
<!-- TODO add masonry later -->
|
|
|
|
|
<div class="container-fluid px-md-5 pt-4">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div v-for="k in keeps" :key="k.id" class="col-6 col-md-4 col-lg-3 p-2">
|
|
|
|
|
<!-- <img src="../assets/img/404.svg" alt=""> TODO use this as default img in DB-->
|
|
|
|
|
<KeepTile :keep="k" />
|
|
|
|
|
</div>
|
2022-07-31 12:33:10 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-08-02 15:00:04 -06:00
|
|
|
import { computed, onMounted, ref } from 'vue'
|
|
|
|
|
import { AppState } from '../AppState.js'
|
|
|
|
|
import { logger } from '../utils/Logger.js'
|
|
|
|
|
import { keepsService } from '../services/KeepsService.js'
|
2022-07-31 12:33:10 -06:00
|
|
|
export default {
|
2022-08-02 15:00:04 -06:00
|
|
|
name: 'Home',
|
|
|
|
|
setup() {
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
try {
|
|
|
|
|
await keepsService.GetAll()
|
|
|
|
|
} catch (error) {
|
|
|
|
|
logger.error(error)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
keeps: computed(() => AppState.keeps)
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-31 12:33:10 -06:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.home{
|
|
|
|
|
display: grid;
|
|
|
|
|
height: 80vh;
|
|
|
|
|
place-content: center;
|
|
|
|
|
text-align: center;
|
|
|
|
|
user-select: none;
|
|
|
|
|
.home-card{
|
|
|
|
|
width: 50vw;
|
|
|
|
|
> img{
|
|
|
|
|
height: 200px;
|
|
|
|
|
max-width: 200px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
object-fit: contain;
|
|
|
|
|
object-position: center;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-02 15:00:04 -06:00
|
|
|
</style>
|