-
-
Notifications
You must be signed in to change notification settings - Fork 851
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1008 from khoj-ai/features/new-sign-in-page
- Make it easier to quickly create the account without losing track of where you are - Show some capabilities before you sign on
- Loading branch information
Showing
30 changed files
with
1,330 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/interface/web/app/components/loginPrompt/GoogleSignIn.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// GoogleSignIn.tsx | ||
"use client"; | ||
|
||
import Script from "next/script"; | ||
|
||
interface GoogleSignInProps { | ||
onLoad?: () => void; | ||
} | ||
|
||
export function GoogleSignIn({ onLoad }: GoogleSignInProps) { | ||
return ( | ||
<Script | ||
id="google-signin" | ||
src="https://accounts.google.com/gsi/client" | ||
async | ||
defer | ||
onLoad={onLoad} | ||
/> | ||
); | ||
} |
50 changes: 50 additions & 0 deletions
50
src/interface/web/app/components/loginPrompt/loginPopup.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
"use client"; | ||
|
||
import { Button } from "@/components/ui/button"; | ||
import { Card, CardDescription, CardHeader } from "@/components/ui/card"; | ||
import { KhojLogo } from "../logo/khojLogo"; | ||
import { Drawer, DrawerContent } from "@/components/ui/drawer"; | ||
|
||
export interface LoginPopupProps { | ||
isMobileWidth?: boolean; | ||
setShowLoginPrompt: (show: boolean) => void; | ||
} | ||
|
||
export default function LoginPopup(props: LoginPopupProps) { | ||
if (props.isMobileWidth) { | ||
return ( | ||
<Drawer open={true} onClose={() => props.setShowLoginPrompt(false)}> | ||
<DrawerContent> | ||
<PopUpContent {...props} /> | ||
</DrawerContent> | ||
</Drawer> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="fixed inset-x-0 bottom-8 z-30 flex items-center justify-center"> | ||
<PopUpContent {...props} /> | ||
</div> | ||
); | ||
} | ||
|
||
function PopUpContent(props: LoginPopupProps) { | ||
return ( | ||
<Card className="rounded-lg p-6 flex flex-col items-center justify-between gap-8 md:w-fit border-none md:flex-row md:z-30 md:shadow-lg"> | ||
{!props.isMobileWidth && <KhojLogo className="w-12 h-auto" />} | ||
<div className="flex flex-col items-start justify-center gap-8 md:gap-2"> | ||
<CardHeader className="p-0 text-xl font-bold">Welcome to Khoj!</CardHeader> | ||
<CardDescription> | ||
Sign in to get started with Khoj, your AI-powered knowledge assistant. | ||
</CardDescription> | ||
</div> | ||
<Button | ||
variant={"default"} | ||
className="p-6 text-lg" | ||
onClick={() => props.setShowLoginPrompt(true)} | ||
> | ||
Get started for free | ||
</Button> | ||
</Card> | ||
); | ||
} |
114 changes: 114 additions & 0 deletions
114
src/interface/web/app/components/loginPrompt/loginPrompt.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
.gsiMaterialButton { | ||
-moz-user-select: none; | ||
-webkit-user-select: none; | ||
-ms-user-select: none; | ||
-webkit-appearance: none; | ||
background-image: none; | ||
/* border: 1px solid #747775; */ | ||
-webkit-border-radius: 20px; | ||
border-radius: 20px; | ||
-webkit-box-sizing: border-box; | ||
box-sizing: border-box; | ||
color: #1f1f1f; | ||
cursor: pointer; | ||
font-family: "Roboto", arial, sans-serif; | ||
font-size: 14px; | ||
height: 40px; | ||
letter-spacing: 0.25px; | ||
outline: none; | ||
overflow: hidden; | ||
padding: 0; | ||
position: relative; | ||
text-align: center; | ||
-webkit-transition: | ||
background-color 0.218s, | ||
border-color 0.218s, | ||
box-shadow 0.218s; | ||
transition: | ||
background-color 0.218s, | ||
border-color 0.218s, | ||
box-shadow 0.218s; | ||
vertical-align: middle; | ||
white-space: nowrap; | ||
width: 40px; | ||
max-width: 400px; | ||
min-width: min-content; | ||
} | ||
|
||
.gsiMaterialButton .gsiMaterialButtonIcon { | ||
height: 100%; | ||
margin-right: 12px; | ||
min-width: 20px; | ||
width: 100%; | ||
margin: 0; | ||
padding: 9px; | ||
} | ||
|
||
.gsiMaterialButton .gsiMaterialButtonContentWrapper { | ||
-webkit-align-items: center; | ||
align-items: center; | ||
display: flex; | ||
-webkit-flex-direction: row; | ||
flex-direction: row; | ||
-webkit-flex-wrap: nowrap; | ||
flex-wrap: nowrap; | ||
height: 100%; | ||
justify-content: space-between; | ||
position: relative; | ||
width: 100%; | ||
} | ||
|
||
.gsiMaterialButton .gsiMaterialButtonContents { | ||
-webkit-flex-grow: 1; | ||
flex-grow: 1; | ||
font-family: "Roboto", arial, sans-serif; | ||
font-weight: 500; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
vertical-align: top; | ||
} | ||
|
||
.gsiMaterialButton .gsiMaterialButtonState { | ||
-webkit-transition: opacity 0.218s; | ||
transition: opacity 0.218s; | ||
bottom: 0; | ||
left: 0; | ||
opacity: 0; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
} | ||
|
||
.gsiMaterialButton:disabled { | ||
cursor: default; | ||
background-color: #ffffff61; | ||
border-color: #1f1f1f1f; | ||
} | ||
|
||
.gsiMaterialButton:disabled .gsiMaterialButtonContents { | ||
opacity: 38%; | ||
} | ||
|
||
.gsiMaterialButton:disabled .gsiMaterialButtonIcon { | ||
opacity: 38%; | ||
} | ||
|
||
.gsiMaterialButton:not(:disabled):active .gsiMaterialButton-State, | ||
.gsiMaterialButton:not(:disabled):focus .gsiMaterialButtonState { | ||
background-color: #303030; | ||
opacity: 12%; | ||
} | ||
|
||
.gsiMaterialButton:not(:disabled):hover { | ||
-webkit-box-shadow: | ||
0 1px 2px 0 rgba(60, 64, 67, 0.3), | ||
0 1px 3px 1px rgba(60, 64, 67, 0.15); | ||
box-shadow: | ||
0 1px 2px 0 rgba(60, 64, 67, 0.3), | ||
0 1px 3px 1px rgba(60, 64, 67, 0.15); | ||
} | ||
|
||
.gsiMaterialButton:not(:disabled):hover .gsiMaterialButtonState { | ||
background-color: #303030; | ||
opacity: 8%; | ||
} |
Oops, something went wrong.