MicroSim Add Icons
The microsim-add-icons skill adds clickable Creative Commons license and fullscreen navigation icons to the control region of an existing p5.js MicroSim. The icons appear in the lower right corner using distance-based click detection.
Key Capabilities
This skill enhances MicroSims with:
- Creative Commons Icon: Links to license information
- Fullscreen Icon: Enables fullscreen viewing mode
- Distance-based Click Detection: Responsive icon interaction
- Consistent Positioning: Lower right corner placement
When to Use
Use this skill when:
- Adding license information access to a MicroSim
- Enabling fullscreen mode via an icon
- Enhancing a MicroSim with clickable UI elements
- Following the icons demo pattern from the MicroSims repository
- Standardizing icon behavior across multiple MicroSims
What Gets Added
The skill adds approximately 40 lines of code including:
- Icon Variables: Position and size declarations
- Draw Functions: Icon rendering in the draw loop
- Click Handler:
mousePressed()function for icon interaction - Position Updates: Icon repositioning in
windowResized()
Prerequisites
The target file should be a p5.js MicroSim following the standard pattern with:
- Global variables section
setup()functiondraw()functionwindowResized()function
Workflow
- Identify the target MicroSim JavaScript file
- Read the existing file to understand its structure
- Add icon variables to the global section
- Add icon drawing code to the
draw()function - Add or update the
mousePressed()function - Update icon positions in
windowResized()
Icon Appearance
The icons use simple geometric shapes:
- CC Icon: Circle with "CC" text
- Fullscreen Icon: Four corner brackets
Both icons change appearance on hover to indicate interactivity.
Integration
This skill is typically used after a MicroSim is functionally complete to add polish and standard navigation elements before publication.