diff --git a/src/app/globals.css b/src/app/globals.css index 1f3597b..1477ae1 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -13,11 +13,23 @@ animation-timing-function: linear(0.2, 0.8, 1); } 50% { - transform: translate(0px, -280px) scale(1.18, 0.9); + transform: translate(0px, -180px) scale(1.18, 0.9); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); } } +@keyframes window-popup { + 0% { + transform: scale(0, 0.03); + } + 40% { + transform: scale(1, 0.03); + } + 100% { + transform: scale(1, 1); + } +} + h2 { @apply text-2xl font-bold } diff --git a/src/app/page.tsx b/src/app/page.tsx index 8fbac58..d5870bc 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -5,9 +5,10 @@ import HomeText from "@/components/home-text.mdx" import Link from "next/link"; import { FakeWindow } from "@/components/windows"; +import Taskbar from "@/components/taskbar"; export default function Home() { - return ( + return (<>
@@ -34,5 +35,5 @@ export default function Home() {
- ); + ); } diff --git a/src/components/client-windows.tsx b/src/components/client-windows.tsx new file mode 100644 index 0000000..822fb2b --- /dev/null +++ b/src/components/client-windows.tsx @@ -0,0 +1,81 @@ +'use client' + +import { Icon } from "@iconify/react"; +import clsx from "clsx"; +import { useState, useRef } from "react"; + +export const FakeRelativeWindow = ({ + windowText, className, draggable, children +}: { + windowText: string, + className?: string, + draggable?: boolean + children: React.ReactNode +}) => { + const [isMinimized, setMinimize] = useState(false); + const [offset, setOffset] = useState({ x: 0, y: 0 }); + const popupRef = useRef(null); + const pos = useRef({ + dragging: false, + mouseX: 0, + mouseY: 0, + x: 0, + y: 0 + }); + + const toggleMinimize = () => setMinimize(!isMinimized); + + const onMouseDown = (e: React.MouseEvent) => { + if (popupRef.current) { + pos.current.dragging = true; + pos.current.mouseX = e.clientX; + pos.current.mouseY = e.clientY; + pos.current.x = offset.x; + pos.current.y = offset.y; + document.body.style.userSelect = "none"; + } + window.addEventListener("mousemove", onMouseMove); + window.addEventListener("mouseup", onMouseUp); + }; + + const onMouseUp = () => { + pos.current.dragging = false; + document.body.style.userSelect = ""; + window.removeEventListener("mousemove", onMouseMove); + window.removeEventListener("mouseup", onMouseUp); + }; + + const onMouseMove = (e: MouseEvent) => { + if (pos.current.dragging && popupRef.current) { + const dx = e.clientX - pos.current.mouseX; + const dy = e.clientY - pos.current.mouseY; + const newX = pos.current.x + dx; + const newY = pos.current.y + dy; + popupRef.current.style.transform = `translate(${newX}px, ${newY}px)`; + setOffset({ x: newX, y: newY }); + } + }; + + return ( +
+
+
+
+ {windowText} +
+
+ +
+
+
+
+ {children} +
+
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/home-text.mdx b/src/components/home-text.mdx index 173beb5..f138911 100644 --- a/src/components/home-text.mdx +++ b/src/components/home-text.mdx @@ -1,6 +1,7 @@ import Image from "next/image" import Link from "next/link"; import { FloatingLabel } from "./floating-label"; +import { FakeRelativeWindow } from "./client-windows"; Welcome! @@ -9,17 +10,19 @@ This is our cozy little corner of the internet where we run a bunch of services We've got tools and resources for us but some we provide it for you, stuff that just works and doesn't burn our wallet.
- - Nola - + + + Nola + +
## About Me @@ -60,16 +63,18 @@ We aspire to blend creativity and technical mastery to shape products that empow - Integrate artificial intelligence into digital products, creating smart, helpful, and engaging features that elevate the overall value and interactivity of applications.
- - Nola - + + + Nola + +
## Why Nonsense diff --git a/src/components/sosmed.tsx b/src/components/sosmed.tsx index 7d2c1c8..3f1831c 100644 --- a/src/components/sosmed.tsx +++ b/src/components/sosmed.tsx @@ -37,12 +37,11 @@ export const Sosmed = () => { return (
{sosmeds.map((sosmed) => ( - + diff --git a/src/components/taskbar.tsx b/src/components/taskbar.tsx new file mode 100644 index 0000000..2c04dab --- /dev/null +++ b/src/components/taskbar.tsx @@ -0,0 +1,18 @@ +'use client' + +const Taskbar = () => { + return ( +
+
+ NolaOS +
+
+ +
+
+ ) +} + +export default Taskbar; \ No newline at end of file diff --git a/tailwind.config.ts b/tailwind.config.ts index a32538a..8fdcebd 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -24,6 +24,13 @@ const config: Config = { }, animation: { "silly-bouncing": 'silly-bounce 0.8s infinite', + 'window-popup': 'window-popup 1s' + }, + keyframes: { + "fade-in-half": { + '0%, 50%': { opacity: "0" }, + '100%': { opacity: '1' }, + } } }, plugins: [],