JahDaGanj commited on
Commit
7e84af1
·
verified ·
1 Parent(s): bb07611

Einstellmöglichkeiten mit einem Prompt

Browse files
Files changed (2) hide show
  1. components/settings.js +128 -0
  2. index.html +3 -3
components/settings.js ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomSettings extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ :host {
7
+ display: block;
8
+ background: rgba(17, 24, 39, 0.8);
9
+ border: 1px solid rgba(255, 255, 255, 0.1);
10
+ border-radius: 0.75rem;
11
+ padding: 1.5rem;
12
+ backdrop-filter: blur(10px);
13
+ }
14
+ h2 {
15
+ color: white;
16
+ font-size: 1.25rem;
17
+ font-weight: 600;
18
+ margin-bottom: 1.5rem;
19
+ display: flex;
20
+ align-items: center;
21
+ gap: 0.5rem;
22
+ }
23
+ .setting-group {
24
+ margin-bottom: 1.5rem;
25
+ }
26
+ label {
27
+ display: block;
28
+ color: rgb(156, 163, 175);
29
+ margin-bottom: 0.5rem;
30
+ }
31
+ textarea, select, input[type="range"] {
32
+ width: 100%;
33
+ background: rgba(31, 41, 55, 0.6);
34
+ border: 1px solid rgba(255, 255, 255, 0.1);
35
+ border-radius: 0.5rem;
36
+ padding: 0.75rem;
37
+ color: white;
38
+ margin-bottom: 0.5rem;
39
+ }
40
+ textarea {
41
+ min-height: 100px;
42
+ resize: vertical;
43
+ }
44
+ .range-value {
45
+ color: rgb(156, 163, 175);
46
+ font-size: 0.875rem;
47
+ }
48
+ button {
49
+ background: linear-gradient(to right, rgb(168, 85, 247), rgb(98, 143, 229));
50
+ color: white;
51
+ border: none;
52
+ border-radius: 0.5rem;
53
+ padding: 0.75rem 1.5rem;
54
+ font-weight: 500;
55
+ cursor: pointer;
56
+ width: 100%;
57
+ transition: opacity 0.2s;
58
+ }
59
+ button:hover {
60
+ opacity: 0.9;
61
+ }
62
+ </style>
63
+ <div>
64
+ <h2>
65
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
66
+ <path d="M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"></path>
67
+ <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
68
+ </svg>
69
+ Generate with Prompt
70
+ </h2>
71
+
72
+ <div class="setting-group">
73
+ <label for="style">Style</label>
74
+ <select id="style">
75
+ <option value="dark-minimal">Dark Minimal</option>
76
+ <option value="dark-ambient">Dark Ambient</option>
77
+ <option value="industrial">Industrial</option>
78
+ <option value="dark-cinematic">Dark Cinematic</option>
79
+ </select>
80
+ </div>
81
+
82
+ <div class="setting-group">
83
+ <label for="intensity">Darkness Intensity</label>
84
+ <input type="range" id="intensity" min="1" max="5" value="3">
85
+ <div class="range-value" id="intensityValue">Medium</div>
86
+ </div>
87
+
88
+ <div class="setting-group">
89
+ <label for="custom-prompt">Custom Prompt</label>
90
+ <textarea id="custom-prompt" placeholder="Describe the dark minimal sound you want to create..."></textarea>
91
+ </div>
92
+
93
+ <button id="apply-settings">Apply Settings</button>
94
+ </div>
95
+ `;
96
+
97
+ const intensity = this.shadowRoot.getElementById('intensity');
98
+ const intensityValue = this.shadowRoot.getElementById('intensityValue');
99
+
100
+ intensity.addEventListener('input', () => {
101
+ const values = ['Very Light', 'Light', 'Medium', 'Dark', 'Very Dark'];
102
+ intensityValue.textContent = values[intensity.value - 1];
103
+ });
104
+
105
+ this.shadowRoot.getElementById('apply-settings').addEventListener('click', () => {
106
+ const styles = {
107
+ 'dark-minimal': 'A dark minimal techno track',
108
+ 'dark-ambient': 'A dark ambient soundscape',
109
+ 'industrial': 'An industrial dark techno sound',
110
+ 'dark-cinematic': 'A cinematic dark soundtrack'
111
+ };
112
+
113
+ const style = this.shadowRoot.getElementById('style').value;
114
+ const intensity = this.shadowRoot.getElementById('intensity').value;
115
+ const customPrompt = this.shadowRoot.getElementById('custom-prompt').value;
116
+
117
+ const fullPrompt = `${styles[style]} with ${intensity} intensity. ${customPrompt}`;
118
+
119
+ this.dispatchEvent(new CustomEvent('settings-applied', {
120
+ detail: { prompt: fullPrompt },
121
+ bubbles: true,
122
+ composed: true
123
+ }));
124
+ });
125
+ }
126
+ }
127
+
128
+ customElements.define('custom-settings', CustomSettings);
index.html CHANGED
@@ -19,10 +19,10 @@
19
  <section class="max-w-4xl mx-auto text-center mb-16">
20
  <h1 class="text-5xl font-bold mb-4 bg-gradient-to-r from-purple-600 to-blue-500 bg-clip-text text-transparent">Sonic Darkness Generator</h1>
21
  <p class="text-xl text-gray-400 mb-8">Upload a track and our AI will transform it into haunting Dark Minimal perfection</p>
22
-
23
- <div class="bg-gray-900 rounded-xl p-8 shadow-lg border border-gray-800">
24
  <div class="flex flex-col items-center justify-center border-2 border-dashed border-gray-700 rounded-lg p-12 mb-8 hover:border-purple-500 transition-all" id="dropzone">
25
- <i data-feather="upload-cloud" class="w-16 h-16 text-purple-500 mb-4"></i>
26
  <h3 class="text-2xl font-semibold mb-2">Upload Your Track</h3>
27
  <p class="text-gray-400 mb-4">Drag & drop or click to browse</p>
28
  <input type="file" id="fileInput" class="hidden" accept="audio/*">
 
19
  <section class="max-w-4xl mx-auto text-center mb-16">
20
  <h1 class="text-5xl font-bold mb-4 bg-gradient-to-r from-purple-600 to-blue-500 bg-clip-text text-transparent">Sonic Darkness Generator</h1>
21
  <p class="text-xl text-gray-400 mb-8">Upload a track and our AI will transform it into haunting Dark Minimal perfection</p>
22
+ <div class="bg-gray-900 rounded-xl p-8 shadow-lg border border-gray-800 relative">
23
+ <custom-settings id="settingsPanel" class="hidden absolute left-0 right-0 top-0 bottom-0 z-10 flex items-center justify-center"></custom-settings>
24
  <div class="flex flex-col items-center justify-center border-2 border-dashed border-gray-700 rounded-lg p-12 mb-8 hover:border-purple-500 transition-all" id="dropzone">
25
+ <i data-feather="upload-cloud" class="w-16 h-16 text-purple-500 mb-4"></i>
26
  <h3 class="text-2xl font-semibold mb-2">Upload Your Track</h3>
27
  <p class="text-gray-400 mb-4">Drag & drop or click to browse</p>
28
  <input type="file" id="fileInput" class="hidden" accept="audio/*">