Skip to content

Commit

Permalink
feat: new version dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
jamerrq committed Mar 11, 2024
1 parent 70e9760 commit 9403186
Show file tree
Hide file tree
Showing 26 changed files with 407 additions and 172 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ pnpm-debug.log*

# macOS-specific files
.DS_Store

# temporal files
tmp.json
2 changes: 1 addition & 1 deletion src/components/badges/open-to-work.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { lang = 'en' }: Props = Astro.props
---

<span
class='bg-emerald-100 text-emerald-800 text-xs font-bold inline-flex items-center px-2.5 py-0.5 rounded-sm dark:text-emerald-800 border-2 border-emerald-400 font-merriweather xl:absolute top-1.5 right-1.5'
class='bg-emerald-100 text-emerald-800 text-xs font-bold inline-flex items-center px-2.5 py-0.5 rounded-sm font-merriweather xl:absolute top-1.5 right-1.5'
>
<svg viewBox='0 0 512 512' class='w-2.5 h-2.5 me-1.5' fill='currentColor'
><title></title><g data-name='1' id='_1'
Expand Down
46 changes: 24 additions & 22 deletions src/components/blog/last-entries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,31 @@ export default function LastEntries({ lang = 'en' }: { lang?: string }) {
<ul class='grid grid-cols-[1fr_5fr] gap-3 w-full p-2 responsive-text-sm'>
<li />
<li class='dark:text-cyan-400 text-cyan-950 text-xl' />
{entries.map((entry, index) => {
return (
<Fragment key={index}>
<li class='font-merriweather text-sm xl:text-base text-center'>
{entry.date}
</li>
<li class='font-merriweather text-sm xl:text-base py-1 px-2 rounded-sm cursor-pointer hover:scale-[1.02] transition-all ease-in-out flex flex-col gap-2'>
<a href={`${lang === 'en' ? entry.href : entry.hrefEs}`}>
<div class='flex flex-col xl:flex-row gap-4'>
<span>{lang === 'en' ? entry.title : entry.titleEs}</span>
<div class='xl:ml-auto'>
<ReadTimeBadge
readTime={entry.readTimeMins}
lang={lang}
/>
{entries
.filter((entry) => entry.active !== 'false')
.map((entry, index) => {
return (
<Fragment key={index}>
<li class='font-merriweather text-sm xl:text-base text-center'>
{entry.date}
</li>
<li class='font-merriweather text-sm xl:text-base py-1 px-2 rounded-sm cursor-pointer hover:scale-[1.02] transition-all ease-in-out flex flex-col gap-2'>
<a href={`${lang === 'en' ? entry.href : entry.hrefEs}`}>
<div class='flex flex-col xl:flex-row gap-4'>
<span>{lang === 'en' ? entry.title : entry.titleEs}</span>
<div class='xl:ml-auto'>
<ReadTimeBadge
readTime={entry.readTimeMins}
lang={lang}
/>
</div>
</div>
</div>
<Badges badges={entry.tags} />
</a>
</li>
</Fragment>
)
})}
<Badges badges={entry.tags} />
</a>
</li>
</Fragment>
)
})}
</ul>
</article>
)
Expand Down
105 changes: 67 additions & 38 deletions src/components/featured-and-projects/projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { shuffle } from '@utils'

const shuffledData = shuffle([...data])

// featured projects go first
const featured = shuffledData.filter((project) => project.featured)
const notFeatured = shuffledData.filter((project) => !project.featured)
const concatedData = featured.concat(notFeatured)

const PROJECT_STYLES: string = [
'col-span-6',
'row-span-4',
Expand All @@ -30,7 +35,8 @@ const PROJECT_STYLES: string = [
'responsive-text-xs',
'p-2',
'pb-4',
'relative'
'relative',
'text-center'
].join(' ')

import { signal } from '@preact/signals'
Expand All @@ -48,6 +54,9 @@ import simpleIcons, { type toExportType } from '@components/icons/simple-icon'
import { h } from 'preact'

function SimpleIcon(key: string) {
if (key === 'javascript') {
console.log('key', key)
}
const Icon = simpleIcons[key as keyof toExportType]
if (typeof Icon === 'function') {
return <Icon />
Expand Down Expand Up @@ -80,7 +89,17 @@ const DoubleRightButton = ({ _f }: { _f: () => void }) => (
</div>
)

export default function Resources({ n = 1, lang = 'en' }: ResourcesProps) {
function ResourceCard({
project,
lang,
i,
n
}: {
project: (typeof data)[number] | undefined
lang: string
i: number
n: number
}) {
const goRight = () => {
index.value++
if (index.value > data.length - 1) index.value = 0
Expand All @@ -89,47 +108,57 @@ export default function Resources({ n = 1, lang = 'en' }: ResourcesProps) {
index.value--
if (index.value < 0) index.value = data.length - 1
}
return (
<article class={PROJECT_STYLES} key={i}>
{i === 0 && <DoubleLeftButton _f={goLeft} />}
{project?.featured && (
<span class='absolute top-1 right-2 dark:text-amber-300 text-amber-800 underline'>
{lang === 'es' ? 'Destacado' : 'Featured'}
</span>
)}
<h1 class='xl:text-3xl text-xl max-w-md'>{project?.title}</h1>
<p class='font-bold font-merriweather dark:text-slate-200 text-xs xl:text-base max-w-[400px] text-balance'>
{project?.description[lang as 'es' | 'en']}
</p>
<ul class='flex gap-1 [&>li]:font-thin [&>li>a>img]:border-2 [&>li>a>img]:dark:border-amber-300 [&>li>a>img]:border-amber-950 [&>li>a>img]:rounded-sm flex-wrap'>
{project?.stack?.map((tech, index) => (
<li key={index}>{SimpleIcon(tech)}</li>
))}
</ul>
<div class='flex gap-2'>
{project?.repository && (
<a
href={project.repository}
class='border-b-2 font-merriweather text-sm xl:text-base'
target='_blank'
rel='noopener noreferrer'
>
{lang === 'es' ? 'Repositorio' : 'Repository'}
</a>
)}
{project?.demo && (
<a
href={project.demo}
class='border-b-2 font-merriweather text-sm xl:text-base'
target='_blank'
rel='noopener noreferrer'
>
{lang === 'es' ? 'Demo' : 'Preview'}
</a>
)}
</div>
{i === n - 1 && <DoubleRightButton _f={goRight} />}
</article>
)
}

export default function Resources({ n = 1, lang = 'en' }: ResourcesProps) {
return (
<>
{Array.from(Array(n).keys()).map((i) => {
const project = shuffledData.at((i + index.value) % data.length)
const project = concatedData.at((i + index.value) % data.length)
return (
<article class={PROJECT_STYLES} key={i}>
{i === 0 && <DoubleLeftButton _f={goLeft} />}
<h1 class='xl:text-3xl text-xl'>{project?.title}</h1>
<p class='font-bold font-merriweather dark:text-slate-200 text-xs xl:text-base max-w-[400px] text-balance'>
{project?.description[lang as 'es' | 'en']}
</p>
<ul class='flex gap-1 [&>li]:font-thin [&>li>a>img]:border-2 [&>li>a>img]:dark:border-amber-300 [&>li>a>img]:border-amber-950 [&>li>a>img]:rounded-sm flex-wrap'>
{project?.stack?.map((tech, index) => (
<li key={index}>{SimpleIcon(tech)}</li>
))}
</ul>
<div class='flex gap-2'>
{project?.repository && (
<a
href={project.repository}
class='border-b-2 font-merriweather text-sm xl:text-base'
target='_blank'
rel='noopener noreferrer'
>
{lang === 'es' ? 'Repositorio' : 'Repository'}
</a>
)}
{project?.demo && (
<a
href={project.demo}
class='border-b-2 font-merriweather text-sm xl:text-base'
target='_blank'
rel='noopener noreferrer'
>
{lang === 'es' ? 'Demo' : 'Preview'}
</a>
)}
</div>
{i === n - 1 && <DoubleRightButton _f={goRight} />}
</article>
<ResourceCard project={project} lang={lang} i={i} n={n} key={i} />
)
})}
</>
Expand Down
21 changes: 17 additions & 4 deletions src/components/icons/simple-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import {
siJavascript,
siPhp,
siCss3,
siVisualstudiocode
siVisualstudiocode,
siDeno,
siNodedotjs
} from 'simple-icons'

export const ICONS_SAFE_LIST_TAILWIND = [
Expand All @@ -39,7 +41,8 @@ export const ICONS_SAFE_LIST_TAILWIND = [
siHtml5,
siJavascript,
siPhp,
siCss3
siCss3,
siNodedotjs
].map((icon) => `fill-[#${icon.hex}]`)

export interface SimpleIconProps {
Expand Down Expand Up @@ -157,6 +160,14 @@ function VisualStudioCodeLogo() {
})
}

function DenoLogo() {
return SimpleIcon({ __html: siDeno.svg, fill: `#${siDeno.hex}` })
}

function NodeLogo() {
return SimpleIcon({ __html: siNodedotjs.svg, fill: `#${siNodedotjs.hex}` })
}

const toExport = {
Astro: AstroLogo,
Supabase: SupabaseLogo,
Expand All @@ -174,9 +185,11 @@ const toExport = {
React: ReactLogo,
Html: HtmlLogo,
Css: CssLogo,
Javascript: JavaScriptLogo,
JavaScript: JavaScriptLogo,
Php: PhpLogo,
'Visual Studio Code': VisualStudioCodeLogo
'Visual Studio Code': VisualStudioCodeLogo,
Deno: DenoLogo,
NodeJS: NodeLogo
}

export type toExportType = typeof toExport
Expand Down
15 changes: 10 additions & 5 deletions src/components/main/about-me-card.astro
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const ABOUT_ME_STYLES = [
<article class={ABOUT_ME_STYLES} title='Get to know me'>
<header class='flex flex-col xl:flex-row gap-2 items-center'>
<h1 class='dark:text-emerald-300 text-emerald-950 text-2xl xl:text-3xl'>
{lang === 'en' ? 'Get to know me' : 'Conóceme'}
{lang === 'en' ? 'Get To Know Me' : 'Conóceme'}
</h1>
<OpenToWork lang={lang} />
</header>
Expand All @@ -60,8 +60,8 @@ const ABOUT_ME_STYLES = [
</li>
<!-- <p class='font-fira inline'>󰜐</p> -->
<li>
<p class='text-balance'>
<!-- Currently working as part time Backend Developer at -->
<!-- Currently working as part time Backend Developer at -->
<!-- <p class='text-balance'>
{
lang === 'en'
? 'Currently working as part time Backend Developer at'
Expand All @@ -75,7 +75,7 @@ const ABOUT_ME_STYLES = [
>
Dium
</a>
</p>
</p> -->
</li>
<li>
<p class='text-balance'>
Expand All @@ -92,10 +92,15 @@ const ABOUT_ME_STYLES = [
<p class='text-balance'>
<!-- I strongly believe that the best way to achieve something is to start
it. -->
{
<!-- {
lang === 'en'
? 'I strongly believe that the best way to achieve something is to start it'
: 'Creo firmemente que la mejor manera de lograr algo es comenzarlo'
} -->
{
lang === 'en'
? 'Currently focused on web development, with a strong interest in the backend'
: 'Actualmente enfocado en el desarrollo web, con un fuerte interés en el backend'
}
</p>
</li>
Expand Down
32 changes: 16 additions & 16 deletions src/components/main/background.astro
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<>
<style>
.background {
background-image: url('/pizarra.webp');
min-height: 100%;
width: 100vw;
background-position: center;
background-repeat: repeat;
position: fixed;
top: 0;
left: 0;
z-index: -1;
}
</style>
</>
<main class='background blur-sm dark:blur-[2px]'></main>
<style>
.background {
background-image: url('/pizarra.webp');
min-height: 100%;
width: 100vw;
background-position: center;
background-repeat: repeat;
position: fixed;
top: 0;
left: 0;
z-index: -50;
inset: 0;
}
</style>

<div class='background blur-sm dark:blur-[2px]'></div>
4 changes: 2 additions & 2 deletions src/components/main/bento.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ const BENTO_STYLES = [
].join(' ')
---

<main class={BENTO_STYLES}>
<section class={BENTO_STYLES}>
<slot />
</main>
</section>
17 changes: 17 additions & 0 deletions src/components/main/loading.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div role='status'>
<svg
aria-hidden='true'
class='w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600'
viewBox='0 0 100 101'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z'
fill='currentColor'></path>
<path
d='M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z'
fill='currentFill'></path>
</svg>
<span class='sr-only'>Loading...</span>
</div>
Loading

0 comments on commit 9403186

Please sign in to comment.