diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js
index 79d833413..2c6468a63 100644
--- a/docs/docusaurus.config.js
+++ b/docs/docusaurus.config.js
@@ -403,6 +403,11 @@ const config = {
},
},
+ // Put your custom environment here
+ customFields: {
+ apiKeyBrevo: process.env.API_KEY_BREVO,
+ },
+
themes: ['@docusaurus/theme-live-codeblock', '@docusaurus/theme-mermaid'],
}
diff --git a/docs/package.json b/docs/package.json
index 1c8f6fe34..8ef67f535 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -39,17 +39,17 @@
"prism-react-renderer": "^1.3.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
+ "react-hook-form": "^7.47.0",
"react-icons": "^4.11.0",
"react-tweet": "^3.2.0",
"redocusaurus": "^2.0.0",
"sass": "^1.69.3",
"tailwind-merge": "^2.1.0",
- "tailwindcss": "^3.3.3",
- "react-hook-form": "^7.47.0"
+ "tailwindcss": "^3.3.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.0",
- "dotenv": "^16.3.1",
+ "dotenv": "^16.4.5",
"tailwindcss-animate": "^1.0.7"
},
"browserslist": {
diff --git a/docs/src/containers/Footer/index.js b/docs/src/containers/Footer/index.js
index 0f94120c9..b300f992a 100644
--- a/docs/src/containers/Footer/index.js
+++ b/docs/src/containers/Footer/index.js
@@ -1,5 +1,6 @@
import React from 'react'
+import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
import { AiOutlineGithub, AiOutlineTwitter } from 'react-icons/ai'
import { BiLogoDiscordAlt, BiLogoLinkedin } from 'react-icons/bi'
import { useForm } from 'react-hook-form'
@@ -106,12 +107,16 @@ const menus = [
const getCurrentYear = new Date().getFullYear()
export default function Footer() {
- const { register, handleSubmit } = useForm({
+ const { register, handleSubmit, reset } = useForm({
defaultValues: {
email: '',
},
})
+ const {
+ siteConfig: { customFields },
+ } = useDocusaurusContext()
+
const onSubmit = (data) => {
const { email } = data
const options = {
@@ -119,7 +124,7 @@ export default function Footer() {
headers: {
'accept': 'application/json',
'content-type': 'application/json',
- 'api-key': process.env.API_KEY_BREVO,
+ 'api-key': customFields.apiKeyBrevo,
},
body: JSON.stringify({
updateEnabled: false,
@@ -131,6 +136,11 @@ export default function Footer() {
if (email) {
fetch('https://api.brevo.com/v3/contacts', options)
.then((response) => response.json())
+ .then((response) => {
+ if (response.id) {
+ reset()
+ }
+ })
.catch((err) => console.error(err))
}
}
diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js
index 0e479af21..f0fc1ee34 100644
--- a/docs/src/pages/index.js
+++ b/docs/src/pages/index.js
@@ -1,4 +1,4 @@
-import React from 'react'
+import React, { useState, useEffect } from 'react'
import DownloadApp from '@site/src/containers/DownloadApp'
import { Tweet } from 'react-tweet'
import { useForm } from 'react-hook-form'
@@ -21,7 +21,13 @@ import Dropdown from '@site/src/containers/Elements/dropdown'
import useIsBrowser from '@docusaurus/useIsBrowser'
-const tabel = {
+import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
+
+import Svg from '@site/static/img/homepage/features01dark.svg'
+
+import { twMerge } from 'tailwind-merge'
+
+const table = {
labels: [
'Ownership',
'Openness',
@@ -57,6 +63,26 @@ const tabel = {
],
}
+const features = [
+ {
+ title: 'Run local AI or connect to remote APIs',
+ description:
+ 'Choose between running AI models locally for privacy, like Llama or Mistral, or connect to remote APIs, like ChatGPT or Claude.',
+ },
+ {
+ title: 'Browse and download models',
+ description: `With Jan's Hub, instantly download popular AI models or import your own to expand your toolkit without hassle.`,
+ },
+ {
+ title: 'Use Jan in your natural workflows',
+ description: `Jan works with your workflow, ready to assist at a moment's notice without interrupting your work.`,
+ },
+ {
+ title: 'Customize and add features with Extensions',
+ description: `Tailor Jan exactly to your needs with Extensions, making your experience truly your own.`,
+ },
+]
+
export default function Home() {
const isBrowser = useIsBrowser()
const { stargazers } = useAppStars()
@@ -71,12 +97,16 @@ export default function Home() {
const userAgent = isBrowser && navigator.userAgent
const isBrowserChrome = isBrowser && userAgent.includes('Chrome')
- const { register, handleSubmit } = useForm({
+ const { register, handleSubmit, reset } = useForm({
defaultValues: {
email: '',
},
})
+ const {
+ siteConfig: { customFields },
+ } = useDocusaurusContext()
+
const onSubmit = (data) => {
const { email } = data
const options = {
@@ -84,7 +114,7 @@ export default function Home() {
headers: {
'accept': 'application/json',
'content-type': 'application/json',
- 'api-key': process.env.API_KEY_BREVO,
+ 'api-key': customFields.apiKeyBrevo,
},
body: JSON.stringify({
updateEnabled: false,
@@ -96,10 +126,30 @@ export default function Home() {
if (email) {
fetch('https://api.brevo.com/v3/contacts', options)
.then((response) => response.json())
+ .then((response) => {
+ if (response.id) {
+ reset()
+ }
+ })
.catch((err) => console.error(err))
}
}
+ const [activeFeature, setActiveFeature] = useState(0)
+
+ useEffect(() => {
+ if (activeFeature < 3) {
+ setTimeout(() => {
+ setActiveFeature(activeFeature + 1)
+ }, 5000)
+ }
+ if (activeFeature === 3) {
+ setTimeout(() => {
+ setActiveFeature(0)
+ }, 5000)
+ }
+ }, [activeFeature])
+
return (
<>
+ {feature.description} +
+