-
Notifications
You must be signed in to change notification settings - Fork 1
Dark toggle mode implemented , most demanding need of an engineer #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,20 @@ | ||
| "use client" | ||
| import { Linkedin, Github, Twitter, Pentagon } from "lucide-react"; | ||
| import { Videotape } from 'lucide-react'; | ||
| import Link from "next/link"; | ||
| import { useState, useEffect } from "react"; | ||
|
|
||
| export default function Footer({ myref }: any) { | ||
| const [year, setYear] = useState<number | null>(null) | ||
|
|
||
| useEffect(() => { | ||
| setYear(new Date().getFullYear()) | ||
| }, []) | ||
|
Comment on lines
+8
to
+12
|
||
| return ( | ||
| <> | ||
| <div | ||
| ref={myref} | ||
| className="w-full mt-[100px] hover:cursor-pointer h-auto p-3 z-40 flex flex-col items-center" | ||
| className="w-full mt-[100px] hover:cursor-pointer h-auto p-3 z-40 flex flex-col items-center dark:text-gray-200" | ||
| > | ||
| <div className="md:w-[90%] w-full h-[90%] mt-6 flex justify-around md:flex flex-wrap"> | ||
| <div className="w-[500px] h-full p-7 flex flex-col space-y-5"> | ||
|
|
@@ -37,7 +44,7 @@ export default function Footer({ myref }: any) { | |
|
|
||
| <div> | ||
| <p className=""> | ||
| © {new Date().getFullYear()} Callify. all rights reserved | ||
| © {year ?? ""} Callify. all rights reserved | ||
| </p> | ||
| </div> | ||
| </div> | ||
|
|
@@ -60,7 +67,7 @@ export default function Footer({ myref }: any) { | |
| </div> | ||
|
|
||
| <div className="w-full h-auto mt-7 overflow-hidden flex items-center justify-center"> | ||
| <h1 className="font-bold md:text-[120px] sm:text-[100px] text-[50px] text-center mt-10 md:mt-24 bg-gradient-to-b from-neutral-950 to-yellow-200 bg-clip-text text-transparent"> | ||
| <h1 className="font-bold md:text-[120px] sm:text-[100px] text-[50px] text-center mt-10 md:mt-24 bg-gradient-to-b from-neutral-950 to-yellow-200 dark:from-white dark:to-yellow-400 bg-clip-text text-transparent"> | ||
| Callify | ||
| </h1> | ||
| </div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| "use client" | ||
|
|
||
| import { ThemeProvider as NextThemesProvider } from "next-themes" | ||
| import { type ReactNode } from "react" | ||
|
|
||
| export function ThemeProvider({ children }: { children: ReactNode }) { | ||
| return ( | ||
| <NextThemesProvider | ||
| attribute="class" | ||
| defaultTheme="light" | ||
| enableSystem={false} | ||
| disableTransitionOnChange={false} | ||
| > | ||
| {children} | ||
| </NextThemesProvider> | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| "use client" | ||
|
|
||
| import { useTheme } from "next-themes" | ||
| import { Sun, Moon } from "lucide-react" | ||
| import { useEffect, useState } from "react" | ||
|
|
||
| export function ThemeToggle() { | ||
| const { resolvedTheme, setTheme } = useTheme() | ||
| const [mounted, setMounted] = useState(false) | ||
|
|
||
| useEffect(() => { | ||
| setMounted(true) | ||
| }, []) | ||
|
|
||
| if (!mounted) { | ||
| // Return a button placeholder with same dimensions to prevent hydration mismatch | ||
| return ( | ||
| <button | ||
| className="p-2 rounded-lg hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors" | ||
| aria-label="Toggle theme" | ||
| disabled | ||
| > | ||
| <span className="block h-5 w-5" /> | ||
| </button> | ||
| ) | ||
| } | ||
|
|
||
| return ( | ||
| <button | ||
| onClick={() => setTheme(resolvedTheme === "dark" ? "light" : "dark")} | ||
| className="p-2 rounded-lg hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors" | ||
| aria-label="Toggle theme" | ||
| > | ||
| {resolvedTheme === "dark" ? ( | ||
| <Sun className="h-5 w-5 text-yellow-400" /> | ||
| ) : ( | ||
| <Moon className="h-5 w-5 text-slate-700" /> | ||
| )} | ||
| </button> | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,28 +1,37 @@ | ||||||
| "use client" | ||||||
| import "../globals.css" | ||||||
| import Link from "next/link" | ||||||
| import { useRef, useEffect } from "react" | ||||||
|
|
||||||
| export function TopPagecontent(){ | ||||||
| const videoRef = useRef<HTMLVideoElement>(null) | ||||||
|
|
||||||
| useEffect(() => { | ||||||
| if (videoRef.current) { | ||||||
| videoRef.current.muted = true | ||||||
| } | ||||||
| }, []) | ||||||
| return( | ||||||
| <> | ||||||
| <div className="md:w-[60%] w-full h-auto p-2 flex flex-col items-center space-y-4"> | ||||||
| <h1 className="md:text-[70px] text-[34px] font-bold text-black maintext text-center">Video calls that just</h1> | ||||||
| <h1 className="md:text-[70px] text-[34px] font-bold text-black dark:text-white maintext text-center">Video calls that just</h1> | ||||||
| <h1 className="md:text-[70px] text-[40px] font-bold text-orange-500 maintext text-center">Works.</h1> | ||||||
|
|
||||||
| <div className="md:w-[70%] w-full"> | ||||||
| <p className="md:text-[18px] text-[15px] font-light text-center text-slate-600"> | ||||||
| <p className="md:text-[18px] text-[15px] font-light text-center text-slate-600 dark:text-slate-400"> | ||||||
| One link. No installs. No accounts for guests. Instant peer-to-peer | ||||||
| video calls powered by WebRTC private, fast, and free to start. | ||||||
| Create rooms and start instantly | ||||||
| </p> | ||||||
| </div> | ||||||
|
|
||||||
| <div className="md:flex md:flex-row md:space-y-0 flex-col space-y-6 items-center justify-center space-x-7 mt-[50px]"> | ||||||
| <Link href={"/roomsection"}><button className="text-white w-full bg-amber-600 font-bold rounded-lg p-3">Start a free call</button></Link> | ||||||
| <Link href={"https://github.com/SuperexMack/Callify"}><button className="text-slate-500 md:w-auto hover:cursor-pointer w-full hover:text-black font-bold mt-5 md:mt-0 p-2">Contribute to it</button></Link> | ||||||
| <Link href={"/roomsection"} className="text-white w-full bg-amber-600 font-bold rounded-lg p-3 text-center">Start a free call</Link> | ||||||
| <Link href={"https://github.com/SuperexMack/Callify"} className="text-slate-500 md:w-auto hover:cursor-pointer w-full hover:text-black dark:hover:text-white font-bold mt-5 md:mt-0 p-2 text-center">Contribute to it</Link> | ||||||
| </div> | ||||||
|
|
||||||
| <div className="p-2 md:w-[70%] w-full md:h-[500px] h-[200px] md:mt-3 flex items-center justify-center"> | ||||||
| <video muted autoPlay={true} loop src={"/videostream.mp4"}></video> | ||||||
| <video ref={videoRef} autoPlay loop playsInline src={"/videostream.mp4"}></video> | ||||||
|
||||||
| <video ref={videoRef} autoPlay loop playsInline src={"/videostream.mp4"}></video> | |
| <video ref={videoRef} autoPlay loop playsInline muted src={"/videostream.mp4"}></video> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -63,28 +63,28 @@ export default function() { | |||||
| <> | ||||||
| <div className="w-full h-auto flex flex-col items-center justify-center"> | ||||||
|
|
||||||
| <div className="md:w-[50%] w-full flex flex-col mt-[9rem] items-center space-y-9 "> | ||||||
| <div className="md:w-[50%] w-full flex flex-col mt-[9rem] items-center space-y-9 dark:text-white"> | ||||||
|
|
||||||
| <div className="w-full p-2"> | ||||||
| <h1 className="md:text-[40px] text-[35px] maintext text-center">Video calls and meetings for everyone</h1> | ||||||
| </div> | ||||||
|
|
||||||
| <div className="md:w-[60%] w-full"> | ||||||
| <p className="text-[20px] text-center">Connect to each other to share thoughts and memories or for creatng future</p> | ||||||
| <p className="text-[20px] text-center dark:text-gray-300">Connect to each other to share thoughts and memories or for creatng future</p> | ||||||
|
||||||
| <p className="text-[20px] text-center dark:text-gray-300">Connect to each other to share thoughts and memories or for creatng future</p> | |
| <p className="text-[20px] text-center dark:text-gray-300">Connect to each other to share thoughts and memories or for creating future</p> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR adds TypeScript-related devDependencies (
@types/node,ts-node,tsx,typescript) to the backend, but the backend has no TypeScript files (onlyapp.js). These packages appear unrelated to the dark mode feature described in this PR. Adding"type": "module"and thedevscript can be justified as a bug fix (sinceapp.jsalready uses ES module syntax), but the TypeScript toolchain deps add unnecessary bloat to the backend's devDependencies with no current use case.