diff --git a/repl/README.md b/repl/README.md index ee7c4842..e3e2b0b8 100644 --- a/repl/README.md +++ b/repl/README.md @@ -44,3 +44,4 @@ currently broken / buggy: - [x] highlighting sometimes drops highlights (zeldasRescue first note) - [ ] highlighting still sometimes drops highlights (zeldasRescue somtimes) - [ ] highlighting out of range error is back (delete large chunk at the top while highlighting below is triggered) +- [ ] find a way to display errors when console is closed / another tab selected diff --git a/repl/src/App.jsx b/repl/src/App.jsx index d782160d..5edb72ce 100644 --- a/repl/src/App.jsx +++ b/repl/src/App.jsx @@ -24,6 +24,7 @@ import StopCircleIcon from '@heroicons/react/20/solid/StopCircleIcon'; import CommandLineIcon from '@heroicons/react/20/solid/CommandLineIcon'; import SparklesIcon from '@heroicons/react/20/solid/SparklesIcon'; import LinkIcon from '@heroicons/react/20/solid/LinkIcon'; +import XMarkIcon from '@heroicons/react/20/solid/XMarkIcon'; import AcademicCapIcon from '@heroicons/react/20/solid/AcademicCapIcon'; initAudioOnFirstClick(); @@ -98,6 +99,7 @@ const isEmbedded = window.location !== window.parent.location; function App() { const [view, setView] = useState(); // codemirror view const [lastShared, setLastShared] = useState(); + const [activeFooter, setActiveFooter] = useState('console'); // logger const [log, setLog] = useState([]); @@ -121,11 +123,11 @@ function App() { }); }, []), ); - const logBox = useRef(); + const footerContent = useRef(); useLayoutEffect(() => { - if (logBox.current) { + if (footerContent.current) { // scroll log box to bottom when log changes - logBox.current.scrollTop = logBox.current?.scrollHeight; + footerContent.current.scrollTop = footerContent.current?.scrollHeight; } }, [log]); @@ -235,9 +237,30 @@ function App() { started && logger('[edit] code changed. hit ctrl+enter to update'); }; + const FooterTab = ({ label, children, type }) => ( + <> +
setActiveFooter(type)} + className={cx( + 'h-8 px-2 text-white cursor-pointer hover:text-highlight flex items-center space-x-1', + activeFooter === type ? 'border-b' : '', + )} + > + {label} +
+ {activeFooter === type && <>{children}} + + ); + return ( // bg-gradient-to-t from-blue-900 to-slate-900 -
+ // bg-gradient-to-t from-green-900 to-slate-900 +
{!hideHeader && (
{!isEmbedded && ( - @@ -293,7 +316,7 @@ function App() { {!isEmbedded && ( learn @@ -302,7 +325,7 @@ function App() { {!isEmbedded && ( )} {isEmbedded && ( -
)} -
+
); diff --git a/repl/tailwind.config.js b/repl/tailwind.config.js index 10e3ad8d..96626d74 100644 --- a/repl/tailwind.config.js +++ b/repl/tailwind.config.js @@ -19,8 +19,8 @@ module.exports = { bg: '#222222', // header: '#8a91991a', // footer: '#8a91991a', - // header: '#00000050', - header: 'transparent', + header: '#00000050', + // header: 'transparent', footer: '#00000050', }, },