A beautiful interactive particle animation that creates a dynamic AWS logo effect using PyScript and HTML Canvas.
- 🔄 Interactive particle animation with AWS logo design
- 🖱️ Responsive to mouse movement and touch interactions
- 📱 Mobile-friendly and fully responsive
- 🎨 Smooth color transitions and beautiful effects
- ⚡ Real-time particle physics simulation
- 🌈 Dynamic color effects based on interaction
.
├── index.html # Main HTML file with PyScript integration
├── main.py # Python code for particle animation
├── requirements.txt # Python package dependencies
├── vercel.json # Vercel deployment configuration
└── netlify.toml # Netlify deployment configuration
- Python 3.x
- Required Python packages:
- js==1.0
- Pyodide (loaded via CDN in the browser)
-
Clone this repository:
git clone https://github.com/sanjulaonline/html_pyscript.git cd html_pyscript -
Install the required dependencies:
pip install -r requirements.txt
Simply open the index.html file in your web browser. PyScript will automatically:
- Load the Python runtime
- Execute the Python code
- Handle the particle animation
No server setup or build process is required!
The main animation function includes several customizable parameters:
def create_particle():
return {
"x": x,
"y": y,
"base_x": x,
"base_y": y,
"size": Math.random() * 1 + 0.5, # Particle size
"color": "white", # Default particle color
"scatter": "#FF9900" or "#00DCFF", # Scatter effect color
"life": Math.random() * 100 + 50 # Particle lifetime
}You can adjust these parameters to achieve different effects:
- size: Controls the size of particles (default: 0.5-1.5)
- color: Sets the default particle color
- scatter: Defines the color when particles scatter
- life: Determines how long particles live before regenerating
- The program creates a canvas element and initializes the AWS logo
- Generates particles based on the logo's shape
- Tracks mouse/touch position for interaction
- Updates particle positions based on:
- Mouse/touch proximity
- Base position
- Physics calculations
- Renders particles with dynamic colors and effects
- Continuously animates the scene using requestAnimationFrame
-
Install Vercel CLI:
npm install -g vercel
-
Deploy:
vercel
-
Install Netlify CLI:
npm install -g netlify-cli
-
Deploy:
netlify deploy
Or deploy through the Netlify website:
- Push your code to GitHub
- Go to Netlify
- Click "New site from Git"
- Choose your repository
- Configure build settings:
- Build command:
pip install -r requirements.txt - Publish directory:
.
- Build command:
- Click "Deploy site"
Feel free to contribute to this project by:
- Adding new particle effects
- Improving the animation performance
- Adding new interactive features
- Reporting issues
For any questions, suggestions, or collaborations, you can reach me on:
- Telegram: @SiXtySL
- GitHub: @sanjulaonline
- LinkedIn: Sanjula
