Skip to content

Commit

Permalink
Works
Browse files Browse the repository at this point in the history
  • Loading branch information
third774 committed Oct 13, 2023
1 parent 34d5fb0 commit 7316c3a
Show file tree
Hide file tree
Showing 9 changed files with 386 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["prettier-plugin-organize-imports"]
}
125 changes: 123 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vesta",
"name": "split-flap-board",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand All @@ -10,9 +10,12 @@
"@types/node": "^16.18.58",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"clsx": "^2.0.0",
"framer-motion": "^10.16.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"tailwind-merge": "^1.14.0",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
Expand All @@ -39,5 +42,11 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"prettier": "^3.0.3",
"prettier-plugin-organize-imports": "^3.2.3",
"tailwindcss": "^3.3.3",
"tailwindcss-3d": "^1.0.1"
}
}
68 changes: 50 additions & 18 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,56 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import { useEffect, useState } from "react";
import "./App.css";
import { SplitFlapBoard } from "./SplitFlapBoard";

const lyrics = [
"Now, this is a story",
"all about how",
"My life got flipped-turned",
"upside down",
"And I'd like to take a minute",
"Just sit right there",
"I'll tell you how I became",
"the prince of a town called Bel-Air",
"In West Philadelphia",
"born and raised",
"On the playground was where",
"I spent most of my days",
"Chillin' out,",
"maxin', relaxin', all cool",
"And all shootin' some b-ball",
"outside of the school",
"When a couple of guys",
"who were up to no good",
"Started making trouble",
"in my neighborhood",
"I got in one little fight",
"and my mom got scared",
"She said,",
"\"You're movin' with your auntie",
'and uncle in Bel-Air"',
];

function App() {
const [idx, setIdx] = useState(0);

useEffect(() => {
const interval = window.setInterval(() => {
setIdx((i) => i + 1);
}, 6000);

return () => clearInterval(interval);
}, []);

return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<div className="flex flex-col items-center justify-center h-full gap-4 bg-stone-600">
<SplitFlapBoard
text={lyrics[idx % lyrics.length].padEnd(
lyrics
.map((str) => str.length)
.reduce((acc, len) => (len > acc ? len : acc), 0),
" ",
)}
/>
</div>
);
}
Expand Down
Loading

0 comments on commit 7316c3a

Please sign in to comment.