Skip to content

Commit e479763

Browse files
run test
1 parent de545fd commit e479763

File tree

3 files changed

+737
-1
lines changed

3 files changed

+737
-1
lines changed

.github/workflows/gh.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy Static Site to GitHub Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch (usually 'main' or 'master')
6+
push:
7+
branches: ["main"] # Change this if your default branch is different
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false # Set to 'true' if you want to cancel ongoing deployments when a new push occurs
23+
24+
jobs:
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4 # Checks out your repository code
34+
35+
- name: Setup Pages
36+
uses: actions/configure-pages@v5 # Configures GitHub Pages
37+
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3 # Uploads your site files
40+
with:
41+
# Upload entire repository root directory (where index.html is)
42+
path: '.'
43+
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4 # Deploys the uploaded artifact to Pages

README.md

Lines changed: 122 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,122 @@
1-
# SVG-Shape-Generator
1+
# 📐 SVG Shape Generator
2+
3+
A versatile web tool for generating various SVG shapes (Polygons, Stars, Circles, Ellipses, Rectangles, Lines) with customizable parameters and live preview. ✨
4+
5+
---
6+
7+
## ✨ Features
8+
9+
* 🎨 **Multiple Shape Types:** Generate:
10+
* Polygons (Regular)
11+
* Stars
12+
* Circles
13+
* Ellipses
14+
* Rectangles
15+
* Rounded Rectangles
16+
* Lines
17+
* 🎛️ **Customizable Parameters:** Adjust shape-specific properties:
18+
* Points/Sides (Polygon, Star)
19+
* Outer Radius (Polygon, Star)
20+
* Inner Radius (Star)
21+
* Radius (Circle)
22+
* Radius X/Y (Ellipse)
23+
* Width/Height (Rectangle)
24+
* Corner Radius RX/RY (Rounded Rectangle)
25+
* Start/End Coordinates (Line)
26+
* Center Coordinates (Circle, Ellipse)
27+
* Top-Left Coordinates (Rectangle)
28+
* 🎨 **Appearance Controls:**
29+
* Fill Color (Not applicable for Line)
30+
* Stroke Color
31+
* Stroke Width
32+
* 👁️ **Live Preview:** See the generated SVG shape update instantly as you change parameters.
33+
* 💻 **Code Generation:** Displays the complete, formatted SVG code for the generated shape.
34+
* 🖱️ **Click-to-Copy:** Easily copy the generated SVG code.
35+
* 📱 **Responsive Design:** Basic responsive layout.
36+
* 💬 **User Feedback:** Displays messages for success (e.g., "SVG code copied!") or errors.
37+
38+
---
39+
40+
## 🚀 How to Use
41+
42+
1. Clone this repository or download the `index.html` file.
43+
2. Open `index.html` in your web browser.
44+
3. Select the desired **Shape Type** from the dropdown menu.
45+
4. The relevant controls for the selected shape will appear.
46+
5. Adjust the sliders and color pickers to customize the shape and its appearance.
47+
6. The **Preview** area will update in real-time. 🔥
48+
7. The **Generated SVG Code** box shows the code for the current shape.
49+
8. Click the **Copy SVG Code** button to copy the code to your clipboard. 📋
50+
51+
---
52+
53+
## 💻 Technology Stack
54+
55+
* **HTML:** Page structure and controls.
56+
* **CSS (Tailwind CSS):** Styling & layout (via CDN).
57+
* **JavaScript:**
58+
* Handles user input from sliders, dropdowns, and color pickers.
59+
* Calculates shape geometry (points, coordinates, radii).
60+
* Dynamically generates SVG element strings.
61+
* Updates the live preview and code output areas.
62+
* Manages control visibility based on selected shape type.
63+
* Implements copy-to-clipboard functionality.
64+
65+
---
66+
67+
## 🤝 Contributing
68+
69+
Contributions are welcome! 🎉 Whether it's bug fixes, adding new shapes, improving the UI, or enhancing features, please feel free to contribute.
70+
71+
**How to Contribute:**
72+
73+
1. **Fork the Repository:** Click the 'Fork' button.
74+
2. **Clone Your Fork:**
75+
3. **Create a New Branch:**
76+
```bash
77+
git checkout -b feature/add-path-shape
78+
# or
79+
git checkout -b fix/star-calculation-bug
80+
```
81+
4. **Make Your Changes.**
82+
5. **Test Your Changes.**
83+
6. **Commit Your Changes** (Consider [Conventional Commits](https://www.conventionalcommits.org/)):
84+
```bash
85+
git add .
86+
git commit -m "feat: Add support for SVG <path> element"
87+
# or
88+
git commit -m "fix: Correct inner radius calculation for stars"
89+
```
90+
7. **Push to Your Fork:**
91+
```bash
92+
git push origin feature/add-path-shape
93+
```
94+
8. **Open a Pull Request (PR):** Go to the original repository and open a PR.
95+
* Provide a clear title and description.
96+
* Link any relevant issues.
97+
98+
**Reporting Bugs:**
99+
100+
* Use the GitHub Issues tab.
101+
* Provide a clear title, description, and steps to reproduce.
102+
103+
**Suggesting Enhancements:**
104+
105+
* Use the GitHub Issues tab.
106+
* Provide a clear title and detailed description.
107+
108+
---
109+
110+
## 💡 Potential Enhancements
111+
112+
* **More Shapes:** Add support for `<path>` elements (e.g., arcs, curves), `<text>`, or more complex predefined shapes.
113+
* **Transformations:** Add controls for `rotate`, `scale`, `skew` transformations.
114+
* **Gradients/Patterns:** Allow using gradients or patterns for fills/strokes.
115+
* **ViewBox Control:** Allow users to adjust the SVG `viewBox`.
116+
* **Export Options:** Add options to download the generated SVG as a `.svg` file.
117+
* **Code Formatting Options:** Allow choosing different SVG code formatting styles.
118+
* **UI/UX:** Improve slider precision, add input fields for exact values, enhance visual design.
119+
120+
---
121+
122+
Happy Generating! 📐

0 commit comments

Comments
 (0)