Spaces:
Running
Running
not working
Browse files- components/footer.js +5 -13
- components/header.js +7 -6
- index.html +4 -9
- script.js +13 -4
components/footer.js
CHANGED
|
@@ -38,19 +38,11 @@ class CustomFooter extends HTMLElement {
|
|
| 38 |
<div>
|
| 39 |
<h4 class="font-semibold mb-4">Connect</h4>
|
| 40 |
<div class="flex space-x-4">
|
| 41 |
-
<a href="#" class="social-icon text-gray-400 transition-all duration-200">
|
| 42 |
-
|
| 43 |
-
</a>
|
| 44 |
-
<a href="#" class="social-icon text-gray-400 transition-all duration-200">
|
| 45 |
-
|
| 46 |
-
</a>
|
| 47 |
-
<a href="#" class="social-icon text-gray-400 transition-all duration-200">
|
| 48 |
-
<i data-feather="instagram"></i>
|
| 49 |
-
</a>
|
| 50 |
-
<a href="#" class="social-icon text-gray-400 transition-all duration-200">
|
| 51 |
-
<i data-feather="youtube"></i>
|
| 52 |
-
</a>
|
| 53 |
-
</div>
|
| 54 |
</div>
|
| 55 |
</div>
|
| 56 |
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-500 text-sm">
|
|
|
|
| 38 |
<div>
|
| 39 |
<h4 class="font-semibold mb-4">Connect</h4>
|
| 40 |
<div class="flex space-x-4">
|
| 41 |
+
<a href="#" class="social-icon text-gray-400 transition-all duration-200" data-feather="twitter"></a>
|
| 42 |
+
<a href="#" class="social-icon text-gray-400 transition-all duration-200" data-feather="github"></a>
|
| 43 |
+
<a href="#" class="social-icon text-gray-400 transition-all duration-200" data-feather="instagram"></a>
|
| 44 |
+
<a href="#" class="social-icon text-gray-400 transition-all duration-200" data-feather="youtube"></a>
|
| 45 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
</div>
|
| 47 |
</div>
|
| 48 |
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-500 text-sm">
|
components/header.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
-
|
| 2 |
-
|
|
|
|
| 3 |
this.attachShadow({ mode: 'open' });
|
| 4 |
this.shadowRoot.innerHTML = `
|
| 5 |
<style>
|
|
@@ -24,13 +25,13 @@ class CustomHeader extends HTMLElement {
|
|
| 24 |
<a href="#" class="nav-link text-white hover:text-purple-300 transition-colors">Features</a>
|
| 25 |
<a href="#" class="nav-link text-white hover:text-purple-300 transition-colors">Pricing</a>
|
| 26 |
<a href="#" class="nav-link text-white hover:text-purple-300 transition-colors">About</a>
|
| 27 |
-
<button class="bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded-md flex items-center">
|
| 28 |
-
<
|
| 29 |
</button>
|
| 30 |
-
|
| 31 |
</div>
|
| 32 |
</nav>
|
| 33 |
`;
|
| 34 |
}
|
| 35 |
}
|
| 36 |
-
customElements.define('custom-
|
|
|
|
| 1 |
+
|
| 2 |
+
class CustomNavbar extends HTMLElement {
|
| 3 |
+
connectedCallback() {
|
| 4 |
this.attachShadow({ mode: 'open' });
|
| 5 |
this.shadowRoot.innerHTML = `
|
| 6 |
<style>
|
|
|
|
| 25 |
<a href="#" class="nav-link text-white hover:text-purple-300 transition-colors">Features</a>
|
| 26 |
<a href="#" class="nav-link text-white hover:text-purple-300 transition-colors">Pricing</a>
|
| 27 |
<a href="#" class="nav-link text-white hover:text-purple-300 transition-colors">About</a>
|
| 28 |
+
<button class="bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded-md flex items-center" data-feather="log-in">
|
| 29 |
+
<span class="ml-6">Login</span>
|
| 30 |
</button>
|
| 31 |
+
</div>
|
| 32 |
</div>
|
| 33 |
</nav>
|
| 34 |
`;
|
| 35 |
}
|
| 36 |
}
|
| 37 |
+
customElements.define('custom-navbar', CustomNavbar);
|
index.html
CHANGED
|
@@ -10,9 +10,8 @@
|
|
| 10 |
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
</head>
|
| 12 |
<body class="bg-gradient-to-br from-indigo-900 to-purple-900 min-h-screen text-white">
|
| 13 |
-
<custom-
|
| 14 |
-
|
| 15 |
-
<main class="container mx-auto px-4 py-8">
|
| 16 |
<section class="max-w-4xl mx-auto bg-gray-800 bg-opacity-50 rounded-xl p-6 backdrop-blur-sm">
|
| 17 |
<h1 class="text-4xl font-bold mb-6 text-center">Transform Audio to Piano Roll</h1>
|
| 18 |
<p class="text-xl mb-8 text-center text-gray-300">Upload your MP3 and watch it transform into beautiful piano roll visualization</p>
|
|
@@ -122,13 +121,9 @@
|
|
| 122 |
</main>
|
| 123 |
|
| 124 |
<custom-footer></custom-footer>
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
<script src="components/footer.js"></script>
|
| 128 |
<script src="script.js"></script>
|
| 129 |
-
<script>
|
| 130 |
-
feather.replace();
|
| 131 |
-
</script>
|
| 132 |
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 133 |
</body>
|
| 134 |
</html>
|
|
|
|
| 10 |
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
</head>
|
| 12 |
<body class="bg-gradient-to-br from-indigo-900 to-purple-900 min-h-screen text-white">
|
| 13 |
+
<custom-navbar></custom-navbar>
|
| 14 |
+
<main class="container mx-auto px-4 py-8">
|
|
|
|
| 15 |
<section class="max-w-4xl mx-auto bg-gray-800 bg-opacity-50 rounded-xl p-6 backdrop-blur-sm">
|
| 16 |
<h1 class="text-4xl font-bold mb-6 text-center">Transform Audio to Piano Roll</h1>
|
| 17 |
<p class="text-xl mb-8 text-center text-gray-300">Upload your MP3 and watch it transform into beautiful piano roll visualization</p>
|
|
|
|
| 121 |
</main>
|
| 122 |
|
| 123 |
<custom-footer></custom-footer>
|
| 124 |
+
<script src="components/navbar.js"></script>
|
| 125 |
+
<script src="components/footer.js"></script>
|
|
|
|
| 126 |
<script src="script.js"></script>
|
|
|
|
|
|
|
|
|
|
| 127 |
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 128 |
</body>
|
| 129 |
</html>
|
script.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
|
|
| 1 |
document.addEventListener('DOMContentLoaded', function() {
|
| 2 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
const audioUpload = document.getElementById('audio-upload');
|
| 4 |
const audioInfo = document.getElementById('audio-info');
|
| 5 |
const filename = document.getElementById('filename');
|
|
@@ -19,10 +24,14 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
| 19 |
duration.textContent = `${mins}:${secs < 10 ? '0' : ''}${secs}`;
|
| 20 |
audioInfo.classList.remove('hidden');
|
| 21 |
};
|
| 22 |
-
|
| 23 |
-
});
|
| 24 |
|
| 25 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
const dropArea = document.querySelector('.border-dashed');
|
| 27 |
|
| 28 |
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
|
|
|
| 1 |
+
|
| 2 |
document.addEventListener('DOMContentLoaded', function() {
|
| 3 |
+
// Initialize Feather Icons
|
| 4 |
+
if (window.feather) {
|
| 5 |
+
feather.replace();
|
| 6 |
+
}
|
| 7 |
+
// Audio upload handling
|
| 8 |
const audioUpload = document.getElementById('audio-upload');
|
| 9 |
const audioInfo = document.getElementById('audio-info');
|
| 10 |
const filename = document.getElementById('filename');
|
|
|
|
| 24 |
duration.textContent = `${mins}:${secs < 10 ? '0' : ''}${secs}`;
|
| 25 |
audioInfo.classList.remove('hidden');
|
| 26 |
};
|
| 27 |
+
}
|
|
|
|
| 28 |
|
| 29 |
+
// Refresh Feather Icons after dynamic content loads
|
| 30 |
+
if (window.feather) {
|
| 31 |
+
feather.replace();
|
| 32 |
+
}
|
| 33 |
+
});
|
| 34 |
+
// Drag and drop functionality
|
| 35 |
const dropArea = document.querySelector('.border-dashed');
|
| 36 |
|
| 37 |
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|