Added card tiles on home tab

This commit is contained in:
Khalim Conn-Kowlessar 2023-05-25 18:58:10 +01:00
parent 52d526b928
commit 5d7c0d6706
9 changed files with 257 additions and 43 deletions

48
public/house-icon-0.svg Normal file
View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 512 512" xml:space="preserve">
<rect x="289.389" y="183.65" style="fill:#80D7D7;" width="100.173" height="178.085"/>
<path style="fill:#9DB0CA;" d="M389.564,378.436H289.391c-9.22,0-16.695-7.475-16.695-16.695V183.656
c0-9.22,7.475-16.695,16.695-16.695h100.173c9.22,0,16.695,7.475,16.695,16.695v178.085
C406.259,370.961,398.785,378.436,389.564,378.436z"/>
<path style="fill:#C5DCFD;" d="M456.345,378.436h-66.782c-9.22,0-16.695-7.475-16.695-16.695V183.656
c0-9.22,7.475-16.695,16.695-16.695h66.782c9.22,0,16.695,7.475,16.695,16.695v178.085
C473.041,370.961,465.567,378.436,456.345,378.436z"/>
<rect x="122.434" y="183.65" style="fill:#80D7D7;" width="100.173" height="178.085"/>
<path style="fill:#B1C6E4;" d="M222.609,378.436H122.436c-9.22,0-16.695-7.475-16.695-16.695V183.656
c0-9.22,7.475-16.695,16.695-16.695h100.173c9.22,0,16.695,7.475,16.695,16.695v178.085
C239.304,370.961,231.83,378.436,222.609,378.436z"/>
<g>
<path style="fill:#DBE9FD;" d="M122.436,378.436H55.654c-9.22,0-16.695-7.475-16.695-16.695V183.656
c0-9.22,7.475-16.695,16.695-16.695h66.782c9.22,0,16.695,7.475,16.695,16.695v178.085
C139.132,370.961,131.658,378.436,122.436,378.436z"/>
<path style="fill:#DBE9FD;" d="M289.391,378.436h-66.782c-9.22,0-16.695-7.475-16.695-16.695V183.656
c0-9.22,7.475-16.695,16.695-16.695h66.782c9.22,0,16.695,7.475,16.695,16.695v178.085
C306.086,370.961,298.612,378.436,289.391,378.436z"/>
</g>
<g>
<path style="fill:#C5DCFD;" d="M289.391,166.96H256v211.476h33.391c9.22,0,16.695-7.475,16.695-16.695V183.656
C306.086,174.435,298.612,166.96,289.391,166.96z"/>
<path style="fill:#C5DCFD;" d="M456.345,445.218H55.654c-9.22,0-16.695-7.475-16.695-16.695v-83.477h434.082v83.477
C473.041,437.743,465.567,445.218,456.345,445.218z"/>
</g>
<path style="fill:#B1C6E4;" d="M473.041,345.045H256v100.173h200.346c9.22,0,16.695-7.475,16.695-16.695V345.045z"/>
<path style="fill:#DBE9FD;" d="M489.736,512H22.263c-9.223,0-16.695-7.478-16.695-16.695v-66.782
c0-9.217,7.473-16.695,16.695-16.695h467.473c9.217,0,16.695,7.478,16.695,16.695v66.782C506.432,504.522,498.955,512,489.736,512z"
/>
<g>
<path style="fill:#C5DCFD;" d="M489.736,411.827H256V512h233.737c9.217,0,16.695-7.478,16.695-16.695v-66.782
C506.432,419.306,498.955,411.827,489.736,411.827z"/>
<path style="fill:#C5DCFD;" d="M489.736,200.351H22.263c-7.256,0-13.685-4.685-15.896-11.598
c-2.217-6.913,0.288-14.467,6.191-18.684L246.294,3.114c5.804-4.152,13.609-4.152,19.412,0l233.737,166.955
c5.902,4.217,8.402,11.771,6.195,18.684C503.421,195.666,496.998,200.351,489.736,200.351z"/>
</g>
<g>
<path style="fill:#B1C6E4;" d="M489.736,200.351c7.26,0,13.685-4.685,15.902-11.598c2.206-6.913-0.294-14.467-6.195-18.684
L265.707,3.114C262.805,1.038,259.402,0,256,0v200.351H489.736z"/>
<circle style="fill:#B1C6E4;" cx="255.998" cy="116.868" r="16.695"/>
</g>
<path style="fill:#9DB0CA;" d="M272.695,116.874c0-9.22-7.475-16.695-16.695-16.695v33.391
C265.221,133.569,272.695,126.094,272.695,116.874z"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

27
public/house-icon-1.svg Normal file
View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 511.999 511.999" xml:space="preserve">
<path style="fill:#DBE9FD;" d="M256,29.174L55.652,229.522v22.261v232.391c0,9.223,7.473,16.696,16.696,16.696h367.304
c9.223,0,16.696-7.473,16.696-16.696V229.522L256,29.174z"/>
<path style="fill:#C5DCFD;" d="M256,29.174v471.696h183.652c9.223,0,16.696-7.473,16.696-16.696V229.522L256,29.174z"/>
<path style="fill:#A1AAB3;" d="M389.565,500.869h-267.13V317.217c0-9.22,7.475-16.696,16.696-16.696H372.87
c9.22,0,16.696,7.475,16.696,16.696V500.869z"/>
<g>
<rect x="122.435" y="367.304" style="fill:#8A9199;" width="267.13" height="33.391"/>
<path style="fill:#8A9199;" d="M389.565,333.913h-267.13v-16.696c0-9.22,7.475-16.696,16.696-16.696H372.87
c9.22,0,16.696,7.475,16.696,16.696V333.913z"/>
<rect x="122.435" y="434.087" style="fill:#8A9199;" width="267.13" height="33.391"/>
</g>
<path style="fill:#875334;" d="M456.348,233.739L356.174,133.565V94.609c0-9.22,7.475-16.696,16.696-16.696h66.783
c9.22,0,16.696,7.475,16.696,16.696V233.739z"/>
<path style="fill:#FF6243;" d="M495.305,283.826c-4.272,0-8.544-1.631-11.804-4.892L256,51.435L28.5,278.934
c-6.521,6.521-17.087,6.521-23.609,0c-6.521-6.516-6.521-17.092,0-23.609L244.195,16.021c6.521-6.521,17.087-6.521,23.609,0
l239.304,239.304c6.521,6.516,6.521,17.092,0,23.609C503.848,282.195,499.576,283.826,495.305,283.826z"/>
<path style="fill:#FF3501;" d="M267.804,16.022c-3.26-3.261-7.532-4.892-11.804-4.892v40.304l227.501,227.501
c3.261,3.261,7.533,4.892,11.804,4.892s8.544-1.631,11.804-4.892c6.521-6.516,6.521-17.092,0-23.609L267.804,16.022z"/>
<path style="fill:#8D9499;" d="M339.479,233.739H172.522c-9.217,0-16.696-7.479-16.696-16.696c0-9.217,7.479-16.696,16.696-16.696
h166.957c9.217,0,16.696,7.479,16.696,16.696C356.174,226.26,348.696,233.739,339.479,233.739z"/>
<path style="fill:#737980;" d="M339.479,200.348H256v33.391h83.478c9.217,0,16.696-7.479,16.696-16.696
C356.174,207.826,348.696,200.348,339.479,200.348z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

36
public/house-icon-2.svg Normal file
View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg height="800px" width="800px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 511.999 511.999" xml:space="preserve">
<path style="fill:#DBE9FD;" d="M256,29.174L55.652,229.522v22.261v232.391c0,9.223,7.473,16.696,16.696,16.696h367.304
c9.223,0,16.696-7.473,16.696-16.696V229.522L256,29.174z"/>
<path style="fill:#C5DCFD;" d="M256,29.174v471.696h183.652c9.223,0,16.696-7.473,16.696-16.696V229.522L256,29.174z"/>
<path style="fill:#875334;" d="M456.348,233.739L356.174,133.565V94.609c0-9.22,7.475-16.696,16.696-16.696h66.783
c9.22,0,16.696,7.475,16.696,16.696V233.739z"/>
<path style="fill:#FF6243;" d="M495.305,283.826c-4.272,0-8.544-1.631-11.804-4.892L256,51.435L28.5,278.934
c-6.521,6.521-17.087,6.521-23.609,0c-6.521-6.516-6.521-17.092,0-23.609L244.195,16.021c6.521-6.521,17.087-6.521,23.609,0
l239.304,239.304c6.521,6.516,6.521,17.092,0,23.609C503.848,282.195,499.576,283.826,495.305,283.826z"/>
<path style="fill:#FF3501;" d="M267.804,16.022c-3.26-3.261-7.532-4.892-11.804-4.892v40.304l227.501,227.501
c3.261,3.261,7.533,4.892,11.804,4.892s8.544-1.631,11.804-4.892c6.521-6.516,6.521-17.092,0-23.609L267.804,16.022z"/>
<path style="fill:#9DCA40;" d="M352.758,350.865c6.611-10.074,11.963-21.092,15.819-32.977c9.917-29.277,11.57-63.515,4.408-100.583
c-0.551-3.07-1.18-6.217-1.889-9.287c-0.709-3.227-2.44-6.217-4.802-8.421c-2.125-1.968-4.722-3.306-7.713-4.093
c-3.07-0.708-6.059-1.338-9.13-1.889c-37.148-7.241-71.542-5.431-100.819,4.644c-11.884,4.014-22.903,9.366-32.898,16.056
c-41.168,26.742-63.82,74.424-61.389,117.584c1.126,20.991,8.621,42.149,23.06,56.588l0.393,0.393
c16.346,16.346,39.954,23.454,63.121,23.454C281.735,412.332,326.63,390.656,352.758,350.865z"/>
<path style="fill:#8EB043;" d="M240.92,412.332c-23.165,0-46.777-7.11-63.121-23.454l-0.393-0.393l188.89-188.89
c2.361,2.204,4.093,5.195,4.802,8.421c0.708,3.07,1.338,6.217,1.889,9.287c7.162,37.069,5.51,71.306-4.408,100.583
c-3.857,11.884-9.208,22.903-15.819,32.977C326.633,390.65,281.743,412.332,240.92,412.332z"/>
<path style="fill:#89B138;" d="M371.097,208.017c0.708,3.07,1.338,6.217,1.889,9.287L162.058,428.23
c-3.227,3.227-7.555,4.88-11.806,4.88c-4.25,0-8.578-1.653-11.806-4.88c-0.157-0.157-0.236-0.236-0.315-0.472
c-6.217-6.532-6.061-16.764,0.315-23.139l211.006-211.005c3.07,0.551,6.061,1.181,9.13,1.889c2.991,0.787,5.587,2.125,7.713,4.093
C368.656,201.799,370.388,204.79,371.097,208.017z"/>
<path style="fill:#799739;" d="M371.097,208.017c0.708,3.07,1.338,6.217,1.889,9.287L162.058,428.23
c-3.227,3.227-7.555,4.88-11.806,4.88c-4.25,0-8.578-1.653-11.806-4.88c-0.157-0.157-0.236-0.236-0.315-0.472l228.163-228.163
C368.656,201.799,370.388,204.79,371.097,208.017z"/>
<path style="fill:#89B138;" d="M352.758,350.865c-119.866-6.847-104.283-6.061-114.514-6.532c-4.565,0-8.736-1.81-11.806-4.88
c-2.991-2.991-4.802-7.161-4.88-11.806c-0.63-10.074,0.157,5.352-5.825-113.333c9.995-6.689,21.014-12.042,32.898-16.056
c6.296,106.722,5.116,84.607,6.296,112.703c29.198,2.125,6.846,0.709,113.648,6.926C364.721,329.771,359.37,340.79,352.758,350.865z
"/>
<path style="fill:#799739;" d="M352.758,350.865c-119.866-6.847-104.283-6.061-114.514-6.532c-4.565,0-8.736-1.81-11.806-4.88
l28.491-28.491c29.198,2.125,6.846,0.709,113.648,6.926C364.721,329.771,359.37,340.79,352.758,350.865z"/>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

36
public/house-icon-3.svg Normal file
View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 511.999 511.999" xml:space="preserve">
<path style="fill:#DBE9FD;" d="M416.044,189.217H95.957l-40.304,40.304v22.261v232.391c0,9.223,7.473,16.696,16.696,16.696h367.304
c9.223,0,16.696-7.473,16.696-16.696V229.522L416.044,189.217z"/>
<path style="fill:#C5DCFD;" d="M416.044,189.217H256v311.652h183.652c9.223,0,16.696-7.473,16.696-16.696V229.522L416.044,189.217z"
/>
<polygon style="fill:#B1C6E4;" points="89.044,467.478 89.044,243.353 89.044,222.609 422.957,222.609 422.957,243.353
422.957,467.478 "/>
<polygon style="fill:#9DB0CA;" points="256,467.478 422.957,467.478 422.957,243.353 422.957,222.609 256,222.609 "/>
<path style="fill:#875334;" d="M456.348,211.478L356.174,111.304V94.609c0-9.22,7.475-16.696,16.696-16.696h66.783
c9.22,0,16.696,7.475,16.696,16.696V211.478z"/>
<polygon style="fill:#DBE9FD;" points="427.174,200.348 256,29.174 84.826,200.348 "/>
<polygon style="fill:#C5DCFD;" points="427.174,200.348 256,29.174 256,200.348 "/>
<path style="fill:#FF6243;" d="M495.305,283.826c-4.272,0-8.544-1.631-11.804-4.892L256,51.435L28.5,278.934
c-6.521,6.521-17.087,6.521-23.609,0c-6.521-6.516-6.521-17.092,0-23.609L244.195,16.021c6.521-6.521,17.087-6.521,23.609,0
l239.304,239.304c6.521,6.516,6.521,17.092,0,23.609C503.848,282.195,499.576,283.826,495.305,283.826z"/>
<g>
<path style="fill:#FF3501;" d="M267.804,16.022c-3.26-3.261-7.532-4.892-11.804-4.892v40.304l227.501,227.501
c3.261,3.261,7.533,4.892,11.804,4.892s8.544-1.631,11.804-4.892c6.521-6.516,6.521-17.092,0-23.609L267.804,16.022z"/>
<rect x="289.392" y="222.609" style="fill:#FF3501;" width="33.391" height="111.304"/>
<rect x="356.174" y="222.609" style="fill:#FF3501;" width="33.391" height="111.304"/>
<rect x="289.392" y="267.13" style="fill:#FF3501;" width="100.174" height="33.391"/>
</g>
<rect x="155.826" y="222.609" style="fill:#ECEFF0;" width="33.391" height="111.304"/>
<g>
<rect x="122.435" y="367.304" style="fill:#FF6243;" width="33.391" height="100.174"/>
<rect x="189.218" y="367.304" style="fill:#FF6243;" width="33.391" height="100.174"/>
<rect x="122.435" y="400.696" style="fill:#FF6243;" width="100.174" height="33.391"/>
</g>
<rect x="256" y="367.304" style="fill:#DADFE4;" width="33.391" height="100.174"/>
<path style="fill:#60AED5;" d="M356.174,467.478h-66.783v-66.783h50.087c9.22,0,16.696,7.475,16.696,16.696V467.478z"/>
<rect x="55.652" y="333.913" style="fill:#DBE9FD;" width="400.696" height="33.391"/>
<rect x="256" y="333.913" style="fill:#C5DCFD;" width="200.348" height="33.391"/>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -0,0 +1,41 @@
import React from "react";
// import { AiFillHeart } from "react-icons/ai";
// import { BsChatSquareFill } from "react-icons/bs";
// import styles from "./Card.module.css";
const styles = {
wrapper:
"bg-white hover:bg-gray-800 shadow-xl hover:shadow-none cursor-pointer w-60 rounded-3xl flex flex-col items-center justify-center;",
header: "relative mt-2 mx-2",
imageWrapper: "h-56 rounded-2xl overflow-hidden",
wrapperAnime: "transition-all duration-500 ease-in-out",
image: "object-cover w-8/12 h-8/12",
textWrapper: "pt-10 pb-6 w-full px-4 flex justify-between items-center",
text: "font-medium leading-none text-base tracking-wider text-gray-400",
};
interface CardProps {
title: string;
order: number;
image: string;
budget: string;
}
const Card = ({ title, order, image, budget }: CardProps) => {
return (
<div className={[styles.wrapper, styles.wrapperAnime].join(" ")}>
<div className={styles.header}>
<div className={styles.imageWrapper}>
<img src={image} className={styles.image} alt="" />
</div>
</div>
<div className={styles.textWrapper}>
<h1 className={styles.text}>{`${title}`}</h1>
<div className={styles.text}>{budget}</div>
</div>
</div>
);
};
export default Card;

View file

@ -0,0 +1,35 @@
"use client";
import { Fragment } from "react";
import { Transition } from "@headlessui/react";
import Card from "./Card";
type PortfoliosType = Array<{
title: string;
budget: string;
}>;
export default function CardTiles({
Portfolios,
}: {
Portfolios: PortfoliosType;
}) {
return (
<div className="flex justify-center">
<div className="grid grid-cols-1 gap-4 max-w-7xl sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
{Portfolios.map((portfolio, index) => {
const image_idx = index % 3;
return (
<Card
key={index}
title={portfolio.title}
order={index + 1}
image={`house-icon-${image_idx}.svg`}
budget={portfolio.budget}
/>
);
})}
</div>
</div>
);
}

View file

@ -1,35 +0,0 @@
const formClasses =
"block w-full appearance-none rounded-lg border bg-white py-[calc(theme(spacing.2)-1px)] px-[calc(theme(spacing.3)-1px)] text-gray-900 placeholder:text-gray-400 focus:border-stone-500 focus:outline-none focus:ring-cyan-500 sm:text-sm";
const Label = ({ id, children }: { id: string; children: React.ReactNode }) => {
return (
<label
htmlFor={id}
className="mb-2 block text-sm font-semibold text-gray-900"
>
{children}
</label>
);
};
type TypeFieldInput = {
id: string;
label: string;
type: string;
className?: string;
} & JSX.IntrinsicElements["input"];
export default function TextField({
id,
label,
type = "text",
className,
...props
}: TypeFieldInput) {
return (
<div className={className}>
{label && <Label id={id}>{label}</Label>}
<input id={id} type={type} {...props} className={formClasses} />
</div>
);
}

View file

@ -2,6 +2,7 @@ import { getServerSession } from "next-auth";
import { AuthOptions } from "../api/auth/[...nextauth]/route";
import { redirect } from "next/navigation";
import Nav from "../components/Navbar";
import CardTiles from "../components/home/CardTiles";
const Home = async () => {
// const session = await getServerSession(AuthOptions);
@ -10,10 +11,35 @@ const Home = async () => {
// redirect("/?callbackUrl=/home");
// }
const Portfolios = [
{
title: "Portfolio 1",
budget: "£500k",
},
{
title: "Portfolio 2",
budget: "150k",
},
{
title: "Portfolio 3",
budget: "£1m",
},
{ title: "Portfolio 4", budget: "£2m" },
{ title: "Portfolio 5", budget: "£25k" },
{ title: "Portfolio 6", budget: "£10k" },
{ title: "Portfolio 7", budget: "£33k" },
{ title: "Portfolio 8", budget: "£670k" },
{ title: "Portfolio 9", budget: "£240k" },
{ title: "Portfolio 10", budget: "93k" },
];
return (
<>
<Nav pageName="Home"></Nav>
<div> Home </div>
<div className="flex justify-center">
<h1 className="text-3xl font-bold mt-3"> Your Portfolios </h1>
</div>
<CardTiles Portfolios={Portfolios} />
</>
);
};

View file

@ -1,18 +1,18 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
backgroundImage: {
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
'gradient-conic':
'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
},
},
plugins: [],
}
};