-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from HectorSaldes/LIB-7-New-section-categories
Lib 7 new section categories
- Loading branch information
Showing
17 changed files
with
513 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,35 @@ | ||
import { Button } from "primereact/button"; | ||
import React from "react"; | ||
import {Button} from "primereact/button"; | ||
import React, {useEffect, useState} from "react"; | ||
|
||
export default function ButtonUp({ goScrollUp }) { | ||
return ( | ||
<div | ||
className='speeddial-tooltip-demo' | ||
style={{ | ||
position: "fixed", | ||
bottom: "3em", | ||
right: "3em", | ||
}} | ||
> | ||
<Button | ||
icon='pi pi-arrow-up' | ||
className='p-button-rounded p-button-help p-button-lg speeddial-left' | ||
onClick={() => goScrollUp()} | ||
/> | ||
</div> | ||
); | ||
export default function ButtonUp() { | ||
const [scroll, setScroll] = useState(0); | ||
|
||
useEffect(() => { | ||
window.addEventListener("scroll", handleScroll, {passive: true}); | ||
return () => window.removeEventListener("scroll", handleScroll); | ||
}, []); | ||
|
||
const handleScroll = () => setScroll(window.pageYOffset); | ||
|
||
const goScrollUp = () => { | ||
window.scrollTo(0, 0); | ||
document.querySelector("#inputSearch").focus(); | ||
}; | ||
|
||
return ( | ||
<div className='speeddial-tooltip-demo' | ||
style={{ | ||
position: "fixed", | ||
bottom: "3em", | ||
right: "3em", | ||
}} | ||
> | ||
{scroll > 200 && (<Button | ||
icon='pi pi-arrow-up' | ||
className='p-button-rounded p-button-help p-button-lg speeddial-left' | ||
onClick={() => goScrollUp()} | ||
/>)} | ||
|
||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,38 @@ | ||
import React from "react"; | ||
import { Card } from "primereact/card"; | ||
import { Button } from "primereact/button"; | ||
import {Card} from "primereact/card"; | ||
import {Button} from "primereact/button"; | ||
|
||
export default function IconCard({ payload, getIconToDownload }) { | ||
const { name, commonName, platform, id } = payload; | ||
export default function IconCard({payload, getIconToDownload=function(){}, downloadble = true}) { | ||
const {name, commonName, platform, id} = payload; | ||
|
||
const header = () => ( | ||
<div className="col-12 flex justify-content-center pt-2"> | ||
<img | ||
src={`https://img.icons8.com/${platform}/2x/${commonName}.png`} | ||
alt="icon" | ||
style={{ height: "100px", width: "100px" }} | ||
/> | ||
</div> | ||
); | ||
const header = () => ( | ||
<div className="col-12 flex justify-content-center pt-2"> | ||
<img | ||
src={`https://img.icons8.com/${platform}/2x/${commonName}.png`} | ||
alt="icon" | ||
style={{height: "100px", width: "100px"}} | ||
/> | ||
</div> | ||
); | ||
|
||
return ( | ||
<div className="col-6 sm:col-4 md:col-2" key={id}> | ||
<Card | ||
className="iconCards" | ||
style={{ backgroundColor: "var(--yellow-50)" }} | ||
key={id} | ||
subTitle={() => name.substring(0, 12)} | ||
header={header} | ||
footer={ | ||
<Button | ||
label="SVG" | ||
icon="pi pi-download" | ||
className="col-12 p-button p-button-warning" | ||
onClick={() => getIconToDownload(id, commonName)} | ||
/> | ||
} | ||
/> | ||
</div> | ||
); | ||
return ( | ||
<div className="col-6 sm:col-4 md:col-2" key={id}> | ||
<Card | ||
className="iconCards" | ||
style={{backgroundColor: "var(--yellow-50)"}} | ||
key={id} | ||
subTitle={() => name.substring(0, 12)} | ||
header={header} | ||
footer={ | ||
downloadble && (<Button | ||
label="Download" | ||
icon="pi pi-download" | ||
className="col-12 p-button p-button-warning" | ||
onClick={() => getIconToDownload(id, commonName)} | ||
/>) | ||
|
||
} | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,54 @@ | ||
import { Card } from "primereact/card"; | ||
import {Card} from "primereact/card"; | ||
import React from "react"; | ||
import { myCards } from "../assets/utils/Items"; | ||
import {myCards} from "../assets/utils/Items"; | ||
import "../assets/css/cardStyle.css"; | ||
|
||
export default function Home() { | ||
const CardHome = ({ c }) => ( | ||
<div className='col-12 sm:col-4' data-aos="fade-up"> | ||
<Card | ||
style={{ background: "var(--yellow-100)" }} | ||
className='mb-2 homeCards' | ||
title={c.title} | ||
header={ | ||
<img | ||
style={{ objectFit: "cover" }} | ||
width='100%' | ||
height='200px' | ||
alt={c.title} | ||
src={c.image} | ||
/> | ||
} | ||
> | ||
<div className='text-justify' style={{ lineHeight: "1.5", fontSize: "20px", height: "200px" }}> | ||
{c.text} | ||
</div> | ||
</Card> | ||
</div> | ||
); | ||
const CardHome = ({c}) => ( | ||
<div className='col-12 sm:col-4' data-aos="fade-up"> | ||
<Card | ||
style={{background: "var(--yellow-100)"}} | ||
className='mb-2 homeCards' | ||
title={c.title} | ||
header={ | ||
<img | ||
style={{objectFit: "cover"}} | ||
width='100%' | ||
height='200px' | ||
alt={c.title} | ||
src={c.image} | ||
/> | ||
} | ||
> | ||
<div className='text-justify' style={{lineHeight: "1.5", fontSize: "20px", height: "200px"}}> | ||
{c.text} | ||
</div> | ||
</Card> | ||
</div> | ||
); | ||
|
||
return ( | ||
<div className='p-4'> | ||
<div | ||
className='font-semibold text-center title' | ||
style={{ fontSize: "8em" }} | ||
> | ||
LIBER | ||
</div> | ||
<div className='text-justify md:text-center'> | ||
<div | ||
className='p-text-italic p-text-center' | ||
style={{ fontSize: "1.5em", color: "var(--yellow-500)" }} | ||
> | ||
LIBER from Roman means free | ||
</div> | ||
<div | ||
style={{ fontSize: "1.5em", marginBottom: "150px" }} | ||
className='my-5' | ||
> | ||
This is a proyect created to help others to download and upload | ||
resources completely free from{" "} | ||
<a | ||
style={{ color: "green", fontWeight: "bold" }} | ||
href="https://icons8.com/" | ||
target='_blank' | ||
rel='noreferrer' | ||
> | ||
Icons8 | ||
</a> | ||
</div> | ||
</div> | ||
<div className='grid text-center'> | ||
{myCards.map((c, index) => ( <CardHome key={(index+1)} c={c} />))} | ||
</div> | ||
</div> | ||
); | ||
return ( | ||
<> | ||
<div className='font-semibold text-center title' style={{fontSize: "8em"}}> | ||
LIBER | ||
</div> | ||
<div className='text-justify md:text-center'> | ||
<div className='p-text-italic p-text-center' | ||
style={{fontSize: "1.5em", color: "var(--yellow-500)"}}> | ||
LIBER from Roman means free | ||
</div> | ||
<div style={{fontSize: "1.5em", marginBottom: "150px"}} className='my-5'> | ||
This is a proyect created to help others to download and upload | ||
resources completely free from{" "} | ||
<a style={{color: "green", fontWeight: "bold"}} href="https://icons8.com/" target='_blank' | ||
rel='noreferrer'> | ||
Icons8 | ||
</a> | ||
</div> | ||
</div> | ||
<div className='grid text-center'> | ||
{myCards.map((c, index) => (<CardHome key={(index + 1)} c={c}/>))} | ||
</div> | ||
</> | ||
); | ||
} |
Oops, something went wrong.