Skip to content

Commit

Permalink
gfs
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajrekwar committed Sep 8, 2024
1 parent 22d911f commit 8e45c53
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 19 deletions.
8 changes: 2 additions & 6 deletions app/components/DeviceAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const DeviceAddress: React.FC = () => {
<motion.div
initial={{ opacity: 0, x: 30 }}
animate={{ opacity: 1, x: 0 }}
transition={{ delay: 4, duration: 2 }}
transition={{ delay: 4 }}
className="flex text-xs overflow-y-hidden sm:text-sm gap-1 text-secondary justify-center items-center"
>
{/* <h2 className="text-2xl font-bold mb-4 text-center">Device Address</h2> */}
Expand All @@ -54,11 +54,7 @@ const DeviceAddress: React.FC = () => {
</motion.div>
) : (
<div className="text-center p-2">
<motion.p
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ delay: 0.1, duration: 0.2 }}
>
<motion.p initial={{ opacity: 0 }} animate={{ opacity: 1 }}>
just a moment...
</motion.p>
</div>
Expand Down
37 changes: 28 additions & 9 deletions app/components/WeatherApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const Weather: React.FC = () => {
longitude: longitude,
current_weather: true,
temperature_unit: "celsius", // or "fahrenheit" if preferred
cloud_cover: "pecent",
hourly: "cloudcover,diffuse_radiation,rain,wind_speed_10m", // Adding hourly wind speed data
wind_speed_unit: "kmh", // or "mph", "ms", "knots"
timezone: "auto",
},
};
Expand Down Expand Up @@ -55,17 +56,35 @@ const Weather: React.FC = () => {
return (
<div>
{error ? (
<motion.p
initial={{ opacity: 0, x: 30 }}
animate={{ opacity: 1, x: 0 }}
transition={{ delay: 4, duration: 2 }}
>
{error}
</motion.p>
<motion.p>{error}</motion.p>
) : weather ? (
<div className="sm:text-sm">
<motion.div>
<p className="">{weather.current_weather.temperature}°C</p>
<motion.p
initial={{ opacity: 0, x: 10 }}
animate={{ opacity: 1, x: 0 }}
transition={{ delay: 4 }}
>
{weather.current_weather.temperature}°C
</motion.p>
<motion.p
initial={{ opacity: 0, x: 10 }}
animate={{ opacity: 1, x: 0 }}
transition={{ delay: 6 }}
>
Cloud {weather.hourly.cloudcover[0]}%
</motion.p>
{/* <p>Diffuse Radiation: {weather.hourly.diffuse_radiation[0]} W/m²</p> */}
{/* <p>Rain: {weather.hourly.rain[0]} mm</p>{" "} */}
{/* Display hourly rain data */}
<motion.p
initial={{ opacity: 0, x: 30 }}
animate={{ opacity: 1, x: 0 }}
transition={{ delay: 8 }}
>
Wind {weather.hourly.wind_speed_10m[0]} km/h
</motion.p>{" "}
{/* Display hourly wind speed */}
</motion.div>
</div>
) : (
Expand Down
6 changes: 2 additions & 4 deletions app/components/homeSectionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import DeviceAddress from "./DeviceAddress";
import { AuroraBackgroundDemo } from "./BackgroundAurra";
import Weather from "./WeatherApp";



const alata = Alata({
weight: "400",
subsets: ["latin"],
Expand All @@ -29,13 +27,13 @@ export default function HomeSectionHeader() {
className=" text-secondary text-3xl sm:text-4xl md:text-5xl font-bold"
>
{/* <i className="bg-white px-[.2rem] my-1 h-[3rem] rounded border text-black not-italic"></i> */}
nee.
nee
</Link>
</div>
<div className="">
<div className="text-secondary pt-1 font-bold">
<DeviceAddress />
<Weather/>
<Weather />
</div>
</div>
</div>
Expand Down
29 changes: 29 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"framer-motion": "^11.3.31",
"lucide-react": "^0.437.0",
"next": "14.2.7",
"openmeteo": "^1.1.4",
"react": "^18",
"react-dom": "^18",
"react-markdown": "^9.0.1",
Expand Down

0 comments on commit 8e45c53

Please sign in to comment.