Skip to content

Commit

Permalink
Resolve performance issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AE517 committed Nov 12, 2024
1 parent 4021085 commit 1aac1aa
Show file tree
Hide file tree
Showing 6 changed files with 1,132 additions and 1,213 deletions.
6 changes: 3 additions & 3 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- <div v-if="loading" class="fixed flex justify-center align-center items-center left-0 top-0 h-full w-full bg-dsotm"> -->
<!-- <img src="/static/G.svg" alt="G.svg" class="size-1/4" /> -->
<!-- </div> -->

<NuxtLayout>
<NuxtPage class="size-full p-2" />
</NuxtLayout>
Expand All @@ -24,7 +24,8 @@ useSeoMeta({
twitterTitle: 'Guilherme Araujo',
twitterDescription: 'Guilherme Araujo - Web Developer',
twitterImage: '/G.svg',
twitterCard: 'Guilherme Araujo\'s Homepage',
twitterCard: "Guilherme Araujo's Homepage",
ogUrl: 'guilherme-homepage.pages.dev',
});
// const nuxtApp = useNuxtApp();
Expand All @@ -36,5 +37,4 @@ useSeoMeta({
// nuxtApp.hook("page:finish", () => {
// loading.value = false;
// })
</script>
10 changes: 8 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { defineNuxtConfig } from 'nuxt/config';

export default defineNuxtConfig({
ssr: false,
devtools: { enabled: true },
devtools: {
enabled: true,

timeline: {
enabled: true,
},
},
modules: ['@nuxtjs/tailwindcss', 'nuxt-icon', '@nuxtjs/mdc', '@nuxt/image'],

image: {
Expand Down Expand Up @@ -35,4 +41,4 @@ export default defineNuxtConfig({
},

compatibilityDate: '2024-10-17',
});
});
11 changes: 7 additions & 4 deletions pages/about.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@
<section class="whoami col-span-1 md:col-span-2">
<div class="flex flex-col justify-center gap-y-10">
<section id="about-me" class="flex animate-fade-left flex-col justify-center gap-y-5 animate-delay-500">
<h1
class="border-b-2 border-sundress text-center font-oxanium text-5xl font-semibold uppercase md:w-[300px] lg:text-left lg:capitalize"
<h1
class="flex flex-row justify-between border-b-2 border-sundress text-center font-oxanium text-5xl font-semibold uppercase md:w-[350px] lg:text-left lg:capitalize"
>
Who am I? <a href="/files/curr.pdf" target="_blank" download="guilherme-araujo.pdf"><Icon name="mdi:file-download" color="#EBCA89" size="50" class="mb-2"/></a>
</h1>
Who am I?
<a href="/files/curr.pdf" target="_blank" download="guilherme-araujo.pdf"
><Icon name="mdi:file-download" color="#EBCA89" size="50" class="mb-2"
/></a>
</h1>
<p class="text-justify text-lg lg:text-xl">
I&apos;m a <strong class="text-sundress"> Web Developer</strong> and
<strong class="text-sundress">Pixel Artist</strong> based in Brazil. With a passion for arts, games and
Expand Down
23 changes: 14 additions & 9 deletions pages/projects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
<section class="project-view">
<div class="projects-container">
<header class="my-8 text-center font-oxanium text-6xl font-bold tracking-wider lg:text-7xl">PROJECTS</header>
<div class="grid size-full grid-cols-1 justify-center gap-3 lg:grid-cols-2">
<GithubCard
v-for="(repo, index) in repositories"
:repo="repo"
class="animate-fade-up animate-delay-1000"
/>
<div v-fi="loaded" class="grid size-full grid-cols-1 justify-center gap-3 lg:grid-cols-2">
<GithubCard v-for="(repo, index) in repositories" :repo="repo" class="animate-fade-up animate-delay-1000" />
</div>
</div>
</section>
Expand All @@ -18,13 +14,22 @@
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue';
import githubApi, { Repo } from '../utils/githubApi';
definePageMeta({
layout: 'content',
});
const githubResponse: Array<object> = await githubApi();
const repositories: Array<object> = githubResponse.filter((item: any) => {
if (item.name !== 'Guilherme-HJA') return item; // Github Config ignore
const loaded = ref(false);
const repositories = ref();
const githubRes: Array<object> = await githubApi();
onMounted(async () => {
repositories.value = githubRes.filter((item: any) => {
if (item.name !== 'Guilherme-HJA') return item;
});
loaded.value = !loaded.value;
});
</script>

Expand Down
4 changes: 2 additions & 2 deletions utils/githubApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { Octokit } from 'octokit';

const octokit = new Octokit({});
//Github API returns a large quantity of data, this aims to use only the necessary for the 'projects' page,
interface Repo {
export type Repo = {
name: string;
url: string;
description: string;
homepage?: string; //Optional | On empty returns ''
language: string;
topics: Array<object>;
}
};

export default async function () {
const response = await octokit.request('GET /users/{username}/repos', {
Expand Down
Loading

0 comments on commit 1aac1aa

Please sign in to comment.