diff --git a/+page.svelte b/+page.svelte new file mode 100644 index 000000000..9764877b4 --- /dev/null +++ b/+page.svelte @@ -0,0 +1,282 @@ + + +
+ +
+
+ + {#each $shapes as { id, path, color, x, y, width, height }, index} + startDrag(e, index)} + > + + startResize(e, index)} + /> + + {/each} + +
+
+
+ + diff --git a/Final Work/+page.svelte b/Final Work/+page.svelte new file mode 100644 index 000000000..1f55d26b7 --- /dev/null +++ b/Final Work/+page.svelte @@ -0,0 +1,475 @@ + + + + +
+ +
+
+ + {#each $shapes as { id, path, color, x, y, width, height, rotation }, index} + startDrag(e, index)}> + + startResize(e, index)} /> + + {/each} + +
+
+
diff --git a/Final Work/meta.json b/Final Work/meta.json new file mode 100644 index 000000000..b991227fd --- /dev/null +++ b/Final Work/meta.json @@ -0,0 +1,31 @@ +{ + "name": "SVG Shape Generator ", + "description":"The SVG Shape Generator is a user-friendly web application designed to create and customize SVG shapes. Users can select from various predefined shapes, adjust their colors, and manipulate them through dragging and resizing. The tool supports adding multiple shapes, allowing for complex designs. Once satisfied, users can download the final SVG file, making it an ideal solution for graphic designers and web developers looking to create scalable vector graphics efficiently. ", + "contributors": [{ + "name": "Sanskar Srivastava", + "githubId": "dhawalcoder42" + }, { + "name": "Ayush Fating", + "githubId": "Ayush202201070127" + }, + { + "name": "Sayali Jadhav", + "githubId": "sayali-jadhav21" + }, + { + "name": "Chintaluri Sai Srinivas", + "githubId": "SaiSrinivas13" + }, + { + "name": "Prachiti Gaikwad", + "githubId": "prachitig123" + }, + { + "name": "Yash Borkar", + "githubId": "yash-borkar" + }, + { + "name": "Shruti Haware", + "githubId": "shruti-haware" + }] +} \ No newline at end of file diff --git a/meta.json b/meta.json new file mode 100644 index 000000000..1634e823f --- /dev/null +++ b/meta.json @@ -0,0 +1,23 @@ +{ + "name": "SVG Shape Generator ", + "description":"The SVG Shape Generator is a user-friendly web application designed to create and customize SVG shapes. Users can select from various predefined shapes, adjust their colors, and manipulate them through dragging and resizing. The tool supports adding multiple shapes, allowing for complex designs. Once satisfied, users can download the final SVG file, making it an ideal solution for graphic designers and web developers looking to create scalable vector graphics efficiently. ", + "contributors": [{ + "name": "Sanskar Srivastava", + "githubId": "dhawalcoder42" + }, { + "name": "Ayush Fating", + "githubId": "Ayush202201070127" + }, + { + "name": "Sayali Jadhav", + "githubId": "sayali-jadhav21" + }, + { + "name": "Chintaluri Sai Srinivas", + "githubId": "SaiSrinivas13" + }, + { + "name": "Yash Borkar", + "githubId": "yash-borkar" + }] +} diff --git a/package.json b/package.json index 24d9001e6..c637234af 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ }, "dependencies": { "@faker-js/faker": "^8.4.1", - "@sveltejs/adapter-node": "^1.3.1", "axios": "^1.7.2", "cheerio": "^1.0.0-rc.12", "cors": "^2.8.5", @@ -35,6 +34,7 @@ "jspdf": "^2.5.1", "pdf-lib": "^1.17.1", "svelte-awesome-color-picker": "^3.1.0", + "svelte-svg": "^0.0.7", "svelte-tags-input": "^6.0.0", "tailwindcss": "^3.3.5", "tesseract.js": "^5.0.2", diff --git a/src/routes/(tools)/svg-shape-generator/+page.svelte b/src/routes/(tools)/svg-shape-generator/+page.svelte index 55b5a5ecf..ea92cd8ed 100644 --- a/src/routes/(tools)/svg-shape-generator/+page.svelte +++ b/src/routes/(tools)/svg-shape-generator/+page.svelte @@ -1,11 +1,178 @@ - -
- -
- - \ No newline at end of file + import { writable } from 'svelte/store'; + + let color = '#FF0066'; + let svgShape = 'M150 0 L75 200 L225 200 Z'; + const shapes = writable([]); + + let dragState = { + isDragging: false, + isResizing: false, + startX: 0, + startY: 0, + shapeIndex: null + }; + + function addShape() { + shapes.update(items => [ + ...items, + { id: items.length, path: svgShape, color, x: 0, y: 0, width: 100, height: 100 } + ]); + } + + function downloadSVG() { + const svgContent = ` + + ${$shapes.map(shape => ``).join('')} + + `; + const blob = new Blob([svgContent], { type: 'image/svg+xml' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = 'shape.svg'; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + } + + function startDrag(event, index) { + dragState.isDragging = true; + dragState.startX = event.clientX; + dragState.startY = event.clientY; + dragState.shapeIndex = index; + } + + function startResize(event, index) { + dragState.isResizing = true; + dragState.startX = event.clientX; + dragState.startY = event.clientY; + dragState.shapeIndex = index; + } + + function onMouseMove(event) { + if (dragState.isDragging && dragState.shapeIndex !== null) { + const dx = event.clientX - dragState.startX; + const dy = event.clientY - dragState.startY; + shapes.update(items => { + const updatedItems = [...items]; + const shape = updatedItems[dragState.shapeIndex]; + shape.x += dx; + shape.y += dy; + dragState.startX = event.clientX; + dragState.startY = event.clientY; + return updatedItems; + }); + } else if (dragState.isResizing && dragState.shapeIndex !== null) { + const dx = event.clientX - dragState.startX; + const dy = event.clientY - dragState.startY; + shapes.update(items => { + const updatedItems = [...items]; + const shape = updatedItems[dragState.shapeIndex]; + shape.width += dx; + shape.height += dy; + dragState.startX = event.clientX; + dragState.startY = event.clientY; + return updatedItems; + }); + } + } + + function onMouseUp() { + dragState.isDragging = false; + dragState.isResizing = false; + dragState.shapeIndex = null; + } + + + window.addEventListener('mousemove', onMouseMove); + window.addEventListener('mouseup', onMouseUp); + + + + +
+ +
+
+ + {#each $shapes as { id, path, color, x, y, width, height }, index} + startDrag(e, index)}> + + startResize(e, index)} /> + + {/each} + +
+
+
+ \ No newline at end of file diff --git a/src/routes/(tools)/svg-shape-generator/meta.json b/src/routes/(tools)/svg-shape-generator/meta.json index cea5af16b..74085fc3b 100644 --- a/src/routes/(tools)/svg-shape-generator/meta.json +++ b/src/routes/(tools)/svg-shape-generator/meta.json @@ -1,9 +1,9 @@ { "name": "SVG Shape Generator ", - "description":"", + "description":"The SVG Shape Generator is a user-friendly web application designed to create and customize SVG shapes. Users can select from various predefined shapes, adjust their colors, and manipulate them through dragging and resizing. The tool supports adding multiple shapes, allowing for complex designs. Once satisfied, users can download the final SVG file, making it an ideal solution for graphic designers and web developers looking to create scalable vector graphics efficiently. ", "contributors": [{ - "name": "", - "githubId": "" + "name": "Sanskar Srivastava", + "githubId": "https://github.com/dhawalcoder42" }, { "name": "", "githubId": "" diff --git a/src/routes/tools.json b/src/routes/tools.json index 4618b3690..ee75ec1dd 100644 --- a/src/routes/tools.json +++ b/src/routes/tools.json @@ -134,6 +134,33 @@ } ] }, + "camera-recorder-2": { + "name": "Camera Recorder 2", + "link": "/camera-recorder-2", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, "code-comparison-tool": { "name": "Code Comparison Tool", "link": "/code-comparison-tool", @@ -161,6 +188,87 @@ } ] }, + "color-blindness-simulator": { + "name": "Color Blindness Simulator", + "link": "/color-blindness-simulator", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, + "color-blindness-simulator-2": { + "name": "Color Blindness Simulator", + "link": "/color-blindness-simulator-2", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, + "color-tools": { + "name": "Color Tools", + "link": "/color-tools", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, "css-animator": { "name": "CSS Animator", "link": "/css-animator", @@ -442,6 +550,60 @@ } ] }, + "integer-toolkit": { + "name": "Integer Toolkit", + "link": "/integer-toolkit", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, + "integer-toolkit-2": { + "name": "Integer Toolkit", + "link": "/integer-toolkit-2", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, "keyword-density-checker": { "name": "Keyword Density Checker", "link": "/keyword-density-checker", @@ -469,6 +631,33 @@ } ] }, + "list-toolkit": { + "name": "List Toolkit", + "link": "/list-toolkit", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, "living-background-generator": { "name": "Living Background Generator", "link": "/living-background-generator", @@ -549,6 +738,33 @@ } ] }, + "multi-timer-with-alarm": { + "name": "Multi Timer With Alarm", + "link": "/multi-timer-with-alarm", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, "neumorphism-generator": { "name": "Neumorphism Generator", "link": "/neumorphism-generator", @@ -696,6 +912,87 @@ } ] }, + "svg-placeholder-generator": { + "name": "SVG Placeholder Generator", + "link": "/svg-placeholder-generator", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, + "svg-shape-generator": { + "name": "SVG Shape Generator ", + "link": "/svg-shape-generator", + "description": "The SVG Shape Generator is a user-friendly web application designed to create and customize SVG shapes. Users can select from various predefined shapes, adjust their colors, and manipulate them through dragging and resizing. The tool supports adding multiple shapes, allowing for complex designs. Once satisfied, users can download the final SVG file, making it an ideal solution for graphic designers and web developers looking to create scalable vector graphics efficiently. ", + "contributors": [ + { + "name": "Sanskar Srivastava", + "githubId": "https://github.com/dhawalcoder42" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, + "svg-shape-generator-2": { + "name": "SVG Shape Generator ", + "link": "/svg-shape-generator-2", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] + }, "text-toolkit": { "name": "Text Toolkit", "link": "/text-toolkit", @@ -820,5 +1117,32 @@ "githubId": "" } ] + }, + "youtube-thumbnail-grabber": { + "name": "YouTube Thumbnail Grabber", + "link": "/youtube-thumbnail-grabber", + "description": "", + "contributors": [ + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + }, + { + "name": "", + "githubId": "" + } + ] } } \ No newline at end of file