Spaces:
Running
Running
اصنع لي موقع رسم احترافي
Browse filesFiles changed (7)
- README.md+8-5
- components/footer.jsAdded+64
- components/navbar.jsAdded+39
- components/toolbar.jsAdded+58
- index.html+125-19
- script.jsAdded+35
- style.css+31-20
12345678910---title: Sketchmaster Proemoji: 📚colorFrom: bluecolorTo: redsdk: staticpinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference12345678910111213---title: SketchMaster Pro 🎨colorFrom: pinkcolorTo: purpleemoji: 🐳sdk: staticpinned: falsetags:- deepsite-v3---# Welcome to your new DeepSite project!This project was created with [DeepSite](https://huggingface.co/deepsite).
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364class CustomFooter extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` <style> .footer { background-color: #1e293b; } .footer-link:hover { color: #6366f1; } </style> <footer class="footer text-white py-8 mt-12"> <div class="container mx-auto px-4"> <div class="grid grid-cols-1 md:grid-cols-4 gap-8"> <div> <h3 class="text-lg font-bold mb-4">SketchMaster Pro</h3> <p class="text-gray-400">The ultimate digital drawing platform for artists of all levels.</p> </div> <div> <h4 class="font-semibold mb-4">Features</h4> <ul class="space-y-2"> <li><a href="#" class="footer-link text-gray-400 hover:text-white transition">Drawing Tools</a></li> <li><a href="#" class="footer-link text-gray-400 hover:text-white transition">Brushes</a></li> <li><a href="#" class="footer-link text-gray-400 hover:text-white transition">Layers</a></li> <li><a href="#" class="footer-link text-gray-400 hover:text-white transition">Export Options</a></li> </ul> </div> <div> <h4 class="font-semibold mb-4">Resources</h4> <ul class="space-y-2"> <li><a href="#" class="footer-link text-gray-400 hover:text-white transition">Tutorials</a></li> <li><a href="#" class="footer-link text-gray-400 hover:text-white transition">Documentation</a></li> <li><a href="#" class="footer-link text-gray-400 hover:text-white transition">Blog</a></li> <li><a href="#" class="footer-link text-gray-400 hover:text-white transition">FAQ</a></li> </ul> </div> <div> <h4 class="font-semibold mb-4">Connect</h4> <div class="flex space-x-4"> <a href="#" class="footer-link text-gray-400 hover:text-white transition"> <i data-feather="twitter" class="w-5 h-5"></i> </a> <a href="#" class="footer-link text-gray-400 hover:text-white transition"> <i data-feather="instagram" class="w-5 h-5"></i> </a> <a href="#" class="footer-link text-gray-400 hover:text-white transition"> <i data-feather="facebook" class="w-5 h-5"></i> </a> <a href="#" class="footer-link text-gray-400 hover:text-white transition"> <i data-feather="github" class="w-5 h-5"></i> </a> </div> </div> </div> <div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-400"> <p>© 2023 SketchMaster Pro. All rights reserved.</p> </div> </div> </footer> `; }}customElements.define('custom-footer', CustomFooter);123456789101112131415161718192021222324252627282930313233343536373839class CustomNavbar extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` <style> .navbar { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); } .nav-link:hover { background-color: rgba(255, 255, 255, 0.1); } </style> <nav class="navbar text-white shadow-lg"> <div class="container mx-auto px-4"> <div class="flex justify-between items-center h-16"> <div class="flex items-center"> <a href="/" class="flex items-center space-x-2"> <i data-feather="pen-tool" class="w-6 h-6"></i> <span class="text-xl font-bold">SketchMaster Pro</span> </a> </div> <div class="hidden md:flex items-center space-x-4"> <a href="/" class="nav-link px-3 py-2 rounded-md text-sm font-medium hover:text-white transition">Home</a> <a href="gallery.html" class="nav-link px-3 py-2 rounded-md text-sm font-medium hover:text-white transition">Gallery</a> <a href="tutorials.html" class="nav-link px-3 py-2 rounded-md text-sm font-medium hover:text-white transition">Tutorials</a> <a href="community.html" class="nav-link px-3 py-2 rounded-md text-sm font-medium hover:text-white transition">Community</a> </div> <div class="flex items-center"> <button class="p-2 rounded-full hover:bg-white hover:bg-opacity-10 transition"> <i data-feather="user" class="w-5 h-5"></i> </button> </div> </div> </div> </nav> `; }}customElements.define('custom-navbar', CustomNavbar);12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758class CustomToolbar extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` <style> .tool-button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: all 0.2s; } .tool-button:hover { background-color: #e0e7ff; transform: scale(1.05); } .tool-button.active { background-color: #6366f1; color: white; } </style> <div class="bg-white rounded-xl shadow-lg p-4 w-full lg:w-16 flex lg:flex-row flex-wrap justify-center gap-2 lg:flex-col"> <h3 class="text-lg font-semibold mb-3 text-gray-700 lg:hidden">Drawing Tools</h3> <button class="tool-button active" title="Pen"> <i data-feather="edit-2" class="w-5 h-5"></i> </button> <button class="tool-button" title="Brush"> <i data-feather="brush" class="w-5 h-5"></i> </button> <button class="tool-button" title="Line"> <i data-feather="minus" class="w-5 h-5"></i> </button> <button class="tool-button" title="Shape"> <i data-feather="square" class="w-5 h-5"></i> </button> <button class="tool-button" title="Text"> <i data-feather="type" class="w-5 h-5"></i> </button> <button class="tool-button" title="Eraser"> <i data-feather="x" class="w-5 h-5"></i> </button> <div class="border-t border-gray-200 my-2 lg:my-0 lg:mx-0"></div> <button class="tool-button" title="Undo" onclick="alert('Undo functionality')"> <i data-feather="rotate-ccw" class="w-5 h-5"></i> </button> <button class="tool-button" title="Redo" onclick="alert('Redo functionality')"> <i data-feather="rotate-cw" class="w-5 h-5"></i> </button> <button class="tool-button" title="Clear" onclick="clearCanvas()"> <i data-feather="trash-2" class="w-5 h-5"></i> </button> </div> `; }}customElements.define('custom-toolbar', CustomToolbar);12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>SketchMaster Pro | Digital Drawing Platform</title><link rel="stylesheet" href="style.css"><script src="https://cdn.tailwindcss.com"></script><script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script><script src="https://unpkg.com/feather-icons"></script><script src="components/navbar.js"></script><script src="components/toolbar.js"></script><script src="components/footer.js"></script><script>tailwind.config = {theme: {extend: {colors: {primary: '#6366f1',secondary: '#f59e0b'}}}}</script></head><body class="bg-gray-100"><custom-navbar></custom-navbar><main class="container mx-auto px-4 py-8"><div class="flex flex-col lg:flex-row gap-8"><!-- Tools Panel --><custom-toolbar></custom-toolbar><!-- Canvas Area --><div class="flex-1"><div class="bg-white rounded-xl shadow-lg overflow-hidden"><div class="p-4 border-b border-gray-200 flex justify-between items-center"><h2 class="text-xl font-bold text-gray-800">Drawing Canvas</h2><div class="flex gap-2"><button class="px-3 py-1 bg-primary-500 text-white rounded-md hover:bg-primary-600 transition"><i data-feather="save" class="w-4 h-4"></i> Save</button><button class="px-3 py-1 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300 transition"><i data-feather="share-2" class="w-4 h-4"></i> Export</button></div></div><div class="p-4"><div id="drawingCanvas" class="w-full h-96 bg-white border-2 border-dashed border-gray-300 rounded-md flex items-center justify-center cursor-crosshair"><p class="text-gray-400">Start drawing here...</p></div></div></div><!-- Color Palette --><div class="mt-6 bg-white rounded-xl shadow-lg p-4"><h3 class="text-lg font-semibold mb-3 text-gray-700">Color Palette</h3><div class="flex flex-wrap gap-2"><div class="w-8 h-8 rounded-full bg-red-500 cursor-pointer border-2 border-white shadow"></div><div class="w-8 h-8 rounded-full bg-blue-500 cursor-pointer border-2 border-white shadow"></div><div class="w-8 h-8 rounded-full bg-green-500 cursor-pointer border-2 border-white shadow"></div><div class="w-8 h-8 rounded-full bg-yellow-500 cursor-pointer border-2 border-white shadow"></div><div class="w-8 h-8 rounded-full bg-purple-500 cursor-pointer border-2 border-white shadow"></div><div class="w-8 h-8 rounded-full bg-pink-500 cursor-pointer border-2 border-white shadow"></div><div class="w-8 h-8 rounded-full bg-black cursor-pointer border-2 border-white shadow"></div><div class="w-8 h-8 rounded-full bg-white cursor-pointer border-2 border-gray-300 shadow"></div></div></div></div></div></main><custom-footer></custom-footer><script src="script.js"></script><script>feather.replace();// Initialize canvas drawing functionalitydocument.addEventListener('DOMContentLoaded', function() {const canvas = document.getElementById('drawingCanvas');const ctx = canvas.getContext('2d');let isDrawing = false;canvas.width = canvas.offsetWidth;canvas.height = canvas.offsetHeight;canvas.addEventListener('mousedown', startDrawing);canvas.addEventListener('mousemove', draw);canvas.addEventListener('mouseup', stopDrawing);canvas.addEventListener('mouseout', stopDrawing);function startDrawing(e) {isDrawing = true;draw(e);}function draw(e) {if (!isDrawing) return;ctx.lineWidth = 5;ctx.lineCap = 'round';ctx.strokeStyle = '#000000';ctx.lineTo(e.clientX - canvas.offsetLeft,e.clientY - canvas.offsetTop);ctx.stroke();ctx.beginPath();ctx.moveTo(e.clientX - canvas.offsetLeft,e.clientY - canvas.offsetTop);}function stopDrawing() {isDrawing = false;ctx.beginPath();}});</script><script src="https://huggingface.co/deepsite/deepsite-badge.js"></script></body></html>
1234567891011121314151617181920212223242526272829303132333435// Shared JavaScript functionalitydocument.addEventListener('DOMContentLoaded', () => { // Initialize any shared functionality here console.log('SketchMaster Pro loaded!'); // Color palette selection document.querySelectorAll('.rounded-full').forEach(color => { color.addEventListener('click', function() { document.querySelectorAll('.rounded-full').forEach(c => { c.classList.remove('ring-2', 'ring-offset-2', 'ring-primary-500'); }); this.classList.add('ring-2', 'ring-offset-2', 'ring-primary-500'); // Update current drawing color const ctx = document.getElementById('drawingCanvas').getContext('2d'); ctx.strokeStyle = window.getComputedStyle(this).backgroundColor; }); });});
// Clear canvas functionfunction clearCanvas() { const canvas = document.getElementById('drawingCanvas'); const ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height);}
// Save canvas functionfunction saveCanvas() { const canvas = document.getElementById('drawingCanvas'); const dataURL = canvas.toDataURL('image/png'); const link = document.createElement('a'); link.download = 'sketchmaster-drawing.png'; link.href = dataURL; link.click();}12345678910111213141516171819202122232425262728body {padding: 2rem;font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;}h1 {font-size: 16px;margin-top: 0;}p {color: rgb(107, 114, 128);font-size: 15px;margin-bottom: 10px;margin-top: 5px;}.card {max-width: 620px;margin: 0 auto;padding: 16px;border: 1px solid lightgray;border-radius: 16px;}.card p:last-child {margin-bottom: 0;}123456789101112131415161718192021222324252627282930313233343536373839/* Custom styles for drawing app */#drawingCanvas {touch-action: none; /* Prevent scrolling on touch devices */}/* Tooltip styles */.tooltip {position: relative;display: inline-block;}.tooltip .tooltiptext {visibility: hidden;width: 120px;background-color: #333;color: #fff;text-align: center;border-radius: 6px;padding: 5px;position: absolute;z-index: 1;bottom: 125%;left: 50%;margin-left: -60px;opacity: 0;transition: opacity 0.3s;}.tooltip:hover .tooltiptext {visibility: visible;opacity: 1;}/* Responsive canvas */@media (max-width: 768px) {#drawingCanvas {height: 60vh;}}
README.md+8-5
components/footer.jsAdded+64
components/navbar.jsAdded+39
components/toolbar.jsAdded+58
index.html+125-19
script.jsAdded+35
style.css+31-20