import { ActionButton } from '../components/ActionButton' import { isDesktop } from '../lib/isDesktop' import { VITE_KC_SITE_BASE_URL, VITE_KC_API_BASE_URL } from '../env' import { Themes, getSystemTheme } from '../lib/theme' import { PATHS } from 'lib/paths' import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext' import { APP_NAME } from 'lib/constants' import { CSSProperties, useCallback, useState } from 'react' import { Logo } from 'components/Logo' import { CustomIcon } from 'components/CustomIcon' import { Link } from 'react-router-dom' import { APP_VERSION } from './Settings' import { openExternalBrowserIfDesktop } from 'lib/openWindow' import { toSync } from 'lib/utils' import { reportRejection } from 'lib/trap' import toast from 'react-hot-toast' const subtleBorder = 'border border-solid border-chalkboard-30 dark:border-chalkboard-80' const cardArea = `${subtleBorder} rounded-lg px-6 py-3 text-chalkboard-70 dark:text-chalkboard-30` const SignIn = () => { const [userCode, setUserCode] = useState('') const { auth: { send }, settings: { state: { context: { app: { theme }, }, }, }, } = useSettingsAuthContext() const signInUrl = `${VITE_KC_SITE_BASE_URL}${ PATHS.SIGN_IN }?callbackUrl=${encodeURIComponent( typeof window !== 'undefined' && window.location.href.replace('signin', '') )}` const kclSampleUrl = `${VITE_KC_SITE_BASE_URL}/docs/kcl-samples/car-wheel` const getThemeText = useCallback( (shouldContrast = true) => theme.current === Themes.Light || (theme.current === Themes.System && getSystemTheme() === Themes.Light) ? shouldContrast ? '-dark' : '' : shouldContrast ? '' : '-dark', [theme.current] ) const signInDesktop = async () => { // We want to invoke our command to login via device auth. const userCodeToDisplay = await window.electron .startDeviceFlow(VITE_KC_API_BASE_URL) .catch(reportError) if (!userCodeToDisplay) { console.error('No user code received while trying to log in') toast.error('Error while trying to log in') return } setUserCode(userCodeToDisplay) // Now that we have the user code, we can kick off the final login step. const token = await window.electron.loginWithDeviceFlow().catch(reportError) if (!token) { console.error('No token received while trying to log in') toast.error('Error while trying to log in') return } send({ type: 'Log in', token }) } return (

{APP_NAME}

alpha v{APP_VERSION}

Thank you for using our hardware design application. It is built on a novel CAD engine and crafted to help you create parametric, version-controlled, and accurate parts ready for manufacturing.

As alpha software, Zoo Modeling App is still in heavy development. We encourage feedback and feature requests that align with{' '} our roadmap to v1.0 .

{isDesktop() ? (
{!userCode ? ( ) : ( <>

You should see the following code in your browser

{userCode.split('').map((char, i) => ( {char} ))}

)}
) : ( Sign in to get started )}
View this sample

Built in the open

Open-source and open discussions. Check our public code base and join our Discord.

Read our source code Join our community

Ready for the future

Modern software ideas being brought together to create a familiar modeling experience with new superpowers.

Parametric design with KCL AI-unlocked CAD

Built on the first infrastructure for hardware design

You can make your own niche hardware design tools with our design and machine learning interfaces. We're building Modeling App in the same way.

KittyCAD Design API ML-ephant Machine Learning API
) } export default SignIn