-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Website updates - sitemap, dataset. page, experiment editor (#234)
* add: experimentInfo to fusion export * add: experiment editor for people running custom studies * add: collect experimentInfo when starting recording * add: support for uploading dataset to ipfs - needs more testing * add: make /recordings be the base for experiments & allow url filter by activityId * add: sitemap * edit: blog content page * edit: switch to using /recordings across the site * add: update site copy and add custom 404 page * add: update packages & .env reference * add: display list of locally stored datasets * add: progress bar component * add: support for deleting datasets
- Loading branch information
Showing
27 changed files
with
12,101 additions
and
4,859 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
/** @type {import('next').NextConfig} */ | ||
module.exports = { | ||
reactStrictMode: true, | ||
env: { | ||
NEXT_PUBLIC_FUSION_NOSTR_PUBLIC_KEY: "5f3a52d8027cdde03a41857e98224dafd69495204d93071199aa86921aa02674", | ||
NEXT_PUBLIC_FUSION_RELAY_URL: "wss://relay.usefusion.ai", | ||
NEXT_PUBLIC_NEUROFUSION_BACKEND_URL: "https://neurofusionbackendprd.azurewebsites.net", | ||
async rewrites() { | ||
return [ | ||
{ | ||
source: "/sitemap.xml", | ||
destination: "/api/sitemap", | ||
}, | ||
]; | ||
}, | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
User-agent: * | ||
Allow: / | ||
|
||
Sitemap: https://usefusion.ai/sitemap.xml | ||
Sitemap: https://usefusion.app/sitemap.xml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Sandpack } from "@codesandbox/sandpack-react"; | ||
|
||
export const ExperimentEditor: React.FC = () => { | ||
const files = {}; | ||
|
||
return ( | ||
<div className="experiment-editor"> | ||
<h2>Experiment Editor</h2> | ||
<Sandpack files={files} theme="light" template="static" /> | ||
</div> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./experiment"; | ||
export * from "./signalquality"; | ||
export * from "./experiment-editor"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./onboarding-modal"; |
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,112 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import { Button, Dialog, DialogContent, DialogDescription, DialogTitle } from "~/components/ui"; | ||
|
||
const OnboardingModal: React.FC = () => { | ||
const [showCapabilitiesModal, setShowCapabilitiesModal] = useState(false); | ||
const [showDataHandlingModal, setShowDataHandlingModal] = useState(false); | ||
|
||
useEffect(() => { | ||
const viewedOnboarding = localStorage.getItem("viewedOnboarding"); | ||
if (viewedOnboarding !== "true") { | ||
setShowCapabilitiesModal(true); | ||
} | ||
}, []); | ||
|
||
const handleCapabilitiesNext = () => { | ||
setShowCapabilitiesModal(false); | ||
setShowDataHandlingModal(true); | ||
}; | ||
|
||
const handleDataHandlingPrevious = () => { | ||
setShowCapabilitiesModal(true); | ||
setShowDataHandlingModal(false); | ||
}; | ||
|
||
const handleDataHandlingGetStarted = () => { | ||
setShowDataHandlingModal(false); | ||
localStorage.setItem("viewedOnboarding", "true"); | ||
}; | ||
|
||
const handleCloseCapabilities = () => { | ||
setShowCapabilitiesModal(false); | ||
}; | ||
|
||
const handleCloseDataHandling = () => { | ||
setShowDataHandlingModal(false); | ||
}; | ||
return ( | ||
<div> | ||
{showCapabilitiesModal && ( | ||
<CapabilitiesModal onNext={handleCapabilitiesNext} onCancel={handleCloseCapabilities} /> | ||
)} | ||
{showDataHandlingModal && ( | ||
<DataHandlingModal | ||
onPrevious={handleDataHandlingPrevious} | ||
onGetStarted={handleDataHandlingGetStarted} | ||
onClose={handleCloseDataHandling} | ||
/> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
interface CapabilitiesModalProps { | ||
onNext: () => void; | ||
onCancel: () => void; | ||
} | ||
|
||
const CapabilitiesModal: React.FC<CapabilitiesModalProps> = ({ onNext, onCancel }) => { | ||
return ( | ||
<Dialog open={true} onOpenChange={onCancel}> | ||
<DialogContent> | ||
<DialogTitle>Welcome to Fusion</DialogTitle> | ||
<DialogDescription> | ||
Here's what you can do with Fusion: | ||
<div className="list-disc ml-6 mt-2"> | ||
<p>Record brain activity during cognitive experiments</p> | ||
<p>Respond to prompts on mobile devices</p> | ||
</div> | ||
</DialogDescription> | ||
<div className="flex justify-end mt-4"> | ||
<Button intent="primary" onClick={onNext}> | ||
Next | ||
</Button> | ||
<Button intent="dark" onClick={onCancel} className="ml-2"> | ||
Cancel | ||
</Button> | ||
</div> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
}; | ||
|
||
interface DataHandlingModalProps { | ||
onPrevious: () => void; | ||
onGetStarted: () => void; | ||
onClose: () => void; | ||
} | ||
|
||
const DataHandlingModal: React.FC<DataHandlingModalProps> = ({ onPrevious, onGetStarted, onClose }) => { | ||
return ( | ||
<Dialog open={true} onOpenChange={onClose}> | ||
<DialogContent> | ||
<DialogTitle>Data Handling in Fusion</DialogTitle> | ||
<DialogDescription> | ||
How Fusion handles your data: | ||
<ul className="list-disc ml-6 mt-2"> | ||
<li>Assigns anonymous identities with no email required</li> | ||
<li>Stores data locally on your device</li> | ||
</ul> | ||
</DialogDescription> | ||
<div className="flex justify-end mt-4"> | ||
<Button onClick={onPrevious}>Previous</Button> | ||
<Button intent="dark" onClick={onGetStarted} className="ml-2"> | ||
Get Started | ||
</Button> | ||
</div> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
}; | ||
|
||
export { CapabilitiesModal, DataHandlingModal, OnboardingModal }; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export const CircularProgress: React.FC<{ percentage: number }> = ({ percentage }) => { | ||
return ( | ||
<svg width="50" height="50" viewBox="0 0 120 120"> | ||
<circle cx="60" cy="60" r="45" stroke="gray" strokeWidth="15" fill="none" /> | ||
<circle | ||
cx="60" | ||
cy="60" | ||
r="45" | ||
stroke="blue" | ||
strokeWidth="15" | ||
fill="none" | ||
strokeDasharray="282.7" | ||
strokeDashoffset={((100 - percentage) / 100) * 2 * Math.PI * 45} | ||
className="progress" | ||
/> | ||
<text x="60" y="70" textAnchor="middle" fill="white" fontSize="30px">{`${Math.floor(percentage)}%`}</text> | ||
<style jsx>{` | ||
.progress { | ||
transition: stroke-dashoffset 0.02s linear; | ||
} | ||
`}</style> | ||
</svg> | ||
); | ||
}; |
Oops, something went wrong.