mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-20 16:45:10 +00:00
sign up download flow
This commit is contained in:
1 parent
b1965a6019
commit
a3b9cd71ad
20 files changed
+1067
-50
No files matched your search
@@ -9,6 +9,11 @@ import TutorialsArticle from "../pages/tutorials/article";
|
||||
import FaqIndex from "../pages/faq/index";
|
||||
import FaqArticle from "../pages/faq/article";
|
||||
import { NewsIndex, NewsPost } from "@storyteller/markdown-content";
|
||||
import Pricing from "../pages/pricing";
|
||||
import Login from "../pages/login";
|
||||
import Signup from "../pages/signup";
|
||||
import ForgotPassword from "../pages/forgot-password";
|
||||
import Welcome from "../pages/welcome";
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
@@ -27,6 +32,11 @@ export function App() {
|
||||
<Route path="/faq/:slug" element={<FaqArticle />} />
|
||||
<Route path="/news" element={<NewsIndex basePath="/news" />} />
|
||||
<Route path="/news/:slug" element={<NewsPost basePath="/news" />} />
|
||||
<Route path="/pricing" element={<Pricing />} />
|
||||
<Route path="/login" element={<Login />} />
|
||||
<Route path="/signup" element={<Signup />} />
|
||||
<Route path="/forgot-password" element={<ForgotPassword />} />
|
||||
<Route path="/welcome" element={<Welcome />} />
|
||||
</Routes>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./signup-form";
|
||||
@@ -0,0 +1,153 @@
|
||||
import { faGoogle } from "@fortawesome/free-brands-svg-icons";
|
||||
import { faEye, faEyeSlash, faSpinner } from "@fortawesome/pro-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { Button } from "@storyteller/ui-button";
|
||||
import { useState } from "react";
|
||||
import { UsersApi } from "@storyteller/api";
|
||||
|
||||
interface SignupFormProps {
|
||||
onSuccess: () => void;
|
||||
signupSource: string;
|
||||
className?: string;
|
||||
showGoogleButton?: boolean;
|
||||
autoFocus?: boolean;
|
||||
}
|
||||
|
||||
export const SignupForm = ({
|
||||
onSuccess,
|
||||
signupSource,
|
||||
className = "",
|
||||
showGoogleButton = true,
|
||||
autoFocus = false,
|
||||
}: SignupFormProps) => {
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const handleSignup = async () => {
|
||||
setError(null);
|
||||
|
||||
if (!email || !password) {
|
||||
setError("All fields are required");
|
||||
return;
|
||||
}
|
||||
|
||||
if (password.length < 8) {
|
||||
setError("Password must be at least 8 characters");
|
||||
return;
|
||||
}
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
const api = new UsersApi();
|
||||
|
||||
// Generate a username from the email
|
||||
const emailPrefix = email.split("@")[0].replace(/[^a-zA-Z0-9]/g, "");
|
||||
// Ensure we don't exceed max length (7 chars from email + 3 digits = 10 total)
|
||||
const truncatedPrefix = emailPrefix.substring(0, 7);
|
||||
const randomSuffix = Math.floor(Math.random() * 900) + 100; // 100-999
|
||||
const generatedUsername = `${truncatedPrefix}${randomSuffix}`;
|
||||
|
||||
const response = await api.Signup({
|
||||
username: generatedUsername,
|
||||
email,
|
||||
password,
|
||||
passwordConfirmation: password,
|
||||
signupSource,
|
||||
});
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
if (response.success) {
|
||||
window.dispatchEvent(new Event("auth-change"));
|
||||
onSuccess();
|
||||
} else {
|
||||
setError(response.errorMessage || "Failed to create account");
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`space-y-4 ${className}`}>
|
||||
{showGoogleButton && (
|
||||
<>
|
||||
<Button
|
||||
className="w-full bg-white text-black hover:bg-gray-100 border-none justify-center gap-3 font-medium h-12"
|
||||
onClick={() => {}}
|
||||
>
|
||||
<FontAwesomeIcon icon={faGoogle} className="text-lg" />
|
||||
Continue with Google
|
||||
</Button>
|
||||
|
||||
<div className="relative flex items-center justify-center py-2">
|
||||
<div className="absolute inset-0 flex items-center">
|
||||
<div className="w-full border-t border-white/10"></div>
|
||||
</div>
|
||||
<span className="relative bg-[#1C1C20] px-4 text-xs text-white/40 uppercase tracking-widest">
|
||||
or
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{error && (
|
||||
<div className="bg-red-500/10 border border-red-500/20 text-red-400 px-4 py-3 rounded-xl text-sm text-center animate-in fade-in slide-in-from-top-2">
|
||||
{error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="space-y-2">
|
||||
<label className="text-xs font-bold text-white/60 uppercase tracking-wide ml-1">
|
||||
Email
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
placeholder="you@example.com"
|
||||
autoFocus={autoFocus}
|
||||
className="w-full bg-black/20 border border-white/10 focus:border-primary/50 rounded-xl px-4 py-3 text-white placeholder-white/20 outline-none transition-colors"
|
||||
onKeyDown={(e) => e.key === "Enter" && handleSignup()}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<label className="text-xs font-bold text-white/60 uppercase tracking-wide ml-1">
|
||||
Password
|
||||
</label>
|
||||
<div className="relative">
|
||||
<input
|
||||
type={showPassword ? "text" : "password"}
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
placeholder="Min. 8 characters"
|
||||
className="w-full bg-black/20 border border-white/10 focus:border-primary/50 rounded-xl px-4 py-3 text-white placeholder-white/20 outline-none transition-colors pr-12"
|
||||
onKeyDown={(e) => e.key === "Enter" && handleSignup()}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
className="absolute right-4 top-1/2 -translate-y-1/2 text-white/30 hover:text-white/60 transition-colors"
|
||||
tabIndex={-1}
|
||||
>
|
||||
<FontAwesomeIcon icon={showPassword ? faEyeSlash : faEye} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
className="w-full bg-primary hover:bg-primary-600 text-white border-none justify-center font-bold h-12 mt-2"
|
||||
onClick={handleSignup}
|
||||
disabled={isLoading}
|
||||
>
|
||||
{isLoading ? (
|
||||
<FontAwesomeIcon icon={faSpinner} spin />
|
||||
) : (
|
||||
"Create Account"
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -17,7 +17,7 @@ export const DiscordButton = ({
|
||||
|
||||
return (
|
||||
<Button
|
||||
className={`relative z-10 ${sizeClasses} font-semibold transition-all duration-300 shadow-lg hover:shadow-blue-500/25 ${className}`}
|
||||
className={`relative z-10 ${sizeClasses} font-semibold transition-all duration-300 shadow-lg bg-white text-black hover:bg-gray-200 ${className}`}
|
||||
icon={faDiscord}
|
||||
as="link"
|
||||
href={SOCIAL_LINKS.DISCORD}
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
import { faGoogle } from "@fortawesome/free-brands-svg-icons";
|
||||
import {
|
||||
faTimes,
|
||||
faEnvelope,
|
||||
faArrowLeft,
|
||||
} from "@fortawesome/pro-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { useEffect, useState } from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
import { Button } from "@storyteller/ui-button";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { SignupForm } from "./auth";
|
||||
|
||||
interface DownloadModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const DownloadModal = ({ isOpen, onClose }: DownloadModalProps) => {
|
||||
const navigate = useNavigate();
|
||||
const [isMounted, setIsMounted] = useState(false);
|
||||
const [isVisible, setIsVisible] = useState(false);
|
||||
const [view, setView] = useState<"menu" | "signup">("menu");
|
||||
|
||||
useEffect(() => {
|
||||
setIsMounted(true);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
setIsVisible(true);
|
||||
document.body.style.overflow = "hidden";
|
||||
} else {
|
||||
const timer = setTimeout(() => {
|
||||
setIsVisible(false);
|
||||
// Reset state after animation
|
||||
setView("menu");
|
||||
}, 300);
|
||||
document.body.style.overflow = "unset";
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, [isOpen]);
|
||||
|
||||
if (!isMounted) return null;
|
||||
|
||||
if (!isVisible && !isOpen) return null;
|
||||
|
||||
return createPortal(
|
||||
<div
|
||||
className={`fixed inset-0 z-50 flex items-center justify-center px-4 transition-all duration-300 ${
|
||||
isOpen
|
||||
? "opacity-100 backdrop-blur-lg"
|
||||
: "opacity-0 backdrop-blur-none pointer-events-none"
|
||||
}`}
|
||||
>
|
||||
{/* Backdrop */}
|
||||
<div
|
||||
className="absolute inset-0 bg-black/80 transition-opacity duration-300"
|
||||
onClick={onClose}
|
||||
/>
|
||||
|
||||
{/* Modal Content */}
|
||||
<div
|
||||
className={`relative w-full max-w-md bg-[#1C1C20] border border-white/10 rounded-3xl p-8 shadow-2xl transform transition-all duration-300 ${
|
||||
isOpen ? "scale-100 translate-y-0" : "scale-95 translate-y-8"
|
||||
}`}
|
||||
>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="absolute top-4 right-4 w-8 h-8 flex items-center justify-center rounded-full bg-white/5 hover:bg-white/10 text-white/40 hover:text-white/80 transition-colors z-20"
|
||||
>
|
||||
<FontAwesomeIcon icon={faTimes} />
|
||||
</button>
|
||||
|
||||
{view === "signup" && (
|
||||
<button
|
||||
onClick={() => setView("menu")}
|
||||
className="absolute top-4 left-4 w-8 h-8 flex items-center justify-center rounded-full bg-white/5 hover:bg-white/10 text-white/40 hover:text-white/80 transition-colors z-20"
|
||||
>
|
||||
<FontAwesomeIcon icon={faArrowLeft} />
|
||||
</button>
|
||||
)}
|
||||
|
||||
<div className="text-center mb-8">
|
||||
<div className="w-16 h-16 bg-primary/20 rounded-2xl flex items-center justify-center mx-auto mb-6 text-primary">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="h-8 w-8 animate-bounce"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth={2}
|
||||
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<h2 className="text-2xl font-bold text-white mb-2">
|
||||
Downloading ArtCraft...
|
||||
</h2>
|
||||
<p className="text-white/60 text-sm">
|
||||
Your download has started.
|
||||
<br />
|
||||
While you wait, create an account to store your creations.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{view === "menu" ? (
|
||||
<div className="space-y-3">
|
||||
<Button
|
||||
className="w-full bg-white text-black hover:bg-gray-100 border-none justify-center gap-3 font-medium h-12"
|
||||
onClick={() => {}} // Dummy op
|
||||
>
|
||||
<FontAwesomeIcon icon={faGoogle} className="text-lg" />
|
||||
Continue with Google
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
className="w-full bg-white/5 hover:bg-white/10 text-white border-white/10 justify-center gap-3 font-medium h-12"
|
||||
onClick={() => setView("signup")}
|
||||
>
|
||||
<FontAwesomeIcon icon={faEnvelope} className="text-lg" />
|
||||
Sign up with Email
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<SignupForm
|
||||
onSuccess={() => {
|
||||
onClose();
|
||||
navigate("/welcome");
|
||||
}}
|
||||
signupSource="artcraft"
|
||||
showGoogleButton={false}
|
||||
autoFocus={true}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className="mt-8 text-center pt-6 border-t border-white/5">
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="text-white/40 text-xs hover:text-white/60 transition-colors font-medium"
|
||||
>
|
||||
I already have an account
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>,
|
||||
document.body,
|
||||
);
|
||||
};
|
||||
@@ -1,8 +1,16 @@
|
||||
import { Disclosure } from "@headlessui/react";
|
||||
import {
|
||||
Disclosure,
|
||||
Menu,
|
||||
MenuButton,
|
||||
MenuItem,
|
||||
MenuItems,
|
||||
Transition,
|
||||
} from "@headlessui/react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useEffect, useState, Fragment } from "react";
|
||||
import { Link, useLocation } from "react-router-dom";
|
||||
import { DiscordButton } from "../discord-button";
|
||||
import { Button } from "@storyteller/ui-button";
|
||||
import { UsersApi, UserInfo } from "@storyteller/api";
|
||||
|
||||
const NAV_ITEMS = [
|
||||
{ name: "Home", href: "/" },
|
||||
@@ -10,12 +18,51 @@ const NAV_ITEMS = [
|
||||
{ name: "News", href: "/news" },
|
||||
{ name: "FAQ", href: "/faq" },
|
||||
{ name: "Press Kit", href: "/press-kit" },
|
||||
{ name: "Download", href: "/download" },
|
||||
];
|
||||
|
||||
export default function Navbar() {
|
||||
const [scrolled, setScrolled] = useState(false);
|
||||
const location = useLocation();
|
||||
// Underline hover handled purely via CSS
|
||||
const [user, setUser] = useState<UserInfo | undefined>(undefined);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
// Check session on mount
|
||||
// Check session on mount and when auth changes or location changes
|
||||
useEffect(() => {
|
||||
const checkSession = async () => {
|
||||
const api = new UsersApi();
|
||||
const response = await api.GetSession();
|
||||
if (
|
||||
response.success &&
|
||||
response.data &&
|
||||
response.data.loggedIn &&
|
||||
response.data.user
|
||||
) {
|
||||
setUser(response.data.user);
|
||||
} else {
|
||||
setUser(undefined);
|
||||
}
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
||||
checkSession();
|
||||
|
||||
const handleAuthChange = () => {
|
||||
setIsLoading(true);
|
||||
checkSession();
|
||||
};
|
||||
|
||||
window.addEventListener("auth-change", handleAuthChange);
|
||||
return () => window.removeEventListener("auth-change", handleAuthChange);
|
||||
}, [location.pathname]);
|
||||
|
||||
const handleLogout = async () => {
|
||||
const api = new UsersApi();
|
||||
await api.Logout();
|
||||
// Reload to clear state/cache
|
||||
window.location.href = "/";
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
@@ -89,21 +136,99 @@ export default function Navbar() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<div className="hidden md:ml-4 md:flex md:shrink-0 md:items-center">
|
||||
{/* <Button as="link" href="/download">
|
||||
Download
|
||||
</Button> */}
|
||||
<DiscordButton
|
||||
small
|
||||
className="bg-white text-black hover:bg-white/90"
|
||||
/>
|
||||
</div>
|
||||
<div className="-ml-2 flex items-center md:hidden">
|
||||
{/* Mobile menu button */}
|
||||
<DiscordButton
|
||||
className="text-sm bg-white text-black hover:bg-white/90"
|
||||
small
|
||||
/>
|
||||
{isLoading ? (
|
||||
// Loading placeholder
|
||||
<div className="hidden md:ml-4 md:flex items-center gap-6 opacity-0"></div>
|
||||
) : user ? (
|
||||
// Logged In State
|
||||
<div className="hidden md:ml-4 md:flex items-center gap-6">
|
||||
<Link
|
||||
to="/pricing"
|
||||
className="text-[15px] font-semibold text-white/60 hover:text-white transition-colors"
|
||||
>
|
||||
Pricing
|
||||
</Link>
|
||||
|
||||
<Menu as="div" className="relative ml-3">
|
||||
<div>
|
||||
<MenuButton className="flex rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800">
|
||||
<span className="sr-only">Open user menu</span>
|
||||
<img
|
||||
className="h-8 w-8 rounded-full border border-white/10"
|
||||
src={`https://www.gravatar.com/avatar/${user.email_gravatar_hash}?d=mp`}
|
||||
alt=""
|
||||
/>
|
||||
</MenuButton>
|
||||
</div>
|
||||
<Transition
|
||||
as={Fragment}
|
||||
enter="transition ease-out duration-100"
|
||||
enterFrom="transform opacity-0 scale-95"
|
||||
enterTo="transform opacity-100 scale-100"
|
||||
leave="transition ease-in duration-75"
|
||||
leaveFrom="transform opacity-100 scale-100"
|
||||
leaveTo="transform opacity-0 scale-95"
|
||||
>
|
||||
<MenuItems className="absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-[#1C1C20] py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none border border-white/10">
|
||||
<div className="px-4 py-3 border-b border-white/10">
|
||||
<p className="text-sm text-white font-semibold truncate">
|
||||
{user.display_name || user.username}
|
||||
</p>
|
||||
</div>
|
||||
<MenuItem>
|
||||
{({ active }) => (
|
||||
<button
|
||||
onClick={handleLogout}
|
||||
className={twMerge(
|
||||
active ? "bg-white/5" : "",
|
||||
"block w-full text-left px-4 py-2 text-sm text-white/70",
|
||||
)}
|
||||
>
|
||||
Sign out
|
||||
</button>
|
||||
)}
|
||||
</MenuItem>
|
||||
</MenuItems>
|
||||
</Transition>
|
||||
</Menu>
|
||||
</div>
|
||||
) : (
|
||||
// Logged Out State
|
||||
<div className="hidden md:ml-4 md:flex md:shrink-0 md:items-center gap-6">
|
||||
<Link
|
||||
to="/pricing"
|
||||
className="text-[15px] font-semibold text-white/60 hover:text-white transition-colors"
|
||||
>
|
||||
Pricing
|
||||
</Link>
|
||||
<Button
|
||||
as="link"
|
||||
href="/signup"
|
||||
className="bg-white text-black hover:bg-white/90 text-sm font-semibold px-4 py-2 h-auto rounded-lg shadow-md"
|
||||
>
|
||||
Sign up
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Mobile Menu Button - simplified for now */}
|
||||
<div className="-ml-2 flex items-center md:hidden gap-3">
|
||||
{!user && (
|
||||
<Button
|
||||
as="link"
|
||||
href="/signup"
|
||||
className="bg-white text-black hover:bg-white/90 text-xs font-semibold px-3 py-1.5 h-auto rounded-lg"
|
||||
>
|
||||
Sign up
|
||||
</Button>
|
||||
)}
|
||||
{user && (
|
||||
<img
|
||||
className="h-8 w-8 rounded-full border border-white/10"
|
||||
src={`https://www.gravatar.com/avatar/${user.email_gravatar_hash}?d=mp`}
|
||||
alt=""
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
import { faArrowLeft, faEnvelope } from "@fortawesome/pro-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { Button } from "@storyteller/ui-button";
|
||||
import { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
const ForgotPassword = () => {
|
||||
const [email, setEmail] = useState("");
|
||||
const [submitted, setSubmitted] = useState(false);
|
||||
|
||||
return (
|
||||
<div className="relative min-h-screen bg-[#101014] text-white bg-dots flex flex-col">
|
||||
<div className="dotted-pattern absolute inset-0 z-[0] opacity-30" />
|
||||
|
||||
<main className="relative z-10 flex-1 flex items-center justify-center p-4">
|
||||
<div className="w-full max-w-md bg-[#1C1C20] border border-white/10 rounded-3xl p-8 shadow-2xl">
|
||||
<div className="text-center mb-8">
|
||||
<h1 className="text-2xl font-bold mb-2">Reset Password</h1>
|
||||
<p className="text-white/60 text-sm">Enter your email to receive reset instructions</p>
|
||||
</div>
|
||||
|
||||
{!submitted ? (
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<label className="text-xs font-bold text-white/60 uppercase tracking-wide ml-1">Email</label>
|
||||
<input
|
||||
type="email"
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
placeholder="you@example.com"
|
||||
className="w-full bg-black/20 border border-white/10 focus:border-primary/50 rounded-xl px-4 py-3 text-white placeholder-white/20 outline-none transition-colors"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
className="w-full bg-primary hover:bg-primary-600 text-white border-none justify-center font-bold h-12 mt-2"
|
||||
onClick={() => setSubmitted(true)}
|
||||
>
|
||||
Send Reset Link
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-center py-8">
|
||||
<div className="w-16 h-16 bg-green-500/20 rounded-full flex items-center justify-center mx-auto mb-4 text-green-500">
|
||||
<FontAwesomeIcon icon={faEnvelope} className="text-2xl" />
|
||||
</div>
|
||||
<h3 className="text-xl font-bold mb-2">Check your email</h3>
|
||||
<p className="text-white/60 text-sm mb-8">
|
||||
We've sent a password reset link to <br/><span className="text-white font-medium">{email}</span>
|
||||
</p>
|
||||
<Button
|
||||
className="w-full bg-white/10 hover:bg-white/20 text-white border-none justify-center font-bold h-12"
|
||||
onClick={() => setSubmitted(false)}
|
||||
>
|
||||
Try another email
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="mt-8 text-center text-sm">
|
||||
<Link to="/login" className="text-white/40 hover:text-white transition-colors flex items-center justify-center gap-2">
|
||||
<FontAwesomeIcon icon={faArrowLeft} /> Back to Log in
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ForgotPassword;
|
||||
@@ -0,0 +1,2 @@
|
||||
import ForgotPassword from "./forgot-password";
|
||||
export default ForgotPassword;
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DiscordButton } from "../../components/discord-button";
|
||||
import { Button } from "@storyteller/ui-button";
|
||||
import { isMobile } from "react-device-detect";
|
||||
import { isMobile, isMacOs } from "react-device-detect";
|
||||
import { faWindows, faApple, faGithub } from "@fortawesome/free-brands-svg-icons";
|
||||
import {
|
||||
faVolumeMute,
|
||||
@@ -25,6 +25,8 @@ import ModelBadgeGrid from "../../components/model-badge-grid";
|
||||
import Seo from "../../components/seo";
|
||||
import { DOWNLOAD_LINKS } from "../../config/downloads";
|
||||
import { OwnershipComparison } from "../../components/ownership-comparison/ownership-comparison";
|
||||
import { DownloadModal } from "../../components/download-modal";
|
||||
import { UsersApi } from "@storyteller/api";
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger);
|
||||
|
||||
@@ -52,8 +54,33 @@ const Landing = () => {
|
||||
const [isHovering, setIsHovering] = useState(false);
|
||||
const [activeFeature, setActiveFeature] = useState(0);
|
||||
const [activeVideo, setActiveVideo] = useState<number | null>(null);
|
||||
const [showDownloadModal, setShowDownloadModal] = useState(false);
|
||||
const [isLoggedIn, setIsLoggedIn] = useState(false);
|
||||
const videoRef = useRef<HTMLVideoElement>(null);
|
||||
|
||||
const downloadUrl = isMacOs ? MAC_LINK : WINDOWS_LINK;
|
||||
|
||||
useEffect(() => {
|
||||
const checkSession = async () => {
|
||||
const api = new UsersApi();
|
||||
const response = await api.GetSession();
|
||||
if (response.success && response.data?.loggedIn) {
|
||||
setIsLoggedIn(true);
|
||||
}
|
||||
};
|
||||
checkSession();
|
||||
}, []);
|
||||
|
||||
const onDownloadClick = (e: React.MouseEvent) => {
|
||||
if (isLoggedIn) {
|
||||
return;
|
||||
}
|
||||
|
||||
setShowDownloadModal(true);
|
||||
|
||||
localStorage.setItem("artcraft_download_initiated", "true");
|
||||
};
|
||||
|
||||
const features = [
|
||||
{
|
||||
icon: faMapMarkerAlt,
|
||||
@@ -263,26 +290,17 @@ const Landing = () => {
|
||||
Download on a desktop
|
||||
</Button>
|
||||
) : (
|
||||
<>
|
||||
<Button
|
||||
className="text-md px-4 py-3 font-semibold rounded-xl shadow-lg gap-3"
|
||||
as="link"
|
||||
href={WINDOWS_LINK}
|
||||
>
|
||||
<FontAwesomeIcon icon={faWindows} />
|
||||
Download Windows
|
||||
</Button>
|
||||
<Button
|
||||
className="text-md px-4 py-3 font-semibold rounded-xl shadow-lg gap-3"
|
||||
as="link"
|
||||
href={MAC_LINK}
|
||||
>
|
||||
<FontAwesomeIcon icon={faApple} />
|
||||
Download Mac
|
||||
</Button>
|
||||
</>
|
||||
<Button
|
||||
className="text-md px-8 py-4 text-lg font-semibold rounded-xl shadow-lg gap-3 transition-all duration-300 hover:scale-105 hover:shadow-primary/25"
|
||||
as="link"
|
||||
href={downloadUrl}
|
||||
onClick={onDownloadClick}
|
||||
>
|
||||
<FontAwesomeIcon icon={isMacOs ? faApple : faWindows} />
|
||||
Download for {isMacOs ? "Mac" : "Windows"}
|
||||
</Button>
|
||||
)}
|
||||
<img src="/images/try-free.png" alt="Try Free" draggable={false} className="absolute -left-[45%] -top-5 h-40 pointer-events-none select-none hidden md:block" />
|
||||
<img src="/images/try-free.png" alt="Try Free" draggable={false} className="absolute -left-[58%] -top-2 h-40 pointer-events-none select-none hidden md:block" />
|
||||
</div>
|
||||
|
||||
{/* Glassy Video Mockup */}
|
||||
@@ -773,13 +791,13 @@ const Landing = () => {
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12">
|
||||
{/* Discord CTA Section */}
|
||||
<div
|
||||
className="flex flex-col items-center justify-center text-center p-8 sm:p-12 lg:p-16 rounded-[24px] sm:rounded-[40px] bg-gradient-to-br from-primary/30 to-primary/50 backdrop-blur-lg border-[3px] sm:border-[6px] border-primary/70 shadow-2xl shadow-primary/30"
|
||||
className="flex flex-col items-center justify-center text-center p-8 sm:p-12 lg:p-16 rounded-[24px] sm:rounded-[40px] bg-[#1a1b36] backdrop-blur-lg border-[3px] sm:border-[6px] border-[#3f415c] shadow-2xl"
|
||||
data-animate
|
||||
>
|
||||
<h2 className="relative mb-4 sm:mb-6 font-bold text-2xl sm:text-3xl lg:text-4xl max-w-lg !leading-tight">
|
||||
<h2 className="relative mb-4 sm:mb-6 font-bold text-2xl sm:text-3xl lg:text-4xl max-w-lg !leading-tight text-white">
|
||||
Join the Discord
|
||||
</h2>
|
||||
<p className="text-base sm:text-lg text-gray-200 mb-6 sm:mb-8 max-w-md leading-relaxed">
|
||||
<p className="text-base sm:text-lg text-[#aab3c9] mb-6 sm:mb-8 max-w-md leading-relaxed">
|
||||
Connect with other creators, share your work, get feedback, and stay updated.
|
||||
</p>
|
||||
<DiscordButton />
|
||||
@@ -807,9 +825,41 @@ const Landing = () => {
|
||||
Star on GitHub
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
|
||||
{/* Download CTA Section - New */}
|
||||
<div
|
||||
className="flex flex-col items-center justify-center text-center p-8 sm:p-12 lg:col-span-2 rounded-[24px] sm:rounded-[40px] bg-gradient-to-br from-primary/30 to-primary/50 backdrop-blur-lg border-[3px] sm:border-[6px] border-primary/70 shadow-2xl shadow-primary/30 overflow-hidden relative"
|
||||
data-animate
|
||||
>
|
||||
<div className="absolute inset-0 bg-gradient-to-br from-primary/20 via-transparent to-purple-500/20 opacity-30 pointer-events-none" />
|
||||
<div className="absolute top-0 left-0 w-full h-[1px] bg-gradient-to-r from-transparent via-white/20 to-transparent" />
|
||||
|
||||
<h2 className="relative mb-4 sm:mb-6 font-bold text-3xl sm:text-4xl lg:text-5xl max-w-2xl !leading-tight text-white z-10">
|
||||
Ready to Create?
|
||||
</h2>
|
||||
<p className="text-base sm:text-l md:text-xl text-white/90 mb-8 sm:mb-10 max-w-xl leading-relaxed z-10">
|
||||
Join thousands of artists and filmmakers using ArtCraft to bring their vision to life.
|
||||
</p>
|
||||
|
||||
<div className="relative z-10">
|
||||
<Button
|
||||
className="text-md px-10 py-5 text-xl font-semibold rounded-2xl shadow-xl gap-3 transition-all duration-300 hover:scale-105 hover:shadow-primary/40 bg-white text-black hover:bg-white"
|
||||
as="link"
|
||||
href={downloadUrl}
|
||||
onClick={onDownloadClick}
|
||||
>
|
||||
<FontAwesomeIcon icon={isMacOs ? faApple : faWindows} />
|
||||
Download for {isMacOs ? "Mac" : "Windows"}
|
||||
</Button>
|
||||
<div className="mt-4 text-sm text-white/80 font-medium">Free to use.</div>
|
||||
<div className="text-xs text-white/80 mt-1 font-medium">Unlimited Nano Banana Pro for a limited time!</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DownloadModal isOpen={showDownloadModal} onClose={() => setShowDownloadModal(false)} />
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
import LogIn from "./login";
|
||||
export default LogIn;
|
||||
@@ -0,0 +1,132 @@
|
||||
import { faGoogle } from "@fortawesome/free-brands-svg-icons";
|
||||
import { faEye, faEyeSlash, faSpinner } from "@fortawesome/pro-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { Button } from "@storyteller/ui-button";
|
||||
import { useState } from "react";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { UsersApi } from "@storyteller/api";
|
||||
|
||||
const Login = () => {
|
||||
const navigate = useNavigate();
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const handleLogin = async () => {
|
||||
setError(null);
|
||||
setIsLoading(true);
|
||||
|
||||
const api = new UsersApi();
|
||||
const response = await api.Login({
|
||||
usernameOrEmail: email,
|
||||
password: password
|
||||
});
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
if (response.success) {
|
||||
window.dispatchEvent(new Event('auth-change'));
|
||||
navigate("/");
|
||||
} else {
|
||||
setError(response.errorMessage || "Invalid credentials");
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="relative min-h-screen bg-[#101014] text-white bg-dots flex flex-col">
|
||||
<div className="dotted-pattern absolute inset-0 z-[0] opacity-30" />
|
||||
|
||||
<main className="relative z-10 flex-1 flex items-center justify-center p-4">
|
||||
<div className="w-full max-w-md bg-[#1C1C20] border border-white/10 rounded-3xl p-8 shadow-2xl">
|
||||
<div className="text-center mb-8">
|
||||
<h1 className="text-2xl font-bold mb-2">Welcome Back</h1>
|
||||
<p className="text-white/60 text-sm">Log in to your account</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<Button
|
||||
className="w-full bg-white text-black hover:bg-gray-100 border-none justify-center gap-3 font-medium h-12"
|
||||
onClick={() => {}}
|
||||
>
|
||||
<FontAwesomeIcon icon={faGoogle} className="text-lg" />
|
||||
Continue with Google
|
||||
</Button>
|
||||
|
||||
<div className="relative flex items-center justify-center py-2">
|
||||
<div className="absolute inset-0 flex items-center">
|
||||
<div className="w-full border-t border-white/10"></div>
|
||||
</div>
|
||||
<span className="relative bg-[#1C1C20] px-4 text-xs text-white/40 uppercase tracking-widest">or</span>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
{error && (
|
||||
<div className="bg-red-500/10 border border-red-500/20 text-red-500 px-4 py-3 rounded-xl text-sm text-center">
|
||||
{error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="space-y-2">
|
||||
<label className="text-xs font-bold text-white/60 uppercase tracking-wide ml-1">Email or Username</label>
|
||||
<input
|
||||
type="text"
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
placeholder="you@example.com or username"
|
||||
className="w-full bg-black/20 border border-white/10 focus:border-primary/50 rounded-xl px-4 py-3 text-white placeholder-white/20 outline-none transition-colors"
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<div className="flex justify-between items-center ml-1">
|
||||
<label className="text-xs font-bold text-white/60 uppercase tracking-wide">Password</label>
|
||||
<Link to="/forgot-password" className="text-xs text-primary hover:text-primary-400 transition-colors">Forgot password?</Link>
|
||||
</div>
|
||||
<div className="relative">
|
||||
<input
|
||||
type={showPassword ? "text" : "password"}
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
placeholder="Min. 8 characters"
|
||||
className="w-full bg-black/20 border border-white/10 focus:border-primary/50 rounded-xl px-4 py-3 text-white placeholder-white/20 outline-none transition-colors pr-12"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
className="absolute right-4 top-1/2 -translate-y-1/2 text-white/30 hover:text-white/60 transition-colors"
|
||||
>
|
||||
<FontAwesomeIcon icon={showPassword ? faEyeSlash : faEye} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
className="w-full bg-primary hover:bg-primary-600 text-white border-none justify-center font-bold h-12 mt-2"
|
||||
onClick={handleLogin}
|
||||
disabled={isLoading}
|
||||
>
|
||||
{isLoading ? <FontAwesomeIcon icon={faSpinner} spin /> : "Log in"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-8 text-center text-sm text-white/60">
|
||||
Don't have an account?{" "}
|
||||
<Link to="/signup" className="text-primary hover:text-primary-400 font-semibold transition-colors">
|
||||
Sign up
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div className="relative z-10 py-6 text-center text-white/20 text-xs">
|
||||
© {new Date().getFullYear()} ArtCraft. All rights reserved.
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Login;
|
||||
@@ -0,0 +1,2 @@
|
||||
import Pricing from "./pricing";
|
||||
export default Pricing;
|
||||
@@ -0,0 +1,123 @@
|
||||
import { faCheck } from "@fortawesome/pro-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { Button } from "@storyteller/ui-button";
|
||||
import Footer from "../../components/footer";
|
||||
|
||||
const Pricing = () => {
|
||||
return (
|
||||
<div className="relative min-h-screen bg-[#101014] text-white bg-dots">
|
||||
<div className="dotted-pattern absolute inset-0 z-[0] opacity-50" />
|
||||
<div className="absolute inset-0 flex items-center justify-center pointer-events-none z-0">
|
||||
<div className="w-[900px] h-[900px] rounded-full bg-gradient-to-br from-blue-700 via-blue-500 to-[#00AABA] opacity-20 blur-[120px]"></div>
|
||||
</div>
|
||||
|
||||
<main className="relative z-10 pt-32 pb-20 px-4 sm:px-6 lg:px-8">
|
||||
<div className="text-center max-w-3xl mx-auto mb-16 sm:mb-24">
|
||||
<h1 className="text-4xl sm:text-5xl md:text-6xl font-bold mb-6">
|
||||
Simple, Transparent Pricing
|
||||
</h1>
|
||||
<p className="text-xl text-white/70 leading-relaxed">
|
||||
Start for free and scale as you grow. No hidden fees.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
{/* Free Tier */}
|
||||
<div className="bg-white/5 backdrop-blur-md rounded-3xl p-8 border border-white/10 flex flex-col hover:border-white/20 transition-all duration-300">
|
||||
<h3 className="text-2xl font-bold mb-2">Hobbyist</h3>
|
||||
<div className="mb-6 flex items-baseline gap-1">
|
||||
<span className="text-4xl font-bold">$0</span>
|
||||
<span className="text-white/60">/month</span>
|
||||
</div>
|
||||
<p className="text-white/60 mb-8 h-12">
|
||||
Perfect for getting started and learning the basics of ArtCraft.
|
||||
</p>
|
||||
<Button
|
||||
className="w-full justify-center bg-white/10 hover:bg-white/20 border-transparent mb-8"
|
||||
as="link"
|
||||
href="/download"
|
||||
>
|
||||
Get Started
|
||||
</Button>
|
||||
<ul className="space-y-4 flex-1">
|
||||
<Feature text="Unlimited local generations" />
|
||||
<Feature text="Acccess to basic models" />
|
||||
<Feature text="Community support" />
|
||||
<Feature text="Non-commercial use" />
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/* Pro Tier (Highlighted) */}
|
||||
<div className="bg-[#1C1C20] backdrop-blur-md rounded-3xl p-8 border-2 border-primary shadow-2xl shadow-primary/20 flex flex-col relative transform md:-translate-y-4">
|
||||
<div className="absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-primary px-4 py-1 rounded-full text-sm font-bold shadow-lg">
|
||||
MOST POPULAR
|
||||
</div>
|
||||
<h3 className="text-2xl font-bold mb-2 text-primary">Pro</h3>
|
||||
<div className="mb-6 flex items-baseline gap-1">
|
||||
<span className="text-4xl font-bold">$20</span>
|
||||
<span className="text-white/60">/month</span>
|
||||
</div>
|
||||
<p className="text-white/60 mb-8 h-12">
|
||||
For professional artists and creators who need more power.
|
||||
</p>
|
||||
<Button
|
||||
className="w-full justify-center bg-primary hover:bg-primary-600 border-transparent mb-8"
|
||||
as="link"
|
||||
href="/signup"
|
||||
>
|
||||
Start Free Trial
|
||||
</Button>
|
||||
<ul className="space-y-4 flex-1">
|
||||
<Feature text="Everything in Hobbyist" highlighted />
|
||||
<Feature text="Cloud sync & backup" highlighted />
|
||||
<Feature text="Priority rendering queue" highlighted />
|
||||
<Feature text="Commercial license" highlighted />
|
||||
<Feature text="Access to latest models" highlighted />
|
||||
<Feature text="4K resolution support" highlighted />
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/* Studio Tier */}
|
||||
<div className="bg-white/5 backdrop-blur-md rounded-3xl p-8 border border-white/10 flex flex-col hover:border-white/20 transition-all duration-300">
|
||||
<h3 className="text-2xl font-bold mb-2">Studio</h3>
|
||||
<div className="mb-6 flex items-baseline gap-1">
|
||||
<span className="text-4xl font-bold">$100</span>
|
||||
<span className="text-white/60">/month</span>
|
||||
</div>
|
||||
<p className="text-white/60 mb-8 h-12">
|
||||
For teams and studios requiring collaboration tools.
|
||||
</p>
|
||||
<Button
|
||||
className="w-full justify-center bg-white/10 hover:bg-white/20 border-transparent mb-8"
|
||||
as="link"
|
||||
href="/contact"
|
||||
>
|
||||
Contact Sales
|
||||
</Button>
|
||||
<ul className="space-y-4 flex-1">
|
||||
<Feature text="Everything in Pro" />
|
||||
<Feature text="Team collaboration" />
|
||||
<Feature text="Dedicated support manager" />
|
||||
<Feature text="Custom model fine-tuning" />
|
||||
<Feature text="SSO & Advanced Security" />
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const Feature = ({ text, highlighted = false }: { text: string; highlighted?: boolean }) => (
|
||||
<li className="flex items-start gap-3">
|
||||
<div className={`mt-1 w-5 h-5 rounded-full flex items-center justify-center ${highlighted ? "bg-primary/20 text-primary" : "bg-white/10 text-white/50"}`}>
|
||||
<FontAwesomeIcon icon={faCheck} className="text-xs" />
|
||||
</div>
|
||||
<span className={`text-sm ${highlighted ? "text-white" : "text-white/70"}`}>{text}</span>
|
||||
</li>
|
||||
);
|
||||
|
||||
export default Pricing;
|
||||
@@ -0,0 +1,2 @@
|
||||
import SignUp from "./signup";
|
||||
export default SignUp;
|
||||
@@ -0,0 +1,40 @@
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { SignupForm } from "../../components/auth";
|
||||
|
||||
const Signup = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<div className="relative min-h-screen bg-[#101014] text-white bg-dots flex flex-col">
|
||||
<div className="dotted-pattern absolute inset-0 z-[0] opacity-30" />
|
||||
|
||||
<main className="relative z-10 flex-1 flex items-center justify-center p-4">
|
||||
<div className="w-full max-w-md bg-[#1C1C20] border border-white/10 rounded-3xl p-8 shadow-2xl">
|
||||
<div className="text-center mb-8">
|
||||
<h1 className="text-2xl font-bold mb-2">Create an Account</h1>
|
||||
<p className="text-white/60 text-sm">Join thousands of creators</p>
|
||||
</div>
|
||||
|
||||
<SignupForm
|
||||
onSuccess={() => navigate("/welcome")}
|
||||
signupSource="artcraft"
|
||||
/>
|
||||
|
||||
<div className="mt-8 text-center text-sm text-white/60">
|
||||
Already have an account?{" "}
|
||||
<Link to="/login" className="text-primary hover:text-primary-400 font-semibold transition-colors">
|
||||
Log in
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div className="relative z-10 py-6 text-center text-white/20 text-xs">
|
||||
© {new Date().getFullYear()} ArtCraft. All rights reserved.
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Signup;
|
||||
@@ -0,0 +1,2 @@
|
||||
import Welcome from "./welcome";
|
||||
export default Welcome;
|
||||
@@ -0,0 +1,138 @@
|
||||
import {
|
||||
faCheckCircle,
|
||||
faDownload,
|
||||
faDesktop,
|
||||
faRocket,
|
||||
} from "@fortawesome/pro-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { Button } from "@storyteller/ui-button";
|
||||
import { Link } from "react-router-dom";
|
||||
import { isMobile, isMacOs } from "react-device-detect";
|
||||
import { DOWNLOAD_LINKS } from "../../config/downloads";
|
||||
|
||||
const Welcome = () => {
|
||||
const downloadUrl = isMacOs ? DOWNLOAD_LINKS.MACOS : DOWNLOAD_LINKS.WINDOWS;
|
||||
|
||||
return (
|
||||
<div className="relative min-h-[calc(100vh-1px)] pt-20 md:pt-0 overflow-hidden bg-[#101014] text-white flex flex-col items-center justify-center p-4">
|
||||
<main className="relative z-10 w-full max-w-2xl">
|
||||
<div className="bg-[#28282C] rounded-[32px] overflow-hidden shadow-2xl border border-white/5">
|
||||
<div className="p-8 pt-10 text-center flex flex-col items-center">
|
||||
<h1 className="text-4xl font-bold mb-4 text-white tracking-tight gap-4 flex items-center">
|
||||
<FontAwesomeIcon
|
||||
icon={faCheckCircle}
|
||||
className="text-4xl bg-[#28282C] text-primary rounded-full"
|
||||
/>
|
||||
<div>
|
||||
Welcome to <span className="text-primary">ArtCraft</span>
|
||||
</div>
|
||||
</h1>
|
||||
|
||||
<p className="text-lg text-white/70 mb-8 max-w-xl mx-auto leading-relaxed font-medium">
|
||||
Your account is ready. Let's get you set up to create.
|
||||
</p>
|
||||
|
||||
<div className="w-full mb-8">
|
||||
{/* Information Column */}
|
||||
<div className="bg-[#1E1E22] border border-white/5 rounded-3xl p-6">
|
||||
<div className="flex flex-col items-center text-center mb-6">
|
||||
<h3 className="font-bold text-white text-xl">Next Steps</h3>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3 text-left">
|
||||
<div className="bg-[#252529] p-3 rounded-xl flex items-center gap-3">
|
||||
<div className="w-7 h-7 shrink-0 rounded-full bg-primary/60 flex items-center justify-center text-xs font-bold text-white/80">
|
||||
1
|
||||
</div>
|
||||
<div className="text-white/80 text-sm font-medium">
|
||||
Open the installer
|
||||
</div>
|
||||
</div>
|
||||
<div className="bg-[#252529] p-3 rounded-xl flex items-center gap-3">
|
||||
<div className="w-7 h-7 shrink-0 rounded-full bg-primary/60 flex items-center justify-center text-xs font-bold text-white/80">
|
||||
2
|
||||
</div>
|
||||
<div className="text-white/80 text-sm font-medium">
|
||||
Follow setup instructions
|
||||
</div>
|
||||
</div>
|
||||
<div className="bg-[#252529] p-3 rounded-xl flex items-center gap-3">
|
||||
<div className="w-7 h-7 shrink-0 rounded-full bg-primary/60 flex items-center justify-center text-xs font-bold text-white/80">
|
||||
3
|
||||
</div>
|
||||
<div className="text-white/80 text-sm font-medium">
|
||||
Log in to account
|
||||
</div>
|
||||
</div>
|
||||
<div className="bg-[#252529] p-3 rounded-xl flex items-center gap-3">
|
||||
<div className="w-7 h-7 shrink-0 rounded-full bg-primary/60 flex items-center justify-center text-xs font-bold text-white/80">
|
||||
4
|
||||
</div>
|
||||
<div className="text-white/80 text-sm font-medium">
|
||||
Start creating!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Contingency / Action Area */}
|
||||
{!isMobile && (
|
||||
<div className="flex flex-col items-center pt-6 border-t border-white/5">
|
||||
<p className="text-white/40 text-sm mb-4 font-medium uppercase tracking-wider">
|
||||
Download didn't start?
|
||||
</p>
|
||||
<Button
|
||||
as="link"
|
||||
href={downloadUrl}
|
||||
className="bg-white text-black hover:bg-gray-100 dark:bg-white dark:text-black dark:hover:bg-gray-200 px-10 py-3 text-sm font-bold rounded-xl"
|
||||
>
|
||||
<FontAwesomeIcon icon={faDownload} className="mr-2" />
|
||||
Download for {isMacOs ? "Mac" : "Windows"}
|
||||
</Button>
|
||||
<div className="mt-5 flex gap-6 text-sm font-medium text-white/30">
|
||||
<a
|
||||
href={DOWNLOAD_LINKS.WINDOWS}
|
||||
className="hover:text-white transition-colors flex items-center gap-2"
|
||||
>
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-current"></span>
|
||||
Windows .exe
|
||||
</a>
|
||||
<a
|
||||
href={DOWNLOAD_LINKS.MACOS}
|
||||
className="hover:text-white transition-colors flex items-center gap-2"
|
||||
>
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-current"></span>
|
||||
Mac .dmg
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isMobile && (
|
||||
<div className="bg-[#431407] border border-orange-900/50 rounded-2xl p-6 text-orange-200 text-sm leading-relaxed">
|
||||
<div className="flex items-center justify-center mb-3 text-orange-400">
|
||||
<FontAwesomeIcon icon={faDesktop} className="text-2xl" />
|
||||
</div>
|
||||
ArtCraft is a powerful desktop experience. <br />
|
||||
Please head to your computer to download and install.
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Footer of Card */}
|
||||
<div className="bg-[#1F1F22] p-4 text-center border-t border-white/5">
|
||||
<Link
|
||||
to="/"
|
||||
className="text-white/40 hover:text-white text-sm font-medium transition-colors"
|
||||
>
|
||||
Back to Home
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Welcome;
|
||||
@@ -7,7 +7,7 @@ module.exports = {
|
||||
content: [
|
||||
join(
|
||||
__dirname,
|
||||
"{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}"
|
||||
"{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}",
|
||||
),
|
||||
...createGlobPatternsForDependencies(__dirname),
|
||||
"./app/index.html",
|
||||
@@ -23,6 +23,7 @@ module.exports = {
|
||||
white: colors.white,
|
||||
gray: colors.gray,
|
||||
black: colors.black,
|
||||
red: colors.red,
|
||||
blue: colors.blue,
|
||||
orange: colors.orange,
|
||||
green: colors.green,
|
||||
|
||||
@@ -32,6 +32,9 @@ export default defineConfig(() => ({
|
||||
target: 'https://api.storyteller.ai',
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
headers: {
|
||||
Origin: 'https://api.storyteller.ai',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ interface SignupRequest {
|
||||
password: string;
|
||||
password_confirmation: string;
|
||||
signup_source?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export class UsersApi extends ApiManager {
|
||||
private async authFetch<B, T>(
|
||||
@@ -19,7 +19,7 @@ export class UsersApi extends ApiManager {
|
||||
}: {
|
||||
method: string;
|
||||
body?: B;
|
||||
}
|
||||
},
|
||||
): Promise<T> {
|
||||
const bodyInString = JSON.stringify(body);
|
||||
|
||||
@@ -33,8 +33,14 @@ export class UsersApi extends ApiManager {
|
||||
body: bodyInString,
|
||||
});
|
||||
|
||||
const responseData = await response.json();
|
||||
return responseData as T;
|
||||
const text = await response.text();
|
||||
try {
|
||||
const responseData = JSON.parse(text);
|
||||
return responseData as T;
|
||||
} catch (e) {
|
||||
console.error("Failed to parse response as JSON:", text);
|
||||
throw new Error(text || `Request failed with status ${response.status}`);
|
||||
}
|
||||
}
|
||||
|
||||
public GetSession(): Promise<
|
||||
@@ -164,7 +170,7 @@ export class UsersApi extends ApiManager {
|
||||
signupSource?: string;
|
||||
}): Promise<ApiResponse<{ signedSession?: string }>> {
|
||||
const endpoint = `${this.getApiSchemeAndHost()}/v1/create_account`;
|
||||
const body : SignupRequest = {
|
||||
const body: SignupRequest = {
|
||||
email_address: email,
|
||||
password,
|
||||
password_confirmation: passwordConfirmation,
|
||||
@@ -207,4 +213,4 @@ export class UsersApi extends ApiManager {
|
||||
}
|
||||
}
|
||||
|
||||
(window as any).UsersApi = new UsersApi();
|
||||
(window as any).UsersApi = new UsersApi();
|
||||
Reference in new issue
Block a user