Skip to content

Commit

Permalink
♻️ refactor: Cria card de certificado
Browse files Browse the repository at this point in the history
componente que facilita a inserção de novos certificados com uma estrutura pré-pronta
  • Loading branch information
imgeff committed Aug 5, 2022
1 parent 9f13da7 commit 6854327
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/components/Certificate/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { GraduationCap, MapPin } from 'phosphor-react';
import ICertificate from '../../data/CertificationsData/interfaces/ICertificate';
import './style.css';

function Certificate({ id, icon, title, institution, description, link }: ICertificate) {
const iconColor = '#10b981';
function showCertificateDescription(id: string) {
const certificateDescription = document.getElementById(id);
if (!certificateDescription) return;
certificateDescription.style.display = 'flex';
}

function hiddenCertificateDescription(id: string) {
const certificateDescription = document.getElementById(id);
if (!certificateDescription) return;
certificateDescription.style.display = 'none';
}

return(
<>
<div
className="certificate"
onMouseOver={ () => showCertificateDescription(`description-${id}`) }
onMouseOut={ () => hiddenCertificateDescription(`description-${id}`) }
>
<div id={`description-${id}`} className="certificate-description">
<p>{ description }</p>
<a
href={ link }
target="_blank"
rel="noreferrer"
>
Visualizar
</a>
</div>
<figure>{ icon }</figure>
<div className="certificate-info">
<span>
<MapPin size={ 25 } weight="duotone" color={ iconColor } />
<label>{ institution }</label>
</span>
<span>
<GraduationCap size={ 25 } weight="duotone" color={ iconColor } />
<strong>{ title }</strong>
</span>
</div>
</div>
</>
);
}

export { Certificate };
127 changes: 127 additions & 0 deletions src/components/Certificate/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
.certificate {
@apply
w-[27rem]
h-56
relative
flex
justify-start
items-center
rounded-lg
border-2
border-neutral-700
xsm:w-80
xsm:h-40
;
}

.certificate figure {
@apply
w-20
h-full
p-2
flex
justify-center
items-center
border-r-2
border-neutral-700
;
}

.certificate-description {
background: rgba(38,38,38,0.4);
-webkit-backdrop-filter: blur(3px);
backdrop-filter: blur(3px);

@apply
w-full
h-full
absolute
hidden
flex-col
justify-around
items-center
rounded-lg
;
}

.certificate a {
@apply
w-32
py-2
text-base
text-center
font-bold
text-neutral-400
bg-neutral-800
border-2
border-neutral-500
rounded-full
hover:border-emerald-500
hover:text-emerald-500
hover:bg-neutral-900
transition-all
xsm:w-28
;
}

.certificate-description p {
text-shadow: 0 0 5px black;

@apply
w-[25rem]
text-neutral-400
text-[15px]
font-bold
text-center
xsm:text-xs
xsm:w-11/12
;
}

.certificate-info {
@apply
w-full
h-full
flex
flex-col
justify-center
items-center
;
}

.certificate-info span {
@apply
w-full
flex
justify-center
items-center
border-b-2
border-neutral-700
xsm:text-sm
;
}

.certificate-info span svg {
@apply
mx-3
mb-1
;
}

.certificate-info label {
@apply
w-full
text-start
text-neutral-400
font-bold
;
}

.certificate strong {
@apply
w-full
p-1
text-start
text-neutral-500
;
}

0 comments on commit 6854327

Please sign in to comment.