Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc9fef3c

Browse files
Added Welcome Page
1 parente4f69bd commitc9fef3c

File tree

3 files changed

+99
-2
lines changed

3 files changed

+99
-2
lines changed

‎src/App.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import Alert from "./components/Alert";
22
importDockfrom"./components/Dock";
33
importEditorfrom"./components/Editor";
44
importSettingsfrom"./components/Settings";
5+
importErrorfrom"./components/Error";
6+
importWelcomefrom"./components/Welcome";
57
import{alert}from"./lib/backend";
68
import{useAtomValue}from"jotai";
7-
importErrorfrom"./components/Error";
89

910
//@ts-ignore
1011
importGridLinesfrom"react-gridlines";
1112

1213
functionApp(){
13-
1414
constalertMsg=useAtomValue(alert);
1515

1616
return(
@@ -41,6 +41,9 @@ function App() {
4141

4242
{/* Error Page */}
4343
<Error/>
44+
45+
{/* Welcome Page */}
46+
<Welcome/>
4447
</>
4548
);
4649
}

‎src/components/Dock.tsx‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Settings,
77
Cable,
88
HardDriveDownload,
9+
BookMarked,
910
}from"lucide-react";
1011
importclsxfrom"clsx";
1112
import{
@@ -219,6 +220,31 @@ const Dock = () => {
219220
</p>
220221
</div>
221222

223+
{/* Help/Welcome FSM */}
224+
<div
225+
onClick={()=>
226+
currentState=="welcome"
227+
?setCurrentState("nil")
228+
:setCurrentState("welcome")
229+
}
230+
className={clsx(
231+
"flex gap-2 p-2 border border-border-bg rounded-xl hover:scale-130 hover:-translate-y-5 active:scale-100 cursor-pointer transition-all ease-in-out duration-300",
232+
{
233+
"bg-secondary-bg":currentState!="welcome",
234+
"bg-blue-500":currentState=="welcome",
235+
}
236+
)}
237+
>
238+
<BookMarked
239+
size={DockIconSize}
240+
color={DockIconColor}
241+
className="pointer-events-none"
242+
/>
243+
<pclassName="text-white font-github font-semibold text-balance">
244+
Welcome
245+
</p>
246+
</div>
247+
222248
{/* Dock Items */}
223249
</div>
224250
</div>

‎src/components/Welcome.tsx‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
//@ts-nocheck
2+
import{ArrowUpRight,ChevronRight,ChevronLeft}from"lucide-react";
3+
import{editorState}from"../lib/backend";
4+
import{useAtom}from"jotai";
5+
importclsxfrom"clsx";
6+
7+
exportdefaultfunctionWelcome(){
8+
const[currentEditorState,setCurrentEditorState]=useAtom(editorState);
9+
10+
return(
11+
<div
12+
className={clsx(
13+
"absolute top-0 left-0 z-20 w-screen h-screen bg-[#1e1e1ebb] flex justify-center items-center transition-all ease-in-out duration-500",
14+
{
15+
"hidden pointer-events-none opacity-0":
16+
currentEditorState!="welcome",
17+
}
18+
)}
19+
>
20+
{/* Settings Window */}
21+
<div
22+
className={clsx(
23+
"flex flex-col justify-center items-center py-8 px-5 gap-5 w-100 h-fit bg-primary-bg border border-border-bg rounded-4xl shadow-[0px_0px_100px_0px_#00000080] transition-all ease-in-out duration-500",
24+
{
25+
"hidden pointer-events-none opacity-0 scale-0":
26+
currentEditorState!="welcome",
27+
}
28+
)}
29+
>
30+
<Intro/>
31+
32+
<divclassName="flex gap-5">
33+
<buttonclassName="flex text-sm gap-2 font-github font-semibold items-center rounded-xl text-black bg-gray-200 px-5 py-2 hover:scale-110 transition-all cursor-pointer active:scale-100 ease-in-out">
34+
<ChevronLeftcolor="#000000"size={15}/>
35+
</button>
36+
<buttonclassName="flex text-sm gap-2 font-github font-semibold items-center rounded-xl text-black bg-gray-200 px-5 py-2 hover:scale-110 transition-all cursor-pointer active:scale-100 ease-in-out">
37+
<ChevronRightcolor="#000000"size={15}/>
38+
</button>
39+
</div>
40+
</div>
41+
</div>
42+
);
43+
}
44+
45+
// Pages for the Welcom Popup
46+
functionIntro(){
47+
constprofileImg="https://avatars.githubusercontent.com/karthik-saiharsh";
48+
return(
49+
<divclassName="w-full flex flex-col justify-center items-center select-none">
50+
<img
51+
src={profileImg}
52+
alt="Karthik Saiharsh"
53+
className="rounded-full w-60 h-60 border-2 border-blue-500"
54+
/>
55+
<pclassName="font-github text-white font-semibold text-center my-5">
56+
Karthik Saiharsh
57+
</p>
58+
<pclassName="font-github text-white font-normal text-center w-[90%]">
59+
Hey! I'm Karthik, the creator of FSM Engine. Glad you took time to check
60+
it out.
61+
</p>
62+
<buttonclassName="flex text-sm gap-2 font-github font-semibold mt-5 items-center rounded-xl text-white bg-blue-500 px-5 py-2 hover:scale-110 transition-all cursor-pointer active:scale-100 ease-in-out">
63+
View Github Repo
64+
<ArrowUpRightcolor="#ffffff"size={24}/>
65+
</button>
66+
</div>
67+
);
68+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp