1. What Is This App?
Button Designer Studio is a live button customization tool. It allows users to design a button visually and instantly generate CSS code for the button.
As you change settings in the sidebar, the preview button updates automatically in real time.
Illustration — App Layout
Live Preview
The button updates instantly whenever a setting changes.
2. Understanding the Sidebar Controls
Button Text
Changes the text displayed on the button.
- "Click Me"
- "Submit"
- "Download"
Background Color
Changes the button background color using a color picker.
Text Color
Changes the text color displayed on the button.
Padding
Controls the spacing inside the button.
- Vertical Padding → top and bottom spacing
- Horizontal Padding → left and right spacing
Illustration — Padding
Compact button
Large button
Border Radius
Controls how rounded the corners of the button are.
3. Shadow Controls
The app allows full customization of button shadows.
- Shadow X → horizontal shadow movement
- Shadow Y → vertical shadow movement
- Blur → softness of the shadow
- Spread → size expansion
- Shadow Color → shadow color
Illustration — Shadow Effects
4. Hover & Active Effects
Hover translateY
Moves the button vertically when the mouse hovers over it.
The button moves downward when hovered.
Active Scale
Controls how much the button shrinks when clicked.
Clicking the button creates a press animation.
5. Generated CSS Output
The textarea automatically displays the generated CSS code.
You can copy this CSS and use it in your own websites or projects.
6. How the JavaScript Works
Step 1 — Read Inputs
JavaScript first grabs all form controls using
document.getElementById().
Step 2 — Build CSS
The buildCSS() function generates CSS code as text.
Step 3 — Apply Styles
The preview button updates immediately using inline styles.
Step 4 — Dynamic Style Injection
A new <style> tag is injected into the page so hover and active animations work correctly.
7. Features Summary
- ✔ Real-time button preview
- ✔ Live CSS generation
- ✔ Color customization
- ✔ Padding controls
- ✔ Rounded corners
- ✔ Shadow editor
- ✔ Hover animations
- ✔ Click animations
- ✔ Responsive layout