-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Add Aossie github link on navbar (#16) #17
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: main
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| import { motion } from "framer-motion"; | ||
| import { useEffect, useRef, useState } from "react"; | ||
| import { useOS } from "../../hooks/useOS"; | ||
|
|
||
| const ShuffleHero = () => { | ||
| // Function to scroll to downloads section | ||
| const scrollToDownloads = () => { | ||
| const downloadsSection = document.getElementById('downloads-section'); | ||
| if (downloadsSection) { | ||
|
|
@@ -13,6 +13,23 @@ const ShuffleHero = () => { | |
| } | ||
| }; | ||
|
|
||
| const os = useOS(); | ||
|
|
||
| const getButtonContent = () => { | ||
| switch (os) { | ||
| case "mac": | ||
| return { text: "Download for Mac", href: "#mac-download-placeholder" }; | ||
| case "windows": | ||
| return { text: "Download for Windows", href: "#windows-download-placeholder" }; | ||
| case "linux": | ||
| return { text: "Download for Linux (.deb)", href: "#linux-download-placeholder" }; | ||
|
Comment on lines
+21
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Externalize the new CTA copy. The OS-specific labels and As per coding guidelines, "Internationalization: User-visible strings should be externalized to resource files (i18n)". Also applies to: 119-119 🤖 Prompt for AI Agents |
||
| default: | ||
| return { text: "Download", href: undefined }; | ||
| } | ||
| }; | ||
|
|
||
| const btnContent = getButtonContent(); | ||
|
|
||
| return ( | ||
| <section className="w-full px-8 py-12 grid grid-cols-1 md:grid-cols-2 items-center gap-8 max-w-6xl mx-auto bg-white dark:bg-black transition-colors duration-300"> | ||
| <div className="font-['Inter',_sans-serif]"> | ||
|
|
@@ -43,33 +60,63 @@ const ShuffleHero = () => { | |
| Advanced desktop gallery application powered by Tauri, React, and Rust with a Python backend for intelligent image analysis and seamless management. | ||
| </motion.p> | ||
|
|
||
| <div className="flex space-x-4"> | ||
| {/* Download button - scrolls to downloads section */} | ||
| <motion.button | ||
| onClick={scrollToDownloads} | ||
| initial={{ scale: 0.9, opacity: 0 }} | ||
| animate={{ scale: 1, opacity: 1 }} | ||
| transition={{ duration: 0.5, delay: 0.6 }} | ||
| whileHover={{ scale: 1.03 }} | ||
| whileTap={{ scale: 0.98 }} | ||
| className="bg-gradient-to-r from-yellow-500 to-green-500 text-white font-medium py-2 px-6 rounded transition-all shadow-sm hover:shadow-md" | ||
| > | ||
| Download | ||
| </motion.button> | ||
|
|
||
| {/* View Docs button - links to documentation */} | ||
| <motion.a | ||
| href="https://aossie-org.github.io/PictoPy/" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| initial={{ scale: 0.9, opacity: 0 }} | ||
| animate={{ scale: 1, opacity: 1 }} | ||
| transition={{ duration: 0.5, delay: 0.7 }} | ||
| whileHover={{ scale: 1.03 }} | ||
| whileTap={{ scale: 0.98 }} | ||
| className="border border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-200 font-medium py-2 px-6 rounded transition-all hover:border-teal-500 hover:text-teal-500" | ||
| <div className="flex flex-col items-start gap-3"> | ||
| <div className="flex space-x-4"> | ||
| {/* Dynamic Download button */} | ||
| {os === "unknown" ? ( | ||
| <motion.button | ||
| onClick={scrollToDownloads} | ||
| initial={{ scale: 0.9, opacity: 0 }} | ||
| animate={{ scale: 1, opacity: 1 }} | ||
| transition={{ duration: 0.5, delay: 0.6 }} | ||
| whileHover={{ scale: 1.03 }} | ||
| whileTap={{ scale: 0.98 }} | ||
| className="bg-gradient-to-r from-yellow-500 to-green-500 text-white font-medium py-2 px-6 rounded transition-all shadow-sm hover:shadow-md" | ||
| > | ||
| {btnContent.text} | ||
| </motion.button> | ||
| ) : ( | ||
| <motion.a | ||
| href={btnContent.href} | ||
| initial={{ scale: 0.9, opacity: 0 }} | ||
| animate={{ scale: 1, opacity: 1 }} | ||
| transition={{ duration: 0.5, delay: 0.6 }} | ||
| whileHover={{ scale: 1.03 }} | ||
| whileTap={{ scale: 0.98 }} | ||
| className="bg-gradient-to-r from-yellow-500 to-green-500 text-white font-medium py-2 px-6 rounded transition-all shadow-sm hover:shadow-md" | ||
| > | ||
| {btnContent.text} | ||
| </motion.a> | ||
| )} | ||
|
|
||
| {/* View Docs button - links to documentation */} | ||
| <motion.a | ||
| href="https://aossie-org.github.io/PictoPy/" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| initial={{ scale: 0.9, opacity: 0 }} | ||
| animate={{ scale: 1, opacity: 1 }} | ||
| transition={{ duration: 0.5, delay: 0.7 }} | ||
| whileHover={{ scale: 1.03 }} | ||
| whileTap={{ scale: 0.98 }} | ||
| className="border border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-200 font-medium py-2 px-6 rounded transition-all hover:border-teal-500 hover:text-teal-500 inline-block text-center flex items-center justify-center" | ||
| > | ||
| View Docs | ||
| </motion.a> | ||
| </div> | ||
|
|
||
| <motion.a | ||
| href="#downloads-section" | ||
| onClick={(e) => { | ||
| e.preventDefault(); | ||
| scrollToDownloads(); | ||
| }} | ||
| initial={{ opacity: 0 }} | ||
| animate={{ opacity: 1 }} | ||
| transition={{ duration: 0.5, delay: 0.8 }} | ||
| className="text-xs md:text-sm text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200 transition-colors underline underline-offset-2" | ||
| > | ||
| View Docs | ||
| Looking for another OS? | ||
| </motion.a> | ||
| </div> | ||
| </div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import React, { useState, useEffect } from "react"; | ||
| import { Link } from "react-router-dom"; | ||
| import { Menu, X } from "lucide-react"; | ||
| import { Menu, X, Github } from "lucide-react"; | ||
| import { Button } from "@/components/ui/button"; | ||
| import YourLogo from "@/assets/38881995.png"; // Update this import path to your logo | ||
|
|
||
|
|
@@ -146,6 +146,19 @@ const Navbar: React.FC = () => { | |
| <div className="hidden md:flex items-center space-x-8"> | ||
| <NavLink to="/">Home</NavLink> | ||
|
|
||
| {/* GitHub Repository Link */} | ||
| <a | ||
| href="https://github.com/AOSSIE-Org/PictoPy" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| className="text-gray-800 dark:text-gray-300 | ||
| hover:text-black dark:hover:text-white | ||
| transition-colors duration-300" | ||
| aria-label="AOSSIE PictoPy GitHub Repository" | ||
| > | ||
| <Github className="h-5 w-5" /> | ||
| </a> | ||
|
Comment on lines
+149
to
+160
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider extracting the GitHub URL to a constant. The GitHub repository URL ♻️ Proposed refactorAdd a constant at the top of the component or in a shared constants file: const GITHUB_REPO_URL = "https://github.com/AOSSIE-Org/PictoPy";Then reference it in both links: <a
- href="https://github.com/AOSSIE-Org/PictoPy"
+ href={GITHUB_REPO_URL}
target="_blank"Also applies to: 210-221 🤖 Prompt for AI Agents |
||
|
|
||
| {/* Dark Mode Toggle Button */} | ||
| <button | ||
| onClick={() => setDarkMode(!darkMode)} | ||
|
|
@@ -194,6 +207,18 @@ const Navbar: React.FC = () => { | |
| <NavLink to="/" onClick={() => setIsOpen(false)}> | ||
| Home | ||
| </NavLink> | ||
| <a | ||
| href="https://github.com/AOSSIE-Org/PictoPy" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| className="text-gray-700 dark:text-gray-300 text-lg font-medium | ||
| hover:text-black dark:hover:text-white | ||
| transition duration-300 flex items-center space-x-2" | ||
| onClick={() => setIsOpen(false)} | ||
| > | ||
| <Github className="h-5 w-5" /> | ||
| <span>GitHub</span> | ||
| </a> | ||
|
Comment on lines
+210
to
+221
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Externalize the user-visible string for i18n. The "GitHub" text on line 220 is hardcoded. Per coding guidelines, user-visible strings should be externalized to resource files for internationalization. 🤖 Prompt for AI Agents |
||
| <NavLink to="#features" isScrollLink={true} onClick={() => setIsOpen(false)}> | ||
| Feature | ||
| </NavLink> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,26 @@ | ||||||||||||||||||||||||||||||||||||||||||
| import { useState, useEffect } from "react"; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| export type OS = "mac" | "windows" | "linux" | "unknown"; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| export const useOS = (): OS => { | ||||||||||||||||||||||||||||||||||||||||||
| const [os, setOS] = useState<OS>("unknown"); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||||||||||||||||||||||||||
| // Avoid running on server side during SSR | ||||||||||||||||||||||||||||||||||||||||||
| if (typeof window === "undefined") return; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| const userAgent = window.navigator.userAgent.toLowerCase(); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| if (userAgent.includes("mac")) { | ||||||||||||||||||||||||||||||||||||||||||
| setOS("mac"); | ||||||||||||||||||||||||||||||||||||||||||
| } else if (userAgent.includes("win")) { | ||||||||||||||||||||||||||||||||||||||||||
| setOS("windows"); | ||||||||||||||||||||||||||||||||||||||||||
| } else if (userAgent.includes("linux") && !userAgent.includes("android")) { | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exclude iOS/iPadOS from the macOS branch. Apple mobile user agents include 📱 Minimal fix const userAgent = window.navigator.userAgent.toLowerCase();
+ const isAppleMobile =
+ /iphone|ipad|ipod/.test(userAgent) ||
+ (window.navigator.platform === "MacIntel" &&
+ window.navigator.maxTouchPoints > 1);
- if (userAgent.includes("mac")) {
+ if (isAppleMobile) {
+ setOS("unknown");
+ } else if (userAgent.includes("mac")) {
setOS("mac");
} else if (userAgent.includes("win")) {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
| setOS("linux"); | ||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||
| setOS("unknown"); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| }, []); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| return os; | ||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| {"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/pages/pictopy-landing.tsx","./src/pages/demo/marqu.tsx","./src/pages/faqpage/faq.tsx","./src/pages/footer/footer.tsx","./src/pages/howitworks/howitworks.tsx","./src/pages/landing page/home1.tsx","./src/pages/landing page/navbar.tsx","./src/components/ui/bouncy card features.tsx","./src/components/ui/features.tsx","./src/components/ui/scrollprogress.tsx","./src/components/ui/smoothscroll.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/context/theme-provider.tsx","./src/lib/utils.ts"],"version":"5.7.3"} | ||
| {"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/pages/pictopy-landing.tsx","./src/pages/demo/marqu.tsx","./src/pages/faqpage/faq.tsx","./src/pages/footer/footer.tsx","./src/pages/howitworks/howitworks.tsx","./src/pages/landing page/home1.tsx","./src/pages/landing page/navbar.tsx","./src/components/ui/bouncy card features.tsx","./src/components/ui/features.tsx","./src/components/ui/scrollprogress.tsx","./src/components/ui/smoothscroll.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/context/theme-provider.tsx","./src/hooks/useos.ts","./src/lib/utils.ts"],"version":"5.7.3"} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 🧩 Analysis chain🏁 Script executed: #!/bin/bash
echo "Tracked .tsbuildinfo files:"
git ls-files | rg '(^|/)[^/]+\.tsbuildinfo$' || true
echo
echo ".gitignore rules mentioning tsbuildinfo:"
rg -n --hidden --glob '.gitignore' 'tsbuildinfo'Repository: AOSSIE-Org/PictoPy-Website Length of output: 190 Add Generated TypeScript build metadata files ( 🤖 Prompt for AI Agents |
||
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 hero download CTA now resolves to dead hashes.
#mac-download-placeholder,#windows-download-placeholder, and#linux-download-placeholderdo not match any target in the provided code.src/Pages/pictopy-landing.tsxalready owns the real release handling, and the only known in-page target here is#downloads-section, so desktop users now lose the primary download path.🧭 Safe fallback until the real release URLs are wired into this component
📝 Committable suggestion
🤖 Prompt for AI Agents