Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lobooooooo14 committed Nov 30, 2024
2 parents e948ce2 + 36ee2e2 commit 8d4aed2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 52 deletions.
2 changes: 1 addition & 1 deletion public/locales/pt/pages/home.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"hero": {
"title": "Olá, eu sou Lobo",
"title": "Olá, eu sou o Lobo",
"subtitle": "Desenvolvedor Front-end"
},
"about": {
Expand Down
4 changes: 2 additions & 2 deletions src/components/project-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export default function ProjectCard({
))}
</div>

<div className="flex justify-between gap-2">
<div className="flex flex-col justify-between gap-2 xs:flex-row">
<Button
variant="default"
className="w-full gap-2"
className="w-full flex-row-reverse gap-2 xs:flex-row"
onClick={() => navigate(`/projects/${project.slug}`)}
>
<ExpandIcon size={22} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
"flex h-10 w-full rounded-md border border-input bg-foreground/5 px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className
)}
ref={ref}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
return (
<textarea
className={cn(
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
"flex min-h-[80px] w-full rounded-md border border-input bg-foreground/5 px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className
)}
ref={ref}
Expand Down
54 changes: 7 additions & 47 deletions src/pages/Home/Sections/projects.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { HTMLAttributes, useState } from "react"
import { HTMLAttributes } from "react"
import { useTranslation } from "react-i18next"
import { useMediaQuery } from "react-responsive"
import { Link, redirect, useNavigate } from "react-router-dom"

import { AspectRatio } from "@radix-ui/react-aspect-ratio"
import Autoplay from "embla-carousel-autoplay"
import { ExpandIcon, ExternalLinkIcon, TriangleAlertIcon } from "lucide-react"
import { ExpandIcon, ExternalLinkIcon } from "lucide-react"

import { Button } from "@/components/ui/button"
import { Card } from "@/components/ui/card"
Expand Down Expand Up @@ -35,7 +35,7 @@ export default function Projects() {
if (topProjects.length === 0) return

return (
<section id="projects" className="min-h-screen">
<section id="projects" className="py-4">
<div className="mb-6 flex w-full flex-col items-center">
<h2>{t("projects.title")}</h2>
<Separator className="w-1/3" />
Expand Down Expand Up @@ -98,11 +98,8 @@ function CustomProjectCard({
}: { project: ProjectType } & HTMLAttributes<HTMLDivElement>) {
const theme = useTheme()
const { t } = useTranslation(["pages/home", "projects", "common"])
const isMedium = useMediaQuery({ query: "(max-width: 768px)" })
const navigate = useNavigate()

const [disableReverseColors, setDisableReverseColors] = useState(false)

return (
<Card {...rest}>
<AspectRatio ratio={16 / 9}>
Expand All @@ -119,14 +116,6 @@ function CustomProjectCard({
: (project.poster.light ?? project.poster.src)
}
className="h-full w-full rounded-lg rounded-t-lg object-cover transition-all"
style={{
filter:
project.invertColorsInTheme === theme.themeName &&
!disableReverseColors &&
!isMedium
? "invert(1)"
: "invert(0)"
}}
autoPlay
loop
muted
Expand All @@ -139,45 +128,16 @@ function CustomProjectCard({
? (project.poster.dark ?? project.poster.src)
: (project.poster.light ?? project.poster.src)
}
style={{
filter:
project.invertColorsInTheme === theme.themeName &&
!disableReverseColors &&
!isMedium
? "invert(1)"
: "invert(0)"
}}
className="h-full w-full rounded-lg object-cover transition-all"
/>
)}

{/* overlay */}
<div className="absolute inset-0 flex flex-col items-center justify-center rounded-lg bg-gradient-to-t from-white/80 to-white/20 opacity-0 backdrop-blur-md transition-opacity hover:opacity-100 dark:from-black/80 dark:to-black/20">
{/* Invert colors button */}
<div className="absolute right-1 top-1">
{project.invertColorsInTheme === theme.themeName && (
<Button
className="text-xs"
onClick={() => setDisableReverseColors(!disableReverseColors)}
>
<TriangleAlertIcon
size={16}
color="orange"
className="my-[0.2rem] mr-1"
/>
{t(
!disableReverseColors
? "projects.card.invertColors"
: "projects.card.originalColors"
)}
</Button>
)}
</div>

<h3 className="my-0 overflow-hidden text-ellipsis text-nowrap text-center">
<div className="absolute inset-0 flex flex-col items-center justify-center rounded-lg bg-gradient-to-t from-black/80 to-black/40 opacity-0 backdrop-blur-sm transition-opacity hover:opacity-100">
<h3 className="my-0 overflow-hidden text-ellipsis text-nowrap text-center text-white">
{project.title}
</h3>
<p className="overflow-hidden text-ellipsis text-nowrap text-center text-sm">
<p className="overflow-hidden text-ellipsis text-nowrap text-center text-sm text-white/80">
{t(project.shortDescription, { ns: "projects" })}
</p>

Expand All @@ -194,7 +154,7 @@ function CustomProjectCard({

<Button
variant="link"
className="gap-2"
className="gap-2 text-white"
onClick={() => window.open(project.url, "_blank")}
>
{t("open", { ns: "common" })}
Expand Down
3 changes: 3 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module.exports = {
sans: ["Geist", "system-ui", "sans-serif"],
mono: ["Geist Mono", "monospace"]
},
screens: {
xs: "320px"
},
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
Expand Down

0 comments on commit 8d4aed2

Please sign in to comment.