Spaces:
Running
Running
ich kann kein bild in die webanwendung laden !?
Browse files- README.md +8 -4
- index.html +151 -19
README.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
---
|
| 2 |
-
title: Sketchy
|
| 3 |
-
emoji: 🐢
|
| 4 |
colorFrom: gray
|
| 5 |
-
colorTo:
|
|
|
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Sketchy McSketchFace ✏️
|
|
|
|
| 3 |
colorFrom: gray
|
| 4 |
+
colorTo: gray
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://deepsite.hf.co).
|
| 14 |
+
|
index.html
CHANGED
|
@@ -1,19 +1,151 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Sketchy McSketchFace - Image to Sketch Converter</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<style>
|
| 11 |
+
.dropzone {
|
| 12 |
+
border: 2px dashed #94a3b8;
|
| 13 |
+
transition: all 0.3s ease;
|
| 14 |
+
}
|
| 15 |
+
.dropzone.active {
|
| 16 |
+
border-color: #6366f1;
|
| 17 |
+
background-color: #e0e7ff;
|
| 18 |
+
}
|
| 19 |
+
canvas {
|
| 20 |
+
max-width: 100%;
|
| 21 |
+
height: auto;
|
| 22 |
+
border-radius: 0.5rem;
|
| 23 |
+
}
|
| 24 |
+
</style>
|
| 25 |
+
</head>
|
| 26 |
+
<body class="bg-gray-50 min-h-screen">
|
| 27 |
+
<div class="container mx-auto px-4 py-8">
|
| 28 |
+
<header class="mb-12 text-center">
|
| 29 |
+
<h1 class="text-4xl font-bold text-gray-800 mb-2">Sketchy McSketchFace</h1>
|
| 30 |
+
<p class="text-lg text-gray-600">Transform your photos into artistic sketches</p>
|
| 31 |
+
</header>
|
| 32 |
+
|
| 33 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
| 34 |
+
<!-- Upload Section -->
|
| 35 |
+
<div class="bg-white rounded-xl shadow-md p-6">
|
| 36 |
+
<h2 class="text-xl font-semibold mb-4 text-gray-800">Upload Image</h2>
|
| 37 |
+
<div id="dropzone" class="dropzone rounded-lg p-8 mb-6 cursor-pointer flex flex-col items-center justify-center text-center">
|
| 38 |
+
<i data-feather="upload" class="w-12 h-12 text-gray-400 mb-3"></i>
|
| 39 |
+
<p class="text-gray-600 mb-2">Drag & drop your image here</p>
|
| 40 |
+
<p class="text-sm text-gray-500">or click to browse</p>
|
| 41 |
+
<input type="file" id="fileInput" class="hidden" accept="image/*" onchange="handleFileSelect(event)">
|
| 42 |
+
</div>
|
| 43 |
+
<!-- Settings -->
|
| 44 |
+
<div class="space-y-4">
|
| 45 |
+
<div>
|
| 46 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Output Style</label>
|
| 47 |
+
<div class="flex space-x-4">
|
| 48 |
+
<button id="posterBtn" class="px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
| 49 |
+
Poster
|
| 50 |
+
</button>
|
| 51 |
+
<button id="stencilBtn" class="px-4 py-2 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-500">
|
| 52 |
+
Stencil
|
| 53 |
+
</button>
|
| 54 |
+
</div>
|
| 55 |
+
</div>
|
| 56 |
+
|
| 57 |
+
<div>
|
| 58 |
+
<label for="colorRange" class="block text-sm font-medium text-gray-700 mb-1">Color Levels: <span id="colorValue">3</span></label>
|
| 59 |
+
<input type="range" id="colorRange" min="2" max="6" value="3" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
<div>
|
| 63 |
+
<label for="thicknessRange" class="block text-sm font-medium text-gray-700 mb-1">Line Thickness: <span id="thicknessValue">2</span></label>
|
| 64 |
+
<input type="range" id="thicknessRange" min="0" max="5" value="2" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
|
| 65 |
+
</div>
|
| 66 |
+
|
| 67 |
+
<button id="processBtn" disabled class="w-full py-3 px-4 bg-indigo-600 text-white font-medium rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed">
|
| 68 |
+
<i data-feather="image" class="inline mr-2"></i> Process Image
|
| 69 |
+
</button>
|
| 70 |
+
</div>
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<!-- Preview Section -->
|
| 74 |
+
<div class="bg-white rounded-xl shadow-md p-6">
|
| 75 |
+
<div class="flex justify-between items-center mb-4">
|
| 76 |
+
<h2 class="text-xl font-semibold text-gray-800">Preview</h2>
|
| 77 |
+
<div id="downloadControls" class="hidden">
|
| 78 |
+
<button id="downloadBtn" class="px-3 py-1.5 bg-green-600 text-white text-sm rounded-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500">
|
| 79 |
+
<i data-feather="download" class="inline mr-1.5 w-4 h-4"></i> Download
|
| 80 |
+
</button>
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
<script>
|
| 84 |
+
function handleFileSelect(event) {
|
| 85 |
+
const file = event.target.files[0];
|
| 86 |
+
if (!file) return;
|
| 87 |
+
|
| 88 |
+
const reader = new FileReader();
|
| 89 |
+
reader.onload = function(e) {
|
| 90 |
+
const preview = document.createElement('img');
|
| 91 |
+
preview.src = e.target.result;
|
| 92 |
+
preview.className = 'max-w-full mb-4';
|
| 93 |
+
|
| 94 |
+
const previewSection = document.querySelector('.bg-white.rounded-xl.shadow-md.p-6:nth-child(2)');
|
| 95 |
+
const existingPreview = previewSection.querySelector('img');
|
| 96 |
+
if (existingPreview) {
|
| 97 |
+
previewSection.replaceChild(preview, existingPreview);
|
| 98 |
+
} else {
|
| 99 |
+
previewSection.insertBefore(preview, previewSection.querySelector('#downloadControls'));
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
document.getElementById('processBtn').disabled = false;
|
| 103 |
+
document.getElementById('downloadControls').classList.remove('hidden');
|
| 104 |
+
};
|
| 105 |
+
reader.readAsDataURL(file);
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
// Add drag and drop functionality
|
| 109 |
+
const dropzone = document.getElementById('dropzone');
|
| 110 |
+
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
| 111 |
+
dropzone.addEventListener(eventName, preventDefaults, false);
|
| 112 |
+
});
|
| 113 |
+
|
| 114 |
+
function preventDefaults(e) {
|
| 115 |
+
e.preventDefault();
|
| 116 |
+
e.stopPropagation();
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
['dragenter', 'dragover'].forEach(eventName => {
|
| 120 |
+
dropzone.addEventListener(eventName, highlight, false);
|
| 121 |
+
});
|
| 122 |
+
|
| 123 |
+
['dragleave', 'drop'].forEach(eventName => {
|
| 124 |
+
dropzone.addEventListener(eventName, unhighlight, false);
|
| 125 |
+
});
|
| 126 |
+
|
| 127 |
+
function highlight() {
|
| 128 |
+
dropzone.classList.add('active');
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
function unhighlight() {
|
| 132 |
+
dropzone.classList.remove('active');
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
dropzone.addEventListener('drop', handleDrop, false);
|
| 136 |
+
|
| 137 |
+
function handleDrop(e) {
|
| 138 |
+
const dt = e.dataTransfer;
|
| 139 |
+
const file = dt.files[0];
|
| 140 |
+
const input = document.getElementById('fileInput');
|
| 141 |
+
input.files = dt.files;
|
| 142 |
+
handleFileSelect({target: input});
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
// Click on dropzone triggers file input
|
| 146 |
+
dropzone.addEventListener('click', () => {
|
| 147 |
+
document.getElementById('fileInput').click();
|
| 148 |
+
});
|
| 149 |
+
</script>
|
| 150 |
+
</body>
|
| 151 |
+
</html>
|