mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-16 01:29:09 +00:00
feat: add skeleton masthead and generic loading page (#182)
* feat: add skeleton masthead and generic loading page * add generic loader to picker page * smooth out spinner, add no-motion state
This commit is contained in:
parent
fa85b30cf0
commit
e0fcfc310e
28 changed files with 380 additions and 30 deletions
|
@ -0,0 +1,12 @@
|
|||
import { Hero } from '@roleypoly/design-system/atoms/hero';
|
||||
import { LoadingFill } from './Loading';
|
||||
export default {
|
||||
title: 'Atoms/Loading Text',
|
||||
component: LoadingFill,
|
||||
};
|
||||
|
||||
export const loading = (args) => (
|
||||
<Hero>
|
||||
<LoadingFill {...args} />
|
||||
</Hero>
|
||||
);
|
30
packages/design-system/atoms/loading-text/Loading.tsx
Normal file
30
packages/design-system/atoms/loading-text/Loading.tsx
Normal file
|
@ -0,0 +1,30 @@
|
|||
const loadingTexts = [
|
||||
'Loading Roleypoly...',
|
||||
'Reticulating splines...',
|
||||
'Mining cryptocoins...',
|
||||
'Going to Mars...',
|
||||
'Building the Box Signature Edition...',
|
||||
'Hiring a new CEO...',
|
||||
'Firing the new CEO...',
|
||||
'Doing a calculation...',
|
||||
'Doin a fixy boi...',
|
||||
'Feeling like a plastic bag...',
|
||||
'Levelling up...',
|
||||
'Your Roleypoly is evolving!!!',
|
||||
'Adding subtitles...',
|
||||
'Rolling... Rolling...',
|
||||
];
|
||||
|
||||
export const LoadingFill = (props: { forceIndex?: keyof typeof loadingTexts }) => {
|
||||
const useEasterEgg = Math.floor(Math.random() * 10) === 0;
|
||||
const index =
|
||||
props.forceIndex !== undefined
|
||||
? props.forceIndex
|
||||
: useEasterEgg
|
||||
? Math.floor(Math.random() * loadingTexts.length)
|
||||
: 0;
|
||||
|
||||
const text = loadingTexts[index];
|
||||
|
||||
return <>{text}</>;
|
||||
};
|
1
packages/design-system/atoms/loading-text/index.ts
Normal file
1
packages/design-system/atoms/loading-text/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export * from './Loading';
|
Loading…
Add table
Add a link
Reference in a new issue