Spaces:
Running
Running
File size: 5,386 Bytes
00095b7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upload Your Music | SonicPayJam</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/dropzone@5.9.3/dist/min/dropzone.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dropzone@5.9.3/dist/min/dropzone.min.css">
<style>
.dropzone {
border: 2px dashed #6b46c1;
border-radius: 0.5rem;
background: rgba(107, 70, 193, 0.05);
min-height: 200px;
}
.dropzone .dz-message {
margin: 3em 0;
color: #6b46c1;
font-weight: 500;
}
</style>
</head>
<body class="bg-gray-100">
<div class="container mx-auto px-4 py-12">
<div class="max-w-3xl mx-auto bg-white rounded-xl shadow-md overflow-hidden p-8">
<div class="text-center mb-8">
<h1 class="text-3xl font-bold text-purple-800 mb-2">Upload Your Masterpiece</h1>
<p class="text-gray-600">Share your music with fans and get paid for your art</p>
</div>
<form id="uploadForm" class="space-y-6">
<div>
<label class="block text-gray-700 mb-2" for="trackName">Track Name</label>
<input type="text" id="trackName" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
</div>
<div>
<label class="block text-gray-700 mb-2" for="genre">Genre</label>
<select id="genre" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
<option value="">Select a genre</option>
<option value="rock">Rock</option>
<option value="pop">Pop</option>
<option value="hiphop">Hip Hop</option>
<option value="electronic">Electronic</option>
<option value="jazz">Jazz</option>
<option value="classical">Classical</option>
<option value="other">Other</option>
</select>
</div>
<div>
<label class="block text-gray-700 mb-2">Audio File</label>
<div id="dropzone" class="dropzone">
<div class="dz-message" data-dz-message>
<i data-feather="upload-cloud" class="w-12 h-12 mx-auto text-purple-500 mb-2"></i>
<div>Drop audio files here or click to upload</div>
<div class="text-sm text-gray-500 mt-2">MP3, WAV, FLAC (max 50MB)</div>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-gray-700 mb-2" for="streamPrice">Stream Price ($)</label>
<input type="number" id="streamPrice" min="0.50" step="0.50" value="1.99" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
</div>
<div>
<label class="block text-gray-700 mb-2" for="downloadPrice">Download Price ($)</label>
<input type="number" id="downloadPrice" min="1.00" step="0.50" value="2.99" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
</div>
</div>
<div>
<label class="flex items-center space-x-2">
<input type="checkbox" id="exclusive" class="rounded text-purple-500 focus:ring-purple-500">
<span class="text-gray-700">Exclusive content (fans must pay to listen at all)</span>
</label>
</div>
<div class="flex justify-end">
<button type="submit" class="px-6 py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 transition">
Publish Track
</button>
</div>
</form>
</div>
</div>
<script>
// Initialize Dropzone
Dropzone.autoDiscover = false;
const myDropzone = new Dropzone("#dropzone", {
url: "/upload",
acceptedFiles: "audio/*",
maxFilesize: 50, // MB
dictDefaultMessage: "",
addRemoveLinks: true
});
// Initialize feather icons
feather.replace();
// Form submission
document.getElementById('uploadForm').addEventListener('submit', function(e) {
e.preventDefault();
// Handle form submission
alert('Track uploaded successfully! You will be redirected to your dashboard.');
// In a real implementation, this would submit to your backend
});
</script>
</body>
</html> |