Skip to content

Commit

Permalink
Merge pull request #3 from MacKey-255/develop
Browse files Browse the repository at this point in the history
Working in Home page
  • Loading branch information
MacKey-255 authored Jul 23, 2023
2 parents 6b5619b + fa18a61 commit e34e722
Show file tree
Hide file tree
Showing 17 changed files with 206 additions and 58 deletions.
13 changes: 3 additions & 10 deletions components/AppFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@

<style scoped>
footer {
width: 100%;
height: 24px;
position: fixed;
bottom: 0;
left: calc(50% - 132px);
z-index: 5;
}
footer p {
width: 320px;
margin: 0 auto;
text-align: center;
/*border-radius: 15px 15px 0 0;*/
/*background: linear-gradient(135deg, #9a0dfe, #637dfb);*/
/*box-shadow: 0 2px 12px 0 rgba(91, 41, 191, 0.5);*/
}
</style>
6 changes: 3 additions & 3 deletions components/AppMenu.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<nav class="navbar dark:text-white">
<div class="menu">
<div class="menu md:rounded-lg bg-slate-300/[0.8] dark:bg-slate-600/[0.8]">
<input class="menu_input" id="btn1" name="menu" type="radio" value="1" :checked="activePage === 1"
@input="updateActivePage" />
<div class="menu_contain">
Expand All @@ -18,7 +18,7 @@
<label class="menu_label" for="btn2">
<font-awesome-icon icon="address-card" class="fa-icon"></font-awesome-icon>
<span class="menu_text">
{{ $t('about') }}
{{ $t('skills') }}
</span>
</label>
</div>
Expand Down Expand Up @@ -93,6 +93,7 @@ export default {
}
.menu {
position: relative;
padding: 8px;
}
.menu:hover .menu_text {
display: block;
Expand Down Expand Up @@ -172,7 +173,6 @@ export default {
}
.menu {
display: flex;
margin: 8px;
}
.menu_contain {
flex-grow: 1;
Expand Down
5 changes: 3 additions & 2 deletions components/Particles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default {
/* set size canvas */
canvas_el.style.width = "100%";
canvas_el.style.height = "calc(100% - 6px)";
canvas_el.style.height = "100%";
/* append canvas */
const canvas = particlesDiv.appendChild(canvas_el);
Expand Down Expand Up @@ -77,8 +77,9 @@ export default {
</script>

<style scoped>
.particles {
position: absolute;
position: fixed;
left: 0;
top: 0;
z-index: -1;
Expand Down
122 changes: 111 additions & 11 deletions components/tabs/Home.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,123 @@
<template>
<div class="mx-auto">
<page-header icon="house" title="home" />
<div class="text-center">
<img
:src="require('@/assets/images/profile.jpg')"
class="mx-auto mb-4 w-32 rounded-lg"
alt="Avatar" />
<h5 class="mb-2 text-xl dark:text-white font-medium leading-tight">Michel Suárez</h5>
<p class="text-neutral-500 dark:text-neutral-400">Full Stack web developer</p>
<div class="grid gap-x-10 md:grid-cols-3 mt-2">
<div class="md:col-span-1 justify-self-center md:justify-self-start md:order-2">
<div class="mb-4">
<img
:src="require('@/assets/images/profile.jpg')"
class="img-avatar rounded-t-xl justify-self-center"
alt="Avatar" />
<div
class="flex justify-center gap-4 p-2 rounded-b-lg bg-slate-300/[0.8] text-gray-800 dark:text-gray-200 dark:bg-slate-600/[0.8]">
<a
class="transition ease-in-out hover:scale-150 hover:-translate-y-1 duration-150"
:href="$store.getters.LINKEDIN_PROFILE_URL"
target="_blank"
aria-label="linkedin url"
rel="noreferrer">
<font-awesome-icon :icon="['fab', 'linkedin']" />
</a>

<a
class="transition ease-in-out hover:scale-150 hover:-translate-y-1 duration-150"
:href="$store.getters.GITHUB_PROFILE_URL"
target="_blank"
rel="noreferrer"
aria-label="github url">
<font-awesome-icon :icon="['fab', 'github']" />
</a>

<a
class="transition ease-in-out hover:scale-150 hover:-translate-y-1 duration-150"
:href="get_email"
target="_blank"
rel="noreferrer"
aria-label="send email">
<font-awesome-icon icon="envelope" />
</a>

<a
class="transition ease-in-out hover:scale-150 hover:-translate-y-1 duration-150"
href="/cv/es/portfolio.pdf"
target="_blank"
rel="noreferrer"
aria-label="download cv"
download>
<font-awesome-icon :icon="['fas', 'file-lines']" />
</a>
</div>
</div>
</div>

<div class="md:col-span-2 justify-self-center md:justify-self-end md:order-1">
<h1 class="md:text-right text-4xl dark:text-white font-medium">Michel Suárez</h1>
<p class="text-md mb-1 text-justify text-blue-800 dark:text-blue-200 max-w-xl mx-auto md:text-x md:text-right">
<vue-typer
:text='$t("profile_profession")'
:repeat='Infinity'
:shuffle='false'
initial-action='typing'
:pre-type-delay='70'
:type-delay='70'
:pre-erase-delay='2000'
:erase-delay='250'
erase-style='select-all'
:erase-on-complete='false'
caret-animation='blink'
></vue-typer>
</p>
<p class="text-sm text-justify text-gray-800 dark:text-gray-200 max-w-xl mx-auto md:text-xl dark:text-white">
{{ $t('profile_description') }}
</p>
<div class="flex mt-2 justify-center md:justify-end">
<button class="btn-more bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full"
@click="updateActivePage(2)">
<span class="mr-2">{{ $t('see_more') }}</span>
<font-awesome-icon icon="arrow-right" />
</button>
</div>
</div>
</div>
</template>

<script>
export default {
name: "Home"
name: "Home",
props: {
activePage: Number,
},
computed: {
get_email() {
let subject = 'Oferta%20de%20trabajo';
if (this.$i18n.locale === 'en') {
subject = 'Work%20offer';
}
return 'mailto:' + this.$store.getters.EMAIL + '?Subject=' + subject;
}
},
methods: {
updateActivePage(page) {
this.$emit('update:activePage', page);
}
},
}
</script>

<style scoped>
<style>
.vue-typer .custom.char {
color: #3b82f6;
font-weight: bold;
}
.img-avatar {
width: 250px;
height: 250px;
}
.btn-more {
margin-top: -15px;
}
@media only screen and (max-device-width: 640px) {
.btn-more {
margin-top: 0;
}
}
</style>
4 changes: 2 additions & 2 deletions components/tabs/About.vue → components/tabs/Skills.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<div class="mx-auto">
<page-header icon="address-card" title="about" />
<page-header icon="address-card" title="skills" />
</div>
</template>

<script>
export default {
name: "About"
name: "Skills"
}
</script>

Expand Down
10 changes: 3 additions & 7 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class="container mx-auto" :class="darkClass">
<div :class="darkClass">
<particles :is-dark-mode="isDarkMode" />
<AppMenu :activePage.sync="activePage" />

<div class="content">
<NuxtChild :activePage="activePage" />
<div class="container px-4 md:mx-auto">
<NuxtChild :activePage.sync="activePage" />
</div>
<AppFooter />
</div>
Expand Down Expand Up @@ -40,7 +40,3 @@ export default {
}
}
</script>

<style scoped>
</style>
5 changes: 4 additions & 1 deletion locales/en-US.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
export default {
home: 'Home',
projects: 'Projects',
about: 'About us',
skills: 'Skills',
contact: 'Contact',
language: 'Language',
dark_mode: 'Dark mode',
see_more: 'See more',
profile_profession: ['Full Stack Web developer', 'Software Engineer', 'Backend developer'],
profile_description: 'I\'m a experienced Software Engineer adept in bringing forth expertise in design, installation, testing and maintenance of software systems. Proficient in various frameworks (FastAPI/Django/Flask), languages (Python/C#/Java), and embedded systems. Able to effectively self-manage during independent projects, as well as collaborate as part of a productive team.',
};
5 changes: 4 additions & 1 deletion locales/es-ES.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
export default {
home: 'Principal',
projects: 'Proyectos',
about: 'Sobre mi',
skills: 'Habilidades',
contact: 'Contacto',
language: 'Lenguaje',
dark_mode: 'Temas',
see_more: 'Ver más',
profile_profession: ['Desarrollador Web Full Stack', 'Ingeniero de Software', 'Desarrollador Backend'],
profile_description: 'Soy un ingeniero de software con experiencia en diseño, codificación, prueba y mantenimiento de sistemas de software. Competente en varios frameworks (Django/FastAPI/Flask), lenguajes (Python/C#/Java) y sistemas embebidos. Capaz de autogestionar mi tiempo de manera efectiva durante los proyectos independientes, así como colaborar formando parte de un equipo de desarrollo.',
};
2 changes: 2 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export default {

// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
'~/plugins/vue-typer.client.js',
'~/plugins/route-lang.js',
'~/plugins/fontawesome.js'
],

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"nuxt": "^2.15.8",
"vue": "^2.7.10",
"vue-server-renderer": "^2.7.10",
"vue-template-compiler": "^2.7.10"
"vue-template-compiler": "^2.7.10",
"vue-typer": "^1.2.0"
},
"devDependencies": {
"@fortawesome/fontawesome-svg-core": "^6.4.0",
Expand Down
49 changes: 31 additions & 18 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<template>
<main class="tab-content">
<Home v-if="isActive(1)" />
<About v-else-if="isActive(2)" />
<Portfolio v-else-if="isActive(3)" />
<Contact v-else-if="isActive(4)" />
<div v-else>Nothing</div>
<main class="tab-content flex items-center md:h-screen">
<div class="mx-auto">
<Home :activePage.sync="actualActivePage" v-if="isActive(1)" />
<Skills v-else-if="isActive(2)" />
<Portfolio v-else-if="isActive(3)" />
<Contact v-else-if="isActive(4)" />
<div v-else>Nothing</div>
</div>
</main>
</template>

<script>
import Home from "@/components/tabs/Home";
import About from "@/components/tabs/About";
import Skills from "@/components/tabs/Skills";
import Portfolio from "@/components/tabs/Portfolio";
import Contact from "@/components/tabs/Contact";
Expand All @@ -19,24 +21,35 @@ export default {
props: {
activePage: Number,
},
components: { Home, About, Portfolio, Contact },
data() {
return {
actualActivePage: this.activePage,
}
},
watch: {
actualActivePage: function (newVal) {
this.updateActivePage(newVal);
return newVal;
},
activePage: function (newVal) {
this.actualActivePage = newVal;
return newVal;
},
},
components: { Home, Skills, Portfolio, Contact },
methods: {
isActive(pageNumber) {
return this.activePage === pageNumber;
return this.actualActivePage === pageNumber;
},
updateActivePage(value) {
this.$emit('update:activePage', value);
}
},
}
</script>

<style scoped>
main {
display: flex;
overflow: hidden;
min-height: calc(100vh - 24px);
}
@media only screen and (max-device-width: 640px) {
main { /* Assign space for navbar */
min-height: calc(100vh - 84px);
}
.tab-content {
padding-bottom: 24px; /* Footer separation */
}
</style>
4 changes: 3 additions & 1 deletion plugins/fontawesome.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import Vue from 'vue';
import { library, config } from '@fortawesome/fontawesome-svg-core';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { fas } from '@fortawesome/free-solid-svg-icons';
import { fab } from '@fortawesome/free-brands-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons';

// This is important, we are going to let Nuxt.js worry about the CSS
config.autoAddCss = false;

// You can add your icons directly in this plugin. See other examples for how you
// can add other styles or just individual icons.
library.add(fas);
library.add(fas, fab, far);

// Register the component globally
Vue.component('font-awesome-icon', FontAwesomeIcon);
10 changes: 10 additions & 0 deletions plugins/route-lang.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default ({ app }) => {
// Every time the route changes (fired on initialization too)
app.router.beforeEach((to, from, next) => {
// Detect language
if (to.query.lang) {
app.i18n.setLocale(to.query.lang);
}
next();
});
};
Loading

0 comments on commit e34e722

Please sign in to comment.