-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added plan for code animation orchestration
- Loading branch information
Showing
16 changed files
with
405 additions
and
209 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,5 +1,12 @@ | ||
|
||
export default interface ICodeState { | ||
currentIndex : number, | ||
currentIndex : number | ||
canRender: boolean | ||
} | ||
} | ||
|
||
|
||
export const State = { | ||
Initial: 1, | ||
Center: 2, | ||
Image: 3 | ||
} as const; |
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 |
---|---|---|
@@ -1,28 +1,37 @@ | ||
import React from 'react' | ||
import ICodeState from './ICodeState' | ||
import ICodeState, { State } from './ICodeState' | ||
import { initialGreeting } from './code_text' | ||
|
||
|
||
export default function CodeRenderer({codeState} : {codeState: ICodeState}) : React.ReactNode { | ||
|
||
let rendererIdx = codeState.canRender ? codeState.currentIndex + 1 : codeState.currentIndex | ||
|
||
switch(rendererIdx) { | ||
case 0: return ( | ||
<></> | ||
) | ||
case 1: return ( | ||
<div> | ||
<span className='text-gray-800 dark:text-gray-200'> | ||
Hello World | ||
</span> | ||
default: // State.Initial | ||
return ( | ||
<div> | ||
<span className='text-gray-800 dark:text-gray-200'> | ||
{initialGreeting} | ||
</span> | ||
</div> | ||
) | ||
case State.Center: return ( | ||
<div key={2} className='flex h-full flex-col justify-center'> | ||
<div className='w-full flex flex-row justify-center'> | ||
<span className='text-gray-800 dark:text-gray-200'>{initialGreeting}</span> | ||
</div> | ||
</div> | ||
) | ||
default: return ( | ||
<div key={2} className='flex h-full flex-col justify-center'> | ||
case State.Image: return ( | ||
<div key={2} className='flex h-full flex-col justify-center items-center'> | ||
<img src='profile_pic.jpg' className='w-32 h-32 rounded-full border border-white' /> | ||
<div className='w-full flex flex-row justify-center'> | ||
<span className='text-gray-800 dark:text-gray-200'>Hello World</span> | ||
|
||
<span className='text-gray-800 dark:text-gray-200'>{initialGreeting}</span> | ||
</div> | ||
</div> | ||
) | ||
|
||
} | ||
} |
Oops, something went wrong.