A beautiful, cyberpunk-themed loading screen with real-time code typing animation and smooth progress tracking. Perfect for developer tools, coding applications, or any project that wants a tech-savvy loading experience.
✨ Real-time Code Typing: Watch algorithms type out character by character 🎯 Perfect Synchronization: Typing completes exactly when progress reaches 100% 🔄 Random Algorithm Selection: 8+ different algorithms (Dijkstra, QuickSort, A*, etc.) 📜 Smooth Auto-scrolling: Terminal follows the typing cursor naturally 🎨 Cyberpunk Theme: Misty background with neon effects ⚡ Highly Customizable: Easy to configure and extend 📱 Fixed Size: Consistent 900x500px terminal window 🚀 Performance Optimized: Smooth 60fps animations
npm installimport { LoadingScreen } from './components/LoadingScreen';
function App() {
const [isLoading, setIsLoading] = useState(true);
return (
<>
{isLoading && (
<LoadingScreen
onComplete={() => setIsLoading(false)}
duration={5000}
brandText="Loading Your App..."
/>
)}
{/* Your app content */}
</>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
onComplete |
() => void |
- | Callback when loading completes |
duration |
number |
5000 |
Loading duration in milliseconds |
brandText |
string |
"Loading..." |
Text displayed at the top |
codeSnippets |
CodeSnippet[] |
defaultCodeSnippets |
Custom code snippets to display |
interface CodeSnippet {
language: string;
filename: string;
code: string;
typingSpeed?: number;
}const myCodeSnippets = [
{
language: 'javascript',
filename: 'myAlgorithm.js',
code: `function myCustomAlgorithm() {
// Your code here
return "Hello World!";
}`,
typingSpeed: 25
}
];
<LoadingScreen
codeSnippets={myCodeSnippets}
onComplete={() => console.log('Done!')}
/>The component uses Tailwind CSS with custom cyberpunk theme variables. You can customize colors by modifying the CSS variables in src/index.css:
:root {
--color-cyber-blue: #00d4ff;
--color-cyber-green: #64ffda;
--color-cyber-purple: #ff6b9d;
/* ... more variables */
}The loading screen comes with 8 pre-built algorithm implementations:
- Dijkstra's Algorithm - Shortest path finding
- QuickSort - Efficient sorting with in-place version
- Binary Search - Fast searching in sorted arrays
- Merge Sort - Stable sorting algorithm
- BFS & DFS - Graph traversal algorithms
- Dynamic Programming - Fibonacci, LCS, Knapsack, Edit Distance
- Heap Sort - Sorting using max heap
- A Algorithm* - Pathfinding for grids
- Copy the
src/componentsfolder to your project - Copy the
src/typesandsrc/utilsfolders - Add the CSS from
src/index.cssto your styles - Install dependencies:
framer-motion,react,react-dom
The core logic can be adapted to other frameworks:
- Vue.js: Convert React components to Vue components
- Angular: Create Angular components with similar structure
- Vanilla JS: Use the typing and progress logic with DOM manipulation
{
"framer-motion": "^12.23.21",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"tailwindcss": "^4.1.13"
}- Chrome/Edge 88+
- Firefox 85+
- Safari 14+
- Mobile browsers with modern JS support
- 60fps smooth animations
- Hardware-accelerated scrolling
- Optimized re-renders with React 18 features
- Memory efficient with cleanup on unmount
MIT License - feel free to use in commercial and personal projects.
- Fork the repository
- Create a feature branch
- Add your improvements
- Submit a pull request
Check out the examples/ folder for integration examples with different frameworks and use cases.