diff --git a/client/package.json b/client/package.json index e4f44d7..f112345 100644 --- a/client/package.json +++ b/client/package.json @@ -18,6 +18,7 @@ "ky": "^1.3.0", "lodash": "^4.17.21", "multi-range-slider-react": "^2.0.7", + "openmeteo": "^1.1.4", "react": "^18.2.0", "react-device-detect": "^2.2.3", "react-dom": "^18.2.0", diff --git a/client/public/images/pages/AboutProject/1.jpg b/client/public/images/pages/AboutProject/1.jpg new file mode 100644 index 0000000..4dfd0ba Binary files /dev/null and b/client/public/images/pages/AboutProject/1.jpg differ diff --git a/client/public/images/pages/AboutProject/2.jpg b/client/public/images/pages/AboutProject/2.jpg new file mode 100644 index 0000000..10b6e00 Binary files /dev/null and b/client/public/images/pages/AboutProject/2.jpg differ diff --git a/client/public/images/pages/AboutProject/advantages/1.jpg b/client/public/images/pages/AboutProject/advantages/1.jpg new file mode 100644 index 0000000..46b42bd Binary files /dev/null and b/client/public/images/pages/AboutProject/advantages/1.jpg differ diff --git a/client/public/images/pages/AboutProject/advantages/2.jpg b/client/public/images/pages/AboutProject/advantages/2.jpg new file mode 100644 index 0000000..bc5e356 Binary files /dev/null and b/client/public/images/pages/AboutProject/advantages/2.jpg differ diff --git a/client/public/images/pages/AboutProject/advantages/3.jpg b/client/public/images/pages/AboutProject/advantages/3.jpg new file mode 100644 index 0000000..d02835c Binary files /dev/null and b/client/public/images/pages/AboutProject/advantages/3.jpg differ diff --git a/client/public/images/pages/AboutProject/advantages/4.jpg b/client/public/images/pages/AboutProject/advantages/4.jpg new file mode 100644 index 0000000..fbf4c20 Binary files /dev/null and b/client/public/images/pages/AboutProject/advantages/4.jpg differ diff --git a/client/public/images/pages/AboutProject/advantages/5.jpg b/client/public/images/pages/AboutProject/advantages/5.jpg new file mode 100644 index 0000000..762035c Binary files /dev/null and b/client/public/images/pages/AboutProject/advantages/5.jpg differ diff --git a/client/public/images/pages/AboutProject/interiors/1.jpg b/client/public/images/pages/AboutProject/interiors/1.jpg new file mode 100644 index 0000000..1b33094 Binary files /dev/null and b/client/public/images/pages/AboutProject/interiors/1.jpg differ diff --git a/client/public/images/pages/AboutProject/interiors/2.jpg b/client/public/images/pages/AboutProject/interiors/2.jpg new file mode 100644 index 0000000..bfaa9ef Binary files /dev/null and b/client/public/images/pages/AboutProject/interiors/2.jpg differ diff --git a/client/public/images/pages/AboutProject/interiors/3.jpg b/client/public/images/pages/AboutProject/interiors/3.jpg new file mode 100644 index 0000000..6da5144 Binary files /dev/null and b/client/public/images/pages/AboutProject/interiors/3.jpg differ diff --git a/client/public/images/pages/AboutProject/map.jpg b/client/public/images/pages/AboutProject/map.jpg new file mode 100644 index 0000000..985a8fc Binary files /dev/null and b/client/public/images/pages/AboutProject/map.jpg differ diff --git a/client/public/images/pages/AboutProject/places/1.jpg b/client/public/images/pages/AboutProject/places/1.jpg new file mode 100644 index 0000000..dd420f2 Binary files /dev/null and b/client/public/images/pages/AboutProject/places/1.jpg differ diff --git a/client/public/images/pages/AboutProject/places/10.jpg b/client/public/images/pages/AboutProject/places/10.jpg new file mode 100644 index 0000000..a1c5578 Binary files /dev/null and b/client/public/images/pages/AboutProject/places/10.jpg differ diff --git a/client/public/images/pages/AboutProject/places/2.jpg b/client/public/images/pages/AboutProject/places/2.jpg new file mode 100644 index 0000000..e12b423 Binary files /dev/null and b/client/public/images/pages/AboutProject/places/2.jpg differ diff --git a/client/public/images/pages/AboutProject/places/3.jpg b/client/public/images/pages/AboutProject/places/3.jpg new file mode 100644 index 0000000..640a3a3 Binary files /dev/null and b/client/public/images/pages/AboutProject/places/3.jpg differ diff --git a/client/public/images/pages/AboutProject/places/4.jpg b/client/public/images/pages/AboutProject/places/4.jpg new file mode 100644 index 0000000..46f298a Binary files /dev/null and b/client/public/images/pages/AboutProject/places/4.jpg differ diff --git a/client/public/images/pages/AboutProject/places/5.jpg b/client/public/images/pages/AboutProject/places/5.jpg new file mode 100644 index 0000000..925496d Binary files /dev/null and b/client/public/images/pages/AboutProject/places/5.jpg differ diff --git a/client/public/images/pages/AboutProject/places/6.jpg b/client/public/images/pages/AboutProject/places/6.jpg new file mode 100644 index 0000000..6beb966 Binary files /dev/null and b/client/public/images/pages/AboutProject/places/6.jpg differ diff --git a/client/public/images/pages/AboutProject/places/7.jpg b/client/public/images/pages/AboutProject/places/7.jpg new file mode 100644 index 0000000..312cda2 Binary files /dev/null and b/client/public/images/pages/AboutProject/places/7.jpg differ diff --git a/client/public/images/pages/AboutProject/places/8.jpg b/client/public/images/pages/AboutProject/places/8.jpg new file mode 100644 index 0000000..b3ba235 Binary files /dev/null and b/client/public/images/pages/AboutProject/places/8.jpg differ diff --git a/client/public/images/pages/AboutProject/places/9.jpg b/client/public/images/pages/AboutProject/places/9.jpg new file mode 100644 index 0000000..c9ac36f Binary files /dev/null and b/client/public/images/pages/AboutProject/places/9.jpg differ diff --git a/client/public/images/pages/AboutProject/units/1.jpg b/client/public/images/pages/AboutProject/units/1.jpg new file mode 100644 index 0000000..8a019ae Binary files /dev/null and b/client/public/images/pages/AboutProject/units/1.jpg differ diff --git a/client/public/images/pages/AboutProject/units/2.jpg b/client/public/images/pages/AboutProject/units/2.jpg new file mode 100644 index 0000000..d4c0c9b Binary files /dev/null and b/client/public/images/pages/AboutProject/units/2.jpg differ diff --git a/client/public/images/pages/AboutProject/units/3.jpg b/client/public/images/pages/AboutProject/units/3.jpg new file mode 100644 index 0000000..cd92e62 Binary files /dev/null and b/client/public/images/pages/AboutProject/units/3.jpg differ diff --git a/client/public/images/pages/AboutProject/units/4.jpg b/client/public/images/pages/AboutProject/units/4.jpg new file mode 100644 index 0000000..f120dae Binary files /dev/null and b/client/public/images/pages/AboutProject/units/4.jpg differ diff --git a/client/src/api/weather.ts b/client/src/api/weather.ts index c1b196d..bcb1d0a 100644 --- a/client/src/api/weather.ts +++ b/client/src/api/weather.ts @@ -1,72 +1,39 @@ -import { weatherApi } from "./urls"; - -/** - * - * - */ - -type WeatherRes = { - cod: string; - message: number; - cnt: number; - list: { - dt: number; - main: { - temp: number; - feels_like: number; - temp_min: number; - temp_max: number; - pressure: number; - sea_level: number; - grnd_level: number; - humidity: number; - temp_kf: number; - }; - weather: { - id: number; - main: string; - description: string; - icon: string; - }[]; - clouds: { - all: number; - }; - wind: { - speed: number; - deg: number; - gust: number; - }; - visibility: number; - pop: number; - sys: { - pod: string; - }; - dt_txt: string; - }[]; - city: { - id: number; - name: string; - coord: { - lat: number; - lon: number; - }; - country: string; - population: number; - timezone: number; - sunrise: number; - sunset: number; - }; -}; +import { fetchWeatherApi } from "openmeteo"; async function getWeather() { - const response = await fetch(weatherApi); - const fetchedData: WeatherRes = await response.json(); + const params = { + latitude: 25.0772, + longitude: 55.3093, + current: "temperature_2m", + }; + const url = "https://api.open-meteo.com/v1/forecast"; + const responses = await fetchWeatherApi(url, params); - const listByDay = fetchedData.list.filter((day) => - day.dt_txt.endsWith("15:00:00") - ); + // Helper function to form time ranges + // const range = (start: number, stop: number, step: number) => + // Array.from({ length: (stop - start) / step }, (_, i) => start + i * step); - return listByDay; + // Process first location. Add a for-loop for multiple locations or weather models + const response = responses[0]; + + // Attributes for timezone and location + const utcOffsetSeconds = response.utcOffsetSeconds(); + // const timezone = response.timezone(); + // const timezoneAbbreviation = response.timezoneAbbreviation(); + // const latitude = response.latitude(); + // const longitude = response.longitude(); + + const current = response.current()!; + + // Note: The order of weather variables in the URL query and the indices below need to match! + const weatherData = { + current: { + time: new Date((Number(current.time()) + utcOffsetSeconds) * 1000), + temperature2m: current.variables(0)!.value(), + }, + }; + + return weatherData.current.temperature2m; } export { getWeather }; diff --git a/client/src/components/AboutProject/AdvantageCard.tsx b/client/src/components/AboutProject/AdvantageCard.tsx new file mode 100644 index 0000000..1ae6ec7 --- /dev/null +++ b/client/src/components/AboutProject/AdvantageCard.tsx @@ -0,0 +1,21 @@ +interface Props { + title: string; + image: string; +} + +function AdvantageCard({ title, image }: Props) { + return ( +
+
+ +
+ +
+
+

{title}

+
+
+ ); +} + +export default AdvantageCard; diff --git a/client/src/components/AboutProject/PlaceCard.tsx b/client/src/components/AboutProject/PlaceCard.tsx new file mode 100644 index 0000000..deaefe7 --- /dev/null +++ b/client/src/components/AboutProject/PlaceCard.tsx @@ -0,0 +1,22 @@ +interface Props { + title: string; + desc: string; + image: string; +} + +function AboutProjectPlaceCard({ title, desc, image }: Props) { + return ( +
+
+
+
+

{title}

+
+

{desc}

+
+ +
+ ); +} + +export default AboutProjectPlaceCard; diff --git a/client/src/components/AboutProject/UnitCard.tsx b/client/src/components/AboutProject/UnitCard.tsx new file mode 100644 index 0000000..73a4235 --- /dev/null +++ b/client/src/components/AboutProject/UnitCard.tsx @@ -0,0 +1,40 @@ +interface Props { + title: string; + desc1: string; + desc2: string; + square: number; + price: number; + image: string; +} + +function UnitCard({ title, desc1, desc2, square, price, image }: Props) { + return ( +
+
+
+

{title}

+
+

{desc1}

+

{desc2}

+
+
+
+

{square} Sqft

+

+ AED {Intl.NumberFormat("ar-AE").format(price)} +

+
+
+
+
+ +
+
+ ); +} + +export default UnitCard; diff --git a/client/src/components/Button2.tsx b/client/src/components/Button2.tsx index 6bff184..f80406a 100644 --- a/client/src/components/Button2.tsx +++ b/client/src/components/Button2.tsx @@ -10,7 +10,7 @@ interface Props { const variantClasses = { primary: "bg-[#00BED7] text-white hover:bg-[#0AB3C9]", - secondary: "", + secondary: "bg-white hover:text-[#0D1922]", }; const sizeClasses = { diff --git a/client/src/components/ClassNameWrapper.tsx b/client/src/components/ClassNameWrapper.tsx new file mode 100644 index 0000000..7afa7be --- /dev/null +++ b/client/src/components/ClassNameWrapper.tsx @@ -0,0 +1,23 @@ +/* eslint-disable react-hooks/exhaustive-deps */ +import { ReactNode, useEffect, useRef } from "react"; + +interface Props { + element: ReactNode; + className: string; +} + +function ClassNameWrapper({ element, className }: Props) { + const ref = useRef(null); + + useEffect(() => { + if (!className.split(" ").length) return; + + ref.current?.children + .item(0) + ?.classList.add(...className.split(" ").filter(Boolean)); + }, []); + + return
{element}
; +} + +export default ClassNameWrapper; diff --git a/client/src/components/Footer2.tsx b/client/src/components/Footer2.tsx new file mode 100644 index 0000000..f20a0f8 --- /dev/null +++ b/client/src/components/Footer2.tsx @@ -0,0 +1,77 @@ +import FacebookIcon from "./icons/FacebookIcon"; +import InstagramIcon from "./icons/InstagramIcon"; +import LinkedInIcon from "./icons/LinkedInIcon"; +import Logo2Icon from "./icons/Logo2Icon"; +import TwitterIcon from "./icons/TwitterIcon"; +import YoutubeIcon from "./icons/YoutubeIcon"; +import SocialButton from "./SocialButton"; + +function Footer2() { + return ( +
+
+
+ +
+

+ For more information, visit our +
+ website:{" "} + + www.irth.ae + +

+
+

Follow us for more:

+
+ } + to="https://www.youtube.com/@IRTHgroup" + /> + } + to="https://www.facebook.com/irth.group" + /> + } + to="https://www.instagram.com/irth.group/" + /> + } + to="https://www.linkedin.com/company/irth-group-uae" + /> + } + to="https://twitter.com/IRTHGroup" + /> +
+
+
+
+
+
+ Map + Unit Types + About IRTH +
+
+ Favorites + Search + {/* Brochures */} +
+
+ + Privacy Policy + +
+
+
+
+ ); +} + +export default Footer2; diff --git a/client/src/components/SocialButton.tsx b/client/src/components/SocialButton.tsx new file mode 100644 index 0000000..f221836 --- /dev/null +++ b/client/src/components/SocialButton.tsx @@ -0,0 +1,21 @@ +interface Props { + icon: JSX.Element; + to?: string; + className?: string; + onClick?: () => void; +} + +function SocialButton({ icon, to, className = "", onClick }: Props) { + return ( + + {icon} + + ); +} + +export default SocialButton; diff --git a/client/src/components/icons/FacebookIcon.tsx b/client/src/components/icons/FacebookIcon.tsx new file mode 100644 index 0000000..b9beb67 --- /dev/null +++ b/client/src/components/icons/FacebookIcon.tsx @@ -0,0 +1,23 @@ +interface Props { + className?: string; +} + +function FacebookIcon({ className }: Props) { + return ( + + + + ); +} + +export default FacebookIcon; diff --git a/client/src/components/icons/InstagramIcon.tsx b/client/src/components/icons/InstagramIcon.tsx new file mode 100644 index 0000000..bd97c2d --- /dev/null +++ b/client/src/components/icons/InstagramIcon.tsx @@ -0,0 +1,23 @@ +interface Props { + className?: string; +} + +function InstagramIcon({ className }: Props) { + return ( + + + + ); +} + +export default InstagramIcon; diff --git a/client/src/components/icons/LinkedInIcon.tsx b/client/src/components/icons/LinkedInIcon.tsx new file mode 100644 index 0000000..97877a7 --- /dev/null +++ b/client/src/components/icons/LinkedInIcon.tsx @@ -0,0 +1,31 @@ +interface Props { + className?: string; +} + +function LinkedInIcon({ className }: Props) { + return ( + + + + + + ); +} + +export default LinkedInIcon; diff --git a/client/src/components/icons/Logo2Icon.tsx b/client/src/components/icons/Logo2Icon.tsx new file mode 100644 index 0000000..51cbaac --- /dev/null +++ b/client/src/components/icons/Logo2Icon.tsx @@ -0,0 +1,37 @@ +function Logo2Icon() { + return ( + + + + + + + + + + + + + + ); +} + +export default Logo2Icon; diff --git a/client/src/components/icons/TwitterIcon.tsx b/client/src/components/icons/TwitterIcon.tsx new file mode 100644 index 0000000..6cb95eb --- /dev/null +++ b/client/src/components/icons/TwitterIcon.tsx @@ -0,0 +1,31 @@ +interface Props { + className?: string; +} + +function TwitterIcon({ className }: Props) { + return ( + + + + + + ); +} + +export default TwitterIcon; diff --git a/client/src/components/icons/YoutubeIcon.tsx b/client/src/components/icons/YoutubeIcon.tsx new file mode 100644 index 0000000..9f757d4 --- /dev/null +++ b/client/src/components/icons/YoutubeIcon.tsx @@ -0,0 +1,20 @@ +function YoutubeIcon() { + return ( + + + + ); +} + +export default YoutubeIcon; diff --git a/client/src/components/masterplanPage/map/Map.tsx b/client/src/components/masterplanPage/map/Map.tsx index 3636a47..8c0f545 100644 --- a/client/src/components/masterplanPage/map/Map.tsx +++ b/client/src/components/masterplanPage/map/Map.tsx @@ -6,8 +6,6 @@ import { markers } from "../../../consts/markers"; import useMarker from "../../../store/useMarker"; import ZoomControlls from "./ZoomControlls"; import { Clouds } from "./Clouds"; -import { getWeather } from "../../../api/weather"; -import { useEffect } from "react"; import WeatherWidget from "./WeatherWidget"; const Map = () => { @@ -21,12 +19,6 @@ const Map = () => { }; }); - useEffect(() => { - getWeather().then((data) => { - console.log(data); - }); - }, []); - return (
{ useEffect(() => { getWeather().then((data) => { - const temp = Math.round(data[0].main.temp); - setTemperature(temp); + setTemperature(Math.round(data)); }); }, []); diff --git a/client/src/layouts/WithFooterLayout.tsx b/client/src/layouts/WithFooterLayout.tsx index 8f243f8..1f2bb48 100644 --- a/client/src/layouts/WithFooterLayout.tsx +++ b/client/src/layouts/WithFooterLayout.tsx @@ -7,7 +7,8 @@ import useModal from "../store/useModal"; import useFullScreen from "../store/useFullScreen"; import DesktopHeader from "../components/header/Header/DesktopHeader"; import MobileHeader from "../components/header/Header/MobileHeader"; -import Footer from "../components/Footer"; +// import Footer from "../components/Footer"; +import Footer2 from "../components/Footer2"; function WithFooterLayout() { const { modal } = useModal(); @@ -27,7 +28,7 @@ function WithFooterLayout() { {isMobile ? : } {modal} -