diff --git a/src/assets/logo.jpg b/public/logo.jpg similarity index 100% rename from src/assets/logo.jpg rename to public/logo.jpg diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/loader.gif b/src/assets/loader.gif new file mode 100644 index 0000000..cf57581 Binary files /dev/null and b/src/assets/loader.gif differ diff --git a/src/store/posts.js b/src/store/posts.js index 5767095..54dedac 100644 --- a/src/store/posts.js +++ b/src/store/posts.js @@ -11,6 +11,7 @@ export const usePostStore = defineStore('posts', { }), actions: { getAll() { + this.isLoading = true return fetch(`https://graph.facebook.com/v14.0/17841413817530260?fields=media%7Btimestamp%2C%20caption%2C%20id%2C%20%20thumbnail_url%7D&access_token=${import.meta.env.VITE_INSTAGRAM_ACCESS_TOKEN}`) .then(res => { return res.json(); @@ -35,6 +36,7 @@ export const usePostStore = defineStore('posts', { }) }, getOne(id) { + this.isLoading = true return fetch(`https://graph.facebook.com/v14.0/${id}?fields=caption%2Cthumbnail_url%2Ctimestamp&access_token=${import.meta.env.VITE_INSTAGRAM_ACCESS_TOKEN}`) .then(res => { return res.json(); diff --git a/src/style.css b/src/style.css index 9eff8fd..f328b90 100644 --- a/src/style.css +++ b/src/style.css @@ -331,6 +331,12 @@ a:focus { margin-bottom: var(--spacing-8); } +.loader { + display: flex; + justify-content: center; + align-items: center; +} + /* Media queries */ @media (max-width: 42rem) { diff --git a/src/views/BlogPost.vue b/src/views/BlogPost.vue index 56d6c41..30a8db7 100644 --- a/src/views/BlogPost.vue +++ b/src/views/BlogPost.vue @@ -22,11 +22,14 @@ watchEffect(