An interactive web application for visualizing and animating molecular structures, built with React, TypeScript, and modern web technologies.
Interactive visualization of Rutin (C27H30O16) with animation controls and molecular information display
- ๐จ Interactive Molecular Visualization: Explore molecular structures with smooth, real-time animations
- ๐ Dynamic Animation Controls: Adjust rotation speed, direction, and animation parameters
- ๐ฑ Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
- ๐ฏ Educational Focus: Perfect for students, educators, and chemistry enthusiasts
- ๐ Screensaver Mode: Beautiful molecular animations for ambient display
- โ๏ธ Customizable Settings: Personalize your viewing experience with various options
- ๐ญ Multiple Molecules: Pre-loaded library of common molecular structures
- ๐ฌ Scientific Accuracy: Accurate representation of molecular geometry and bonds
- Node.js (v16.0.0 or higher)
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/yuis-ice/molecular-structure-animation.git cd molecular-structure-animation -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:5173to see the application running.
npm run dev- Start the development server with hot reloadnpm run build- Build the project for productionnpm run preview- Preview the production build locallynpm run lint- Run ESLint to check code quality
src/
โโโ components/ # React components
โ โโโ MolecularDisplay.tsx # Main molecular visualization component
โ โโโ MolecularScreensaver.tsx # Screensaver mode component
โ โโโ SettingsPanel.tsx # Settings and controls panel
โโโ data/ # Static data and configurations
โ โโโ molecules.ts # Molecular structure definitions
โโโ hooks/ # Custom React hooks
โ โโโ useLocalStorage.ts # Local storage management hook
โโโ types/ # TypeScript type definitions
โ โโโ molecule.ts # Molecular structure types
โโโ App.tsx # Main application component
โโโ main.tsx # Application entry point
โโโ index.css # Global styles and Tailwind imports
The application uses a standardized format for molecular data:
interface Molecule {
id: string;
name: string;
formula: string;
atoms: Atom[];
bonds: Bond[];
description?: string;
}
interface Atom {
id: string;
element: string;
position: [number, number, number];
color?: string;
}
interface Bond {
id: string;
atomIds: [string, string];
type: 'single' | 'double' | 'triple';
}- Rotation: Molecules automatically rotate for optimal viewing
- Settings Panel: Click the settings icon to access customization options
- Screensaver Mode: Enable for continuous ambient molecular animations
- Adjust rotation speed and direction
- Toggle between different molecular structures
- Customize visual appearance and colors
- Enable/disable various display elements
We welcome contributions from the community! Please see our Contributing Guide for details on how to get started.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Bug Reports: Please use our Bug Report Template
- Feature Requests: Please use our Feature Request Template
- General Discussion: Visit our GitHub Discussions
- Framework: React 18.3+
- Language: TypeScript 5.5+
- Build Tool: Vite 5.4+
- Styling: Tailwind CSS 3.4+
- Icons: Lucide React
- Linting: ESLint with TypeScript support
This project is perfect for:
- Chemistry Education: Visualizing molecular structures and chemical bonds
- Interactive Learning: Hands-on exploration of molecular geometry
- Presentations: Engaging visual aids for chemistry lessons
- Research: Quick visualization of molecular compounds
- Self-Study: Independent learning and exploration
The application includes pre-configured data for common molecules:
- Water (HโO)
- Carbon Dioxide (COโ)
- Methane (CHโ)
- Ammonia (NHโ)
- Benzene (CโHโ)
- Caffeine (CโHโโNโOโ)
- And many more...
The application is deployed and available at: http://molecular.pages.dev/
npm run buildThe built files will be in the dist/ directory, ready for deployment to any static hosting service.
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to the chemistry education community for inspiration
- Built with modern web technologies and best practices
- Designed for accessibility and cross-platform compatibility
If you encounter any issues or have questions:
- Check the existing issues
- Join our discussions
- Create a new issue using the appropriate template
Made with โค๏ธ for the chemistry education community
Explore the fascinating world of molecular structures through interactive visualization!
