<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>AI Motion Grammar System - Professional Prompting Tool</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; background: #0a0a0a; color: #e0e0e0; line-height: 1.6; overflow-x: hidden; } .container { max-width: 1400px; margin: 0 auto; padding: 20px; } header { text-align: center; padding: 40px 0; background: linear-gradient(135deg, #1a1a2e, #0f0f1e); border-radius: 20px; margin-bottom: 40px; position: relative; overflow: hidden; } header::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(138, 43, 226, 0.1) 0%, transparent 70%); animation: pulse 4s ease-in-out infinite; } @keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.1); opacity: 0.8; } } h1 { font-size: 3em; margin-bottom: 10px; background: linear-gradient(45deg, #8a2be2, #ff6b6b, #4ecdc4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; position: relative; z-index: 1; } .subtitle { font-size: 1.2em; color: #888; position: relative; z-index: 1; } .grammar-builder { background: #1a1a1a; border-radius: 15px; padding: 30px; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid #333; } .builder-section { margin-bottom: 25px; } .builder-section h3 { color: #8a2be2; margin-bottom: 15px; font-size: 1.3em; } .parameter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; } .parameter-card { background: #252525; border: 1px solid #444; border-radius: 10px; padding: 15px; cursor: pointer; transition: all 0.3s ease; position: relative; overflow: hidden; } .parameter-card:hover { transform: translateY(-2px); border-color: #8a2be2; box-shadow: 0 5px 15px rgba(138, 43, 226, 0.3); } .parameter-card.selected { background: #2a1a3a; border-color: #8a2be2; box-shadow: 0 0 20px rgba(138, 43, 226, 0.5); } .parameter-card.selected::before { content: '✓'; position: absolute; top: 10px; right: 10px; color: #4ecdc4; font-size: 1.2em; font-weight: bold; } .param-label { font-weight: bold; color: #4ecdc4; display: block; margin-bottom: 5px; } .param-value { font-size: 1.1em; margin-bottom: 5px; } .param-score { font-size: 0.9em; color: #888; } .motion-score-meter { background: #1a1a1a; border-radius: 10px; padding: 20px; margin: 20px 0; text-align: center; } .score-display { font-size: 3em; font-weight: bold; margin: 10px 0; background: linear-gradient(45deg, #4ecdc4, #8a2be2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } .score-bar { width: 100%; height: 30px; background: #252525; border-radius: 15px; overflow: hidden; position: relative; margin: 20px 0; } .score-fill { height: 100%; background: linear-gradient(90deg, #4ecdc4, #8a2be2, #ff6b6b); border-radius: 15px; transition: width 0.5s ease; position: relative; overflow: hidden; } .score-fill::after { content: ''; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); animation: shimmer 2s infinite; } @keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } } .generated-prompt { background: #0a0a0a; border: 2px solid #8a2be2; border-radius: 10px; padding: 20px; margin: 20px 0; font-family: 'Courier New', monospace; font-size: 1.1em; position: relative; overflow: hidden; } .generated-prompt::before { content: 'GENERATED PROMPT'; position: absolute; top: 5px; left: 10px; font-size: 0.7em; color: #8a2be2; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } .prompt-text { margin-top: 10px; word-wrap: break-word; color: #4ecdc4; } .copy-button { position: absolute; top: 5px; right: 10px; background: #8a2be2; color: white; border: none; border-radius: 5px; padding: 5px 15px; cursor: pointer; font-size: 0.9em; transition: all 0.3s ease; } .copy-button:hover { background: #9a3bf2; transform: translateY(-1px); } .copy-button:active { transform: translateY(0); } .test-matrix { background: #1a1a1a; border-radius: 15px; padding: 30px; margin-top: 40px; } .test-item { background: #252525; border-radius: 10px; padding: 15px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; transition: all 0.3s ease; } .test-item:hover { background: #2a2a2a; transform: translateX(5px); } .test-prompt { flex: 1; margin-right: 20px; font-family: 'Courier New', monospace; color: #4ecdc4; } .test-score { background: linear-gradient(45deg, #8a2be2, #ff6b6b); color: white; padding: 5px 15px; border-radius: 20px; font-weight: bold; min-width: 60px; text-align: center; } .controls { display: flex; gap: 15px; margin: 20px 0; flex-wrap: wrap; } .control-button { background: #8a2be2; color: white; border: none; border-radius: 10px; padding: 12px 25px; cursor: pointer; font-size: 1em; transition: all 0.3s ease; position: relative; overflow: hidden; } .control-button::before { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; background: rgba(255,255,255,0.3); border-radius: 50%; transform: translate(-50%, -50%); transition: width 0.5s, height 0.5s; } .control-button:hover::before { width: 300px; height: 300px; } .control-button:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4); } .control-button.secondary { background: #444; } .formula-display { background: #0a0a0a; border: 1px solid #333; border-radius: 10px; padding: 20px; margin: 20px 0; font-family: 'Courier New', monospace; text-align: center; color: #888; } .tips-section { background: linear-gradient(135deg, #1a1a2e, #2a1a3a); border-radius: 15px; padding: 30px; margin-top: 40px; border: 1px solid #8a2be2; } .tips-section h3 { color: #4ecdc4; margin-bottom: 20px; } .tip-item { margin-bottom: 15px; padding-left: 20px; position: relative; } .tip-item::before { content: '→'; position: absolute; left: 0; color: #8a2be2; font-weight: bold; } @media (max-width: 768px) { h1 { font-size: 2em; } .parameter-grid { grid-template-columns: 1fr; } .controls { flex-direction: column; } .control-button { width: 100%; } } </style> </head> <body> <div class="container"> <header> <h1>AI Motion Grammar System</h1> <p class="subtitle">Professional Prompt Engineering for Midjourney V1 Video</p> </header> <div class="grammar-builder"> <h3>Motion Grammar Builder</h3> <div class="builder-section"> <h3>1. Gradient Intensity</h3> <div class="parameter-grid" id="gradientGrid"> <!-- Gradient options will be populated here --> </div> </div> <div class="builder-section"> <h3>2. Movement Type</h3> <div class="parameter-grid" id="movementGrid"> <!-- Movement options will be populated here --> </div> </div> <div class="builder-section"> <h3>3. Smoothness Descriptor</h3> <div class="parameter-grid" id="smoothnessGrid"> <!-- Smoothness options will be populated here --> </div> </div> <div class="builder-section"> <h3>4. Energy Level</h3> <div class="parameter-grid" id="energyGrid"> <!-- Energy options will be populated here --> </div> </div> <div class="builder-section"> <h3>5. Motion Setting</h3> <div class="parameter-grid" id="motionSettingGrid"> <!-- Motion setting options will be populated here --> </div> </div> <div class="motion-score-meter"> <h3>Calculated Motion Score</h3> <div class="score-display" id="scoreDisplay">0.00</div> <div class="score-bar"> <div class="score-fill" id="scoreFill" style="width: 0%"></div> </div> <p id="scoreDescription">Select parameters to calculate motion intensity</p> </div> <div class="generated-prompt"> <button class="copy-button" onclick="copyPrompt()">Copy</button> <div class="prompt-text" id="promptDisplay"> Select parameters above to generate your prompt </div> </div> <div class="formula-display"> Motion Score = Gradient Intensity × Energy Multiplier × Motion Setting </div> <div class="controls"> <button class="control-button" onclick="generateRandomPrompt()"> Generate Random Prompt </button> <button class="control-button secondary" onclick="resetBuilder()"> Reset All </button> <button class="control-button" onclick="generateTestMatrix()"> Generate Test Matrix </button> </div> </div> <div class="test-matrix" id="testMatrix" style="display: none;"> <h3>Systematic Test Matrix</h3> <div id="testItems"> <!-- Test items will be populated here --> </div> </div> <div class="tips-section"> <h3>Professional Usage Tips</h3> <div class="tip-item">Start with medium intensity (0.5-0.7) for predictable, usable results</div> <div class="tip-item">Always include smoothness descriptors to maintain visual coherence</div> <div class="tip-item">Stack multiple movement descriptors for stronger effects</div> <div class="tip-item">Use "impossible" or "extreme" sparingly - they can overwhelm the composition</div> <div class="tip-item">Match energy level with motion setting for optimal results</div> <div class="tip-item">Test systematically - small changes can have big impacts</div> </div> </div> <script> // Data structures based on the framework const grammarData = { gradient: { minimal: { words: ['subtle', 'gentle', 'slight'], score: 0.1 }, low: { words: ['soft', 'mild', 'easy'], score: 0.3 }, medium: { words: ['smooth', 'flowing', 'steady'], score: 0.5 }, high: { words: ['dramatic', 'sweeping', 'bold'], score: 0.7 }, extreme: { words: ['impossible', 'explosive', 'extreme'], score: 1.0 } }, movement: { linear: ['pan', 'tilt', 'dolly', 'track'], rotational: ['orbit', 'spiral', 'spin', 'rotate'], complex: ['weave', 'dance', 'swoop', 'surge'], zoom: ['zoom', 'push', 'pull', 'magnify'], compound: ['spiral-zoom', 'dolly-rotate', 'pan-tilt', 'orbit-push'] }, smoothness: ['seamless', 'fluid', 'silk-smooth', 'butter-smooth', 'smooth', 'rhythmic', 'pulsing'], energy: { low: { words: ['calm', 'serene', 'peaceful', 'tranquil'], multiplier: 0.5 }, medium: { words: ['balanced', 'rhythmic', 'flowing', 'steady'], multiplier: 1.0 }, high: { words: ['energetic', 'dynamic', 'vibrant', 'lively'], multiplier: 1.5 }, extreme: { words: ['frenetic', 'explosive', 'chaotic', 'turbulent'], multiplier: 2.0 } }, motionSetting: { low: 0.7, high: 1.3 } }; // State management let selectedParams = { gradient: null, movement: null, smoothness: null, energy: null, motionSetting: null }; // Initialize the builder function initializeBuilder() { populateGradientGrid(); populateMovementGrid(); populateSmoothnessGrid(); populateEnergyGrid(); populateMotionSettingGrid(); } function populateGradientGrid() { const grid = document.getElementById('gradientGrid'); Object.entries(grammarData.gradient).forEach(([level, data]) => { const card = createParameterCard( level, data.words[0], `Score: ${data.score}`, () => selectParameter('gradient', level, data) ); grid.appendChild(card); }); } function populateMovementGrid() { const grid = document.getElementById('movementGrid'); Object.entries(grammarData.movement).forEach(([type, movements]) => { const card = createParameterCard( type, movements[0], `${movements.length} variations`, () => selectParameter('movement', type, movements) ); grid.appendChild(card); }); } function populateSmoothnessGrid() { const grid = document.getElementById('smoothnessGrid'); grammarData.smoothness.forEach(smooth => { const card = createParameterCard( 'descriptor', smooth, 'Transition quality', () => selectParameter('smoothness', smooth, smooth) ); grid.appendChild(card); }); } function populateEnergyGrid() { const grid = document.getElementById('energyGrid'); Object.entries(grammarData.energy).forEach(([level, data]) => { const card = createParameterCard( level, data.words[0], `Multiplier: ${data.multiplier}x`, () => selectParameter('energy', level, data) ); grid.appendChild(card); }); } function populateMotionSettingGrid() { const grid = document.getElementById('motionSettingGrid'); Object.entries(grammarData.motionSetting).forEach(([setting, multiplier]) => { const card = createParameterCard( `--motion ${setting}`, setting.toUpperCase(), `Multiplier: ${multiplier}x`, () => selectParameter('motionSetting', setting, multiplier) ); grid.appendChild(card); }); } function createParameterCard(label, value, score, onClick) { const card = document.createElement('div'); card.className = 'parameter-card'; card.innerHTML = ` <span class="param-label">${label}</span> <span class="param-value">${value}</span> <span class="param-score">${score}</span> `; card.onclick = onClick; return card; } function selectParameter(type, key, value) { // Update state selectedParams[type] = { key, value }; // Update UI const grid = document.getElementById(`${type}Grid`); grid.querySelectorAll('.parameter-card').forEach(card => { card.classList.remove('selected'); }); event.currentTarget.classList.add('selected'); // Update prompt and score updatePromptAndScore(); } function updatePromptAndScore() { if (Object.values(selectedParams).every(param => param !== null)) { const prompt = generatePrompt(); const score = calculateScore(); document.getElementById('promptDisplay').textContent = prompt; document.getElementById('scoreDisplay').textContent = score.toFixed(2); document.getElementById('scoreFill').style.width = `${Math.min(score * 50, 100)}%`; // Update description based on score const descriptions = { 0.1: 'Minimal motion - barely perceptible', 0.3: 'Subtle motion - gentle movement', 0.5: 'Balanced motion - smooth and professional', 0.7: 'Dynamic motion - strong cinematic movement', 1.0: 'Extreme motion - maximum intensity', 1.5: 'Hyper motion - reality-bending effects', 2.0: 'Chaos motion - experimental territory' }; let description = 'Custom motion profile'; for (const [threshold, desc] of Object.entries(descriptions)) { if (score <= parseFloat(threshold)) { description = desc; break; } } document.getElementById('scoreDescription').textContent = description; } } function generatePrompt() { const gradient = selectedParams.gradient.value.words[0]; const movement = Array.isArray(selectedParams.movement.value) ? selectedParams.movement.value[0] : selectedParams.movement.value; const smoothness = selectedParams.smoothness.value; const energy = selectedParams.energy.value.words[0]; const motionSetting = selectedParams.motionSetting.key; return `${gradient} camera ${movement}, ${smoothness}, ${energy} --motion ${motionSetting}`; } function calculateScore() { const gradientScore = selectedParams.gradient.value.score; const energyMultiplier = selectedParams.energy.value.multiplier; const motionMultiplier = selectedParams.motionSetting.value; return gradientScore * energyMultiplier * motionMultiplier; } function copyPrompt() { const promptText = document.getElementById('promptDisplay').textContent; navigator.clipboard.writeText(promptText).then(() => { const button = document.querySelector('.copy-button'); const originalText = button.textContent; button.textContent = 'Copied!'; setTimeout(() => { button.textContent = originalText; }, 2000); }); } function generateRandomPrompt() { // Random selections const gradientKeys = Object.keys(grammarData.gradient); const movementKeys = Object.keys(grammarData.movement); const energyKeys = Object.keys(grammarData.energy); const motionKeys = Object.keys(grammarData.motionSetting); const randomGradient = gradientKeys[Math.floor(Math.random() * gradientKeys.length)]; const randomMovement = movementKeys[Math.floor(Math.random() * movementKeys.length)]; const randomSmoothness = grammarData.smoothness[Math.floor(Math.random() * grammarData.smoothness.length)]; const randomEnergy = energyKeys[Math.floor(Math.random() * energyKeys.length)]; const randomMotion = motionKeys[Math.floor(Math.random() * motionKeys.length)]; // Clear selections document.querySelectorAll('.parameter-card').forEach(card => { card.classList.remove('selected'); }); // Make selections selectedParams = { gradient: { key: randomGradient, value: grammarData.gradient[randomGradient] }, movement: { key: randomMovement, value: grammarData.movement[randomMovement] }, smoothness: { key: randomSmoothness, value: randomSmoothness }, energy: { key: randomEnergy, value: grammarData.energy[randomEnergy] }, motionSetting: { key: randomMotion, value: grammarData.motionSetting[randomMotion] } }; // Update UI updatePromptAndScore(); // Highlight selected cards setTimeout(() => { document.querySelectorAll('.parameter-card').forEach(card => { const text = card.textContent.toLowerCase(); if (text.includes(selectedParams.gradient.value.words[0]) || text.includes(selectedParams.movement.value[0]) || text.includes(selectedParams.smoothness.value) || text.includes(selectedParams.energy.value.words[0]) || text.includes(randomMotion)) { card.classList.add('selected'); } }); }, 100); } function resetBuilder() { selectedParams = { gradient: null, movement: null, smoothness: null, energy: null, motionSetting: null }; document.querySelectorAll('.parameter-card').forEach(card => { card.classList.remove('selected'); }); document.getElementById('promptDisplay').textContent = 'Select parameters above to generate your prompt'; document.getElementById('scoreDisplay').textContent = '0.00'; document.getElementById('scoreFill').style.width = '0%'; document.getElementById('scoreDescription').textContent = 'Select parameters to calculate motion intensity'; } function generateTestMatrix() { const testMatrix = document.getElementById('testMatrix'); const testItems = document.getElementById('testItems'); // Clear existing items testItems.innerHTML = ''; // Generate systematic test cases const testCases = [ { gradient: 'minimal', movement: 'linear', smoothness: 'seamless', energy: 'low', motion: 'low' }, { gradient: 'low', movement: 'linear', smoothness: 'fluid', energy: 'medium', motion: 'low' }, { gradient: 'medium', movement: 'rotational', smoothness: 'smooth', energy: 'medium', motion: 'low' }, { gradient: 'medium', movement: 'zoom', smoothness: 'seamless', energy: 'high', motion: 'high' }, { gradient: 'high', movement: 'complex', smoothness: 'fluid', energy: 'high', motion: 'high' }, { gradient: 'extreme', movement: 'compound', smoothness: 'seamless', energy: 'extreme', motion: 'high' } ]; testCases.forEach(test => { const gradient = grammarData.gradient[test.gradient].words[0]; const movement = grammarData.movement[test.movement][0]; const smoothness = test.smoothness; const energy = grammarData.energy[test.energy].words[0]; const prompt = `${gradient} camera ${movement}, ${smoothness}, ${energy} --motion ${test.motion}`; const score = grammarData.gradient[test.gradient].score * grammarData.energy[test.energy].multiplier * grammarData.motionSetting[test.motion]; const item = document.createElement('div'); item.className = 'test-item'; item.innerHTML = ` <div class="test-prompt">${prompt}</div> <div class="test-score">${score.toFixed(2)}</div> `; item.onclick = () => { navigator.clipboard.writeText(prompt); item.style.background = '#2a3a2a'; setTimeout(() => { item.style.background = ''; }, 500); }; testItems.appendChild(item); }); testMatrix.style.display = 'block'; testMatrix.scrollIntoView({ behavior: 'smooth' }); } // Initialize on load initializeBuilder(); </script> </body> </html> - Initial Deployment
Browse files- README.md +7 -5
- index.html +543 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: midjourney-video-prompt-test
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,543 @@
|
|
| 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>AI Motion Grammar System - Professional Prompting Tool</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@keyframes pulse {
|
| 11 |
+
0%, 100% { transform: scale(1); opacity: 0.5; }
|
| 12 |
+
50% { transform: scale(1.1); opacity: 0.8; }
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
@keyframes shimmer {
|
| 16 |
+
0% { transform: translateX(-100%); }
|
| 17 |
+
100% { transform: translateX(100%); }
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
.gradient-text {
|
| 21 |
+
background: linear-gradient(45deg, #8a2be2, #ff6b6b, #4ecdc4);
|
| 22 |
+
-webkit-background-clip: text;
|
| 23 |
+
-webkit-text-fill-color: transparent;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.score-fill::after {
|
| 27 |
+
content: '';
|
| 28 |
+
position: absolute;
|
| 29 |
+
top: 0;
|
| 30 |
+
left: 0;
|
| 31 |
+
bottom: 0;
|
| 32 |
+
right: 0;
|
| 33 |
+
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
|
| 34 |
+
animation: shimmer 2s infinite;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.parameter-card:hover {
|
| 38 |
+
transform: translateY(-2px);
|
| 39 |
+
box-shadow: 0 5px 15px rgba(138, 43, 226, 0.3);
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.parameter-card.selected {
|
| 43 |
+
box-shadow: 0 0 20px rgba(138, 43, 226, 0.5);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.control-button:hover::before {
|
| 47 |
+
width: 300px;
|
| 48 |
+
height: 300px;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
.header-glow::before {
|
| 52 |
+
content: '';
|
| 53 |
+
position: absolute;
|
| 54 |
+
top: -50%;
|
| 55 |
+
left: -50%;
|
| 56 |
+
width: 200%;
|
| 57 |
+
height: 200%;
|
| 58 |
+
background: radial-gradient(circle, rgba(138, 43, 226, 0.1) 0%, transparent 70%);
|
| 59 |
+
animation: pulse 4s ease-in-out infinite;
|
| 60 |
+
}
|
| 61 |
+
</style>
|
| 62 |
+
</head>
|
| 63 |
+
<body class="bg-gray-900 text-gray-200 font-sans antialiased">
|
| 64 |
+
<div class="container mx-auto px-4 py-8 max-w-7xl">
|
| 65 |
+
<!-- Header -->
|
| 66 |
+
<header class="text-center py-12 px-6 bg-gradient-to-br from-gray-800 to-gray-900 rounded-2xl mb-10 relative overflow-hidden header-glow">
|
| 67 |
+
<h1 class="text-4xl md:text-5xl lg:text-6xl font-bold mb-3 gradient-text">AI Motion Grammar System</h1>
|
| 68 |
+
<p class="text-lg md:text-xl text-gray-400">Professional Prompt Engineering for Midjourney V1 Video</p>
|
| 69 |
+
<div class="absolute inset-0 bg-gradient-to-br from-purple-900/10 via-transparent to-cyan-500/10"></div>
|
| 70 |
+
</header>
|
| 71 |
+
|
| 72 |
+
<!-- Main Builder -->
|
| 73 |
+
<div class="bg-gray-800 rounded-xl p-6 md:p-8 mb-8 shadow-xl border border-gray-700">
|
| 74 |
+
<h2 class="text-2xl font-bold mb-6 text-purple-400 flex items-center">
|
| 75 |
+
<i class="fas fa-cogs mr-3"></i> Motion Grammar Builder
|
| 76 |
+
</h2>
|
| 77 |
+
|
| 78 |
+
<!-- Gradient Intensity -->
|
| 79 |
+
<div class="mb-8">
|
| 80 |
+
<h3 class="text-xl font-semibold mb-4 text-cyan-400 flex items-center">
|
| 81 |
+
<span class="bg-gray-700 rounded-full w-8 h-8 flex items-center justify-center mr-3 text-sm">1</span>
|
| 82 |
+
Gradient Intensity
|
| 83 |
+
</h3>
|
| 84 |
+
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4" id="gradientGrid">
|
| 85 |
+
<!-- Populated by JS -->
|
| 86 |
+
</div>
|
| 87 |
+
</div>
|
| 88 |
+
|
| 89 |
+
<!-- Movement Type -->
|
| 90 |
+
<div class="mb-8">
|
| 91 |
+
<h3 class="text-xl font-semibold mb-4 text-cyan-400 flex items-center">
|
| 92 |
+
<span class="bg-gray-700 rounded-full w-8 h-8 flex items-center justify-center mr-3 text-sm">2</span>
|
| 93 |
+
Movement Type
|
| 94 |
+
</h3>
|
| 95 |
+
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4" id="movementGrid">
|
| 96 |
+
<!-- Populated by JS -->
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
+
|
| 100 |
+
<!-- Smoothness Descriptor -->
|
| 101 |
+
<div class="mb-8">
|
| 102 |
+
<h3 class="text-xl font-semibold mb-4 text-cyan-400 flex items-center">
|
| 103 |
+
<span class="bg-gray-700 rounded-full w-8 h-8 flex items-center justify-center mr-3 text-sm">3</span>
|
| 104 |
+
Smoothness Descriptor
|
| 105 |
+
</h3>
|
| 106 |
+
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4" id="smoothnessGrid">
|
| 107 |
+
<!-- Populated by JS -->
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
|
| 111 |
+
<!-- Energy Level -->
|
| 112 |
+
<div class="mb-8">
|
| 113 |
+
<h3 class="text-xl font-semibold mb-4 text-cyan-400 flex items-center">
|
| 114 |
+
<span class="bg-gray-700 rounded-full w-8 h-8 flex items-center justify-center mr-3 text-sm">4</span>
|
| 115 |
+
Energy Level
|
| 116 |
+
</h3>
|
| 117 |
+
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4" id="energyGrid">
|
| 118 |
+
<!-- Populated by JS -->
|
| 119 |
+
</div>
|
| 120 |
+
</div>
|
| 121 |
+
|
| 122 |
+
<!-- Motion Setting -->
|
| 123 |
+
<div class="mb-8">
|
| 124 |
+
<h3 class="text-xl font-semibold mb-4 text-cyan-400 flex items-center">
|
| 125 |
+
<span class="bg-gray-700 rounded-full w-8 h-8 flex items-center justify-center mr-3 text-sm">5</span>
|
| 126 |
+
Motion Setting
|
| 127 |
+
</h3>
|
| 128 |
+
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4" id="motionSettingGrid">
|
| 129 |
+
<!-- Populated by JS -->
|
| 130 |
+
</div>
|
| 131 |
+
</div>
|
| 132 |
+
|
| 133 |
+
<!-- Motion Score -->
|
| 134 |
+
<div class="bg-gray-800 rounded-xl p-6 mb-8 border border-gray-700">
|
| 135 |
+
<h3 class="text-xl font-semibold mb-4 text-center text-purple-400">Calculated Motion Score</h3>
|
| 136 |
+
<div class="text-5xl font-bold text-center mb-2 gradient-text" id="scoreDisplay">0.00</div>
|
| 137 |
+
|
| 138 |
+
<div class="w-full h-8 bg-gray-700 rounded-full overflow-hidden mb-4">
|
| 139 |
+
<div class="h-full bg-gradient-to-r from-cyan-400 via-purple-500 to-pink-500 rounded-full transition-all duration-500" id="scoreFill" style="width: 0%"></div>
|
| 140 |
+
</div>
|
| 141 |
+
|
| 142 |
+
<p class="text-center text-gray-400" id="scoreDescription">Select parameters to calculate motion intensity</p>
|
| 143 |
+
</div>
|
| 144 |
+
|
| 145 |
+
<!-- Generated Prompt -->
|
| 146 |
+
<div class="bg-gray-900 rounded-xl p-6 mb-8 border-2 border-purple-500 relative overflow-hidden">
|
| 147 |
+
<div class="absolute top-2 left-3 text-xs text-purple-400 font-mono">GENERATED PROMPT</div>
|
| 148 |
+
<button class="absolute top-2 right-3 bg-purple-600 text-white px-3 py-1 rounded text-sm hover:bg-purple-700 transition" onclick="copyPrompt()">
|
| 149 |
+
<i class="fas fa-copy mr-1"></i> Copy
|
| 150 |
+
</button>
|
| 151 |
+
<div class="mt-6 font-mono text-cyan-400 break-words" id="promptDisplay">
|
| 152 |
+
Select parameters above to generate your prompt
|
| 153 |
+
</div>
|
| 154 |
+
</div>
|
| 155 |
+
|
| 156 |
+
<!-- Formula -->
|
| 157 |
+
<div class="bg-gray-900 rounded-xl p-4 mb-8 border border-gray-700 text-center font-mono text-gray-500">
|
| 158 |
+
Motion Score = Gradient Intensity × Energy Multiplier × Motion Setting
|
| 159 |
+
</div>
|
| 160 |
+
|
| 161 |
+
<!-- Controls -->
|
| 162 |
+
<div class="flex flex-col sm:flex-row gap-4 mb-8">
|
| 163 |
+
<button class="flex-1 bg-purple-600 hover:bg-purple-700 text-white py-3 px-6 rounded-lg font-medium transition flex items-center justify-center" onclick="generateRandomPrompt()">
|
| 164 |
+
<i class="fas fa-random mr-2"></i> Generate Random Prompt
|
| 165 |
+
</button>
|
| 166 |
+
<button class="flex-1 bg-gray-700 hover:bg-gray-600 text-white py-3 px-6 rounded-lg font-medium transition flex items-center justify-center" onclick="resetBuilder()">
|
| 167 |
+
<i class="fas fa-redo mr-2"></i> Reset All
|
| 168 |
+
</button>
|
| 169 |
+
<button class="flex-1 bg-cyan-600 hover:bg-cyan-700 text-white py-3 px-6 rounded-lg font-medium transition flex items-center justify-center" onclick="generateTestMatrix()">
|
| 170 |
+
<i class="fas fa-table mr-2"></i> Generate Test Matrix
|
| 171 |
+
</button>
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
|
| 175 |
+
<!-- Test Matrix (Hidden by default) -->
|
| 176 |
+
<div class="bg-gray-800 rounded-xl p-6 md:p-8 mt-10 hidden" id="testMatrix">
|
| 177 |
+
<h2 class="text-2xl font-bold mb-6 text-purple-400 flex items-center">
|
| 178 |
+
<i class="fas fa-table mr-3"></i> Systematic Test Matrix
|
| 179 |
+
</h2>
|
| 180 |
+
<div class="space-y-3" id="testItems">
|
| 181 |
+
<!-- Populated by JS -->
|
| 182 |
+
</div>
|
| 183 |
+
</div>
|
| 184 |
+
|
| 185 |
+
<!-- Tips Section -->
|
| 186 |
+
<div class="bg-gradient-to-br from-gray-800 to-purple-900/30 rounded-xl p-6 md:p-8 mt-10 border border-purple-500/30">
|
| 187 |
+
<h2 class="text-2xl font-bold mb-6 text-cyan-400 flex items-center">
|
| 188 |
+
<i class="fas fa-lightbulb mr-3"></i> Professional Usage Tips
|
| 189 |
+
</h2>
|
| 190 |
+
<ul class="space-y-3">
|
| 191 |
+
<li class="flex items-start">
|
| 192 |
+
<span class="text-purple-400 mr-3 mt-1">→</span>
|
| 193 |
+
<span>Start with medium intensity (0.5-0.7) for predictable, usable results</span>
|
| 194 |
+
</li>
|
| 195 |
+
<li class="flex items-start">
|
| 196 |
+
<span class="text-purple-400 mr-3 mt-1">→</span>
|
| 197 |
+
<span>Always include smoothness descriptors to maintain visual coherence</span>
|
| 198 |
+
</li>
|
| 199 |
+
<li class="flex items-start">
|
| 200 |
+
<span class="text-purple-400 mr-3 mt-1">→</span>
|
| 201 |
+
<span>Stack multiple movement descriptors for stronger effects</span>
|
| 202 |
+
</li>
|
| 203 |
+
<li class="flex items-start">
|
| 204 |
+
<span class="text-purple-400 mr-3 mt-1">→</span>
|
| 205 |
+
<span>Use "impossible" or "extreme" sparingly - they can overwhelm the composition</span>
|
| 206 |
+
</li>
|
| 207 |
+
<li class="flex items-start">
|
| 208 |
+
<span class="text-purple-400 mr-3 mt-1">→</span>
|
| 209 |
+
<span>Match energy level with motion setting for optimal results</span>
|
| 210 |
+
</li>
|
| 211 |
+
<li class="flex items-start">
|
| 212 |
+
<span class="text-purple-400 mr-3 mt-1">→</span>
|
| 213 |
+
<span>Test systematically - small changes can have big impacts</span>
|
| 214 |
+
</li>
|
| 215 |
+
</ul>
|
| 216 |
+
</div>
|
| 217 |
+
</div>
|
| 218 |
+
|
| 219 |
+
<script>
|
| 220 |
+
// Data structures based on the framework
|
| 221 |
+
const grammarData = {
|
| 222 |
+
gradient: {
|
| 223 |
+
minimal: { words: ['subtle', 'gentle', 'slight'], score: 0.1 },
|
| 224 |
+
low: { words: ['soft', 'mild', 'easy'], score: 0.3 },
|
| 225 |
+
medium: { words: ['smooth', 'flowing', 'steady'], score: 0.5 },
|
| 226 |
+
high: { words: ['dramatic', 'sweeping', 'bold'], score: 0.7 },
|
| 227 |
+
extreme: { words: ['impossible', 'explosive', 'extreme'], score: 1.0 }
|
| 228 |
+
},
|
| 229 |
+
movement: {
|
| 230 |
+
linear: ['pan', 'tilt', 'dolly', 'track'],
|
| 231 |
+
rotational: ['orbit', 'spiral', 'spin', 'rotate'],
|
| 232 |
+
complex: ['weave', 'dance', 'swoop', 'surge'],
|
| 233 |
+
zoom: ['zoom', 'push', 'pull', 'magnify'],
|
| 234 |
+
compound: ['spiral-zoom', 'dolly-rotate', 'pan-tilt', 'orbit-push']
|
| 235 |
+
},
|
| 236 |
+
smoothness: ['seamless', 'fluid', 'silk-smooth', 'butter-smooth', 'smooth', 'rhythmic', 'pulsing'],
|
| 237 |
+
energy: {
|
| 238 |
+
low: { words: ['calm', 'serene', 'peaceful', 'tranquil'], multiplier: 0.5 },
|
| 239 |
+
medium: { words: ['balanced', 'rhythmic', 'flowing', 'steady'], multiplier: 1.0 },
|
| 240 |
+
high: { words: ['energetic', 'dynamic', 'vibrant', 'lively'], multiplier: 1.5 },
|
| 241 |
+
extreme: { words: ['frenetic', 'explosive', 'chaotic', 'turbulent'], multiplier: 2.0 }
|
| 242 |
+
},
|
| 243 |
+
motionSetting: {
|
| 244 |
+
low: 0.7,
|
| 245 |
+
high: 1.3
|
| 246 |
+
}
|
| 247 |
+
};
|
| 248 |
+
|
| 249 |
+
// State management
|
| 250 |
+
let selectedParams = {
|
| 251 |
+
gradient: null,
|
| 252 |
+
movement: null,
|
| 253 |
+
smoothness: null,
|
| 254 |
+
energy: null,
|
| 255 |
+
motionSetting: null
|
| 256 |
+
};
|
| 257 |
+
|
| 258 |
+
// Initialize the builder
|
| 259 |
+
function initializeBuilder() {
|
| 260 |
+
populateGradientGrid();
|
| 261 |
+
populateMovementGrid();
|
| 262 |
+
populateSmoothnessGrid();
|
| 263 |
+
populateEnergyGrid();
|
| 264 |
+
populateMotionSettingGrid();
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
function populateGradientGrid() {
|
| 268 |
+
const grid = document.getElementById('gradientGrid');
|
| 269 |
+
Object.entries(grammarData.gradient).forEach(([level, data]) => {
|
| 270 |
+
const card = createParameterCard(
|
| 271 |
+
level,
|
| 272 |
+
data.words[0],
|
| 273 |
+
`Score: ${data.score}`,
|
| 274 |
+
() => selectParameter('gradient', level, data)
|
| 275 |
+
);
|
| 276 |
+
grid.appendChild(card);
|
| 277 |
+
});
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
function populateMovementGrid() {
|
| 281 |
+
const grid = document.getElementById('movementGrid');
|
| 282 |
+
Object.entries(grammarData.movement).forEach(([type, movements]) => {
|
| 283 |
+
const card = createParameterCard(
|
| 284 |
+
type,
|
| 285 |
+
movements[0],
|
| 286 |
+
`${movements.length} variations`,
|
| 287 |
+
() => selectParameter('movement', type, movements)
|
| 288 |
+
);
|
| 289 |
+
grid.appendChild(card);
|
| 290 |
+
});
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
function populateSmoothnessGrid() {
|
| 294 |
+
const grid = document.getElementById('smoothnessGrid');
|
| 295 |
+
grammarData.smoothness.forEach(smooth => {
|
| 296 |
+
const card = createParameterCard(
|
| 297 |
+
'descriptor',
|
| 298 |
+
smooth,
|
| 299 |
+
'Transition quality',
|
| 300 |
+
() => selectParameter('smoothness', smooth, smooth)
|
| 301 |
+
);
|
| 302 |
+
grid.appendChild(card);
|
| 303 |
+
});
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
function populateEnergyGrid() {
|
| 307 |
+
const grid = document.getElementById('energyGrid');
|
| 308 |
+
Object.entries(grammarData.energy).forEach(([level, data]) => {
|
| 309 |
+
const card = createParameterCard(
|
| 310 |
+
level,
|
| 311 |
+
data.words[0],
|
| 312 |
+
`Multiplier: ${data.multiplier}x`,
|
| 313 |
+
() => selectParameter('energy', level, data)
|
| 314 |
+
);
|
| 315 |
+
grid.appendChild(card);
|
| 316 |
+
});
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
function populateMotionSettingGrid() {
|
| 320 |
+
const grid = document.getElementById('motionSettingGrid');
|
| 321 |
+
Object.entries(grammarData.motionSetting).forEach(([setting, multiplier]) => {
|
| 322 |
+
const card = createParameterCard(
|
| 323 |
+
`--motion ${setting}`,
|
| 324 |
+
setting.toUpperCase(),
|
| 325 |
+
`Multiplier: ${multiplier}x`,
|
| 326 |
+
() => selectParameter('motionSetting', setting, multiplier)
|
| 327 |
+
);
|
| 328 |
+
grid.appendChild(card);
|
| 329 |
+
});
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
function createParameterCard(label, value, score, onClick) {
|
| 333 |
+
const card = document.createElement('div');
|
| 334 |
+
card.className = 'bg-gray-700 border border-gray-600 rounded-lg p-4 cursor-pointer transition hover:border-purple-500 parameter-card';
|
| 335 |
+
card.innerHTML = `
|
| 336 |
+
<div class="text-xs uppercase text-cyan-400 font-semibold mb-1">${label}</div>
|
| 337 |
+
<div class="text-lg font-medium mb-1">${value}</div>
|
| 338 |
+
<div class="text-sm text-gray-400">${score}</div>
|
| 339 |
+
`;
|
| 340 |
+
card.onclick = onClick;
|
| 341 |
+
return card;
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
function selectParameter(type, key, value) {
|
| 345 |
+
// Update state
|
| 346 |
+
selectedParams[type] = { key, value };
|
| 347 |
+
|
| 348 |
+
// Update UI
|
| 349 |
+
const grid = document.getElementById(`${type}Grid`);
|
| 350 |
+
grid.querySelectorAll('.parameter-card').forEach(card => {
|
| 351 |
+
card.classList.remove('selected', 'border-purple-500');
|
| 352 |
+
});
|
| 353 |
+
event.currentTarget.classList.add('selected', 'border-purple-500');
|
| 354 |
+
|
| 355 |
+
// Update prompt and score
|
| 356 |
+
updatePromptAndScore();
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
function updatePromptAndScore() {
|
| 360 |
+
if (Object.values(selectedParams).every(param => param !== null)) {
|
| 361 |
+
const prompt = generatePrompt();
|
| 362 |
+
const score = calculateScore();
|
| 363 |
+
|
| 364 |
+
document.getElementById('promptDisplay').textContent = prompt;
|
| 365 |
+
document.getElementById('scoreDisplay').textContent = score.toFixed(2);
|
| 366 |
+
document.getElementById('scoreFill').style.width = `${Math.min(score * 50, 100)}%`;
|
| 367 |
+
|
| 368 |
+
// Update description based on score
|
| 369 |
+
const descriptions = {
|
| 370 |
+
0.1: 'Minimal motion - barely perceptible',
|
| 371 |
+
0.3: 'Subtle motion - gentle movement',
|
| 372 |
+
0.5: 'Balanced motion - smooth and professional',
|
| 373 |
+
0.7: 'Dynamic motion - strong cinematic movement',
|
| 374 |
+
1.0: 'Extreme motion - maximum intensity',
|
| 375 |
+
1.5: 'Hyper motion - reality-bending effects',
|
| 376 |
+
2.0: 'Chaos motion - experimental territory'
|
| 377 |
+
};
|
| 378 |
+
|
| 379 |
+
let description = 'Custom motion profile';
|
| 380 |
+
for (const [threshold, desc] of Object.entries(descriptions)) {
|
| 381 |
+
if (score <= parseFloat(threshold)) {
|
| 382 |
+
description = desc;
|
| 383 |
+
break;
|
| 384 |
+
}
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
document.getElementById('scoreDescription').textContent = description;
|
| 388 |
+
}
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
function generatePrompt() {
|
| 392 |
+
const gradient = selectedParams.gradient.value.words[0];
|
| 393 |
+
const movement = Array.isArray(selectedParams.movement.value)
|
| 394 |
+
? selectedParams.movement.value[0]
|
| 395 |
+
: selectedParams.movement.value;
|
| 396 |
+
const smoothness = selectedParams.smoothness.value;
|
| 397 |
+
const energy = selectedParams.energy.value.words[0];
|
| 398 |
+
const motionSetting = selectedParams.motionSetting.key;
|
| 399 |
+
|
| 400 |
+
return `${gradient} camera ${movement}, ${smoothness}, ${energy} --motion ${motionSetting}`;
|
| 401 |
+
}
|
| 402 |
+
|
| 403 |
+
function calculateScore() {
|
| 404 |
+
const gradientScore = selectedParams.gradient.value.score;
|
| 405 |
+
const energyMultiplier = selectedParams.energy.value.multiplier;
|
| 406 |
+
const motionMultiplier = selectedParams.motionSetting.value;
|
| 407 |
+
|
| 408 |
+
return gradientScore * energyMultiplier * motionMultiplier;
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
function copyPrompt() {
|
| 412 |
+
const promptText = document.getElementById('promptDisplay').textContent;
|
| 413 |
+
navigator.clipboard.writeText(promptText).then(() => {
|
| 414 |
+
const button = document.querySelector('.copy-button');
|
| 415 |
+
const originalText = button.innerHTML;
|
| 416 |
+
button.innerHTML = '<i class="fas fa-check mr-1"></i> Copied!';
|
| 417 |
+
setTimeout(() => {
|
| 418 |
+
button.innerHTML = originalText;
|
| 419 |
+
}, 2000);
|
| 420 |
+
});
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
function generateRandomPrompt() {
|
| 424 |
+
// Random selections
|
| 425 |
+
const gradientKeys = Object.keys(grammarData.gradient);
|
| 426 |
+
const movementKeys = Object.keys(grammarData.movement);
|
| 427 |
+
const energyKeys = Object.keys(grammarData.energy);
|
| 428 |
+
const motionKeys = Object.keys(grammarData.motionSetting);
|
| 429 |
+
|
| 430 |
+
const randomGradient = gradientKeys[Math.floor(Math.random() * gradientKeys.length)];
|
| 431 |
+
const randomMovement = movementKeys[Math.floor(Math.random() * movementKeys.length)];
|
| 432 |
+
const randomSmoothness = grammarData.smoothness[Math.floor(Math.random() * grammarData.smoothness.length)];
|
| 433 |
+
const randomEnergy = energyKeys[Math.floor(Math.random() * energyKeys.length)];
|
| 434 |
+
const randomMotion = motionKeys[Math.floor(Math.random() * motionKeys.length)];
|
| 435 |
+
|
| 436 |
+
// Clear selections
|
| 437 |
+
document.querySelectorAll('.parameter-card').forEach(card => {
|
| 438 |
+
card.classList.remove('selected', 'border-purple-500');
|
| 439 |
+
});
|
| 440 |
+
|
| 441 |
+
// Make selections
|
| 442 |
+
selectedParams = {
|
| 443 |
+
gradient: { key: randomGradient, value: grammarData.gradient[randomGradient] },
|
| 444 |
+
movement: { key: randomMovement, value: grammarData.movement[randomMovement] },
|
| 445 |
+
smoothness: { key: randomSmoothness, value: randomSmoothness },
|
| 446 |
+
energy: { key: randomEnergy, value: grammarData.energy[randomEnergy] },
|
| 447 |
+
motionSetting: { key: randomMotion, value: grammarData.motionSetting[randomMotion] }
|
| 448 |
+
};
|
| 449 |
+
|
| 450 |
+
// Update UI
|
| 451 |
+
updatePromptAndScore();
|
| 452 |
+
|
| 453 |
+
// Highlight selected cards
|
| 454 |
+
setTimeout(() => {
|
| 455 |
+
document.querySelectorAll('.parameter-card').forEach(card => {
|
| 456 |
+
const text = card.textContent.toLowerCase();
|
| 457 |
+
if (text.includes(selectedParams.gradient.value.words[0]) ||
|
| 458 |
+
text.includes(selectedParams.movement.value[0]) ||
|
| 459 |
+
text.includes(selectedParams.smoothness.value) ||
|
| 460 |
+
text.includes(selectedParams.energy.value.words[0]) ||
|
| 461 |
+
text.includes(randomMotion)) {
|
| 462 |
+
card.classList.add('selected', 'border-purple-500');
|
| 463 |
+
}
|
| 464 |
+
});
|
| 465 |
+
}, 100);
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
function resetBuilder() {
|
| 469 |
+
selectedParams = {
|
| 470 |
+
gradient: null,
|
| 471 |
+
movement: null,
|
| 472 |
+
smoothness: null,
|
| 473 |
+
energy: null,
|
| 474 |
+
motionSetting: null
|
| 475 |
+
};
|
| 476 |
+
|
| 477 |
+
document.querySelectorAll('.parameter-card').forEach(card => {
|
| 478 |
+
card.classList.remove('selected', 'border-purple-500');
|
| 479 |
+
});
|
| 480 |
+
|
| 481 |
+
document.getElementById('promptDisplay').textContent = 'Select parameters above to generate your prompt';
|
| 482 |
+
document.getElementById('scoreDisplay').textContent = '0.00';
|
| 483 |
+
document.getElementById('scoreFill').style.width = '0%';
|
| 484 |
+
document.getElementById('scoreDescription').textContent = 'Select parameters to calculate motion intensity';
|
| 485 |
+
}
|
| 486 |
+
|
| 487 |
+
function generateTestMatrix() {
|
| 488 |
+
const testMatrix = document.getElementById('testMatrix');
|
| 489 |
+
const testItems = document.getElementById('testItems');
|
| 490 |
+
|
| 491 |
+
// Clear existing items
|
| 492 |
+
testItems.innerHTML = '';
|
| 493 |
+
|
| 494 |
+
// Generate systematic test cases
|
| 495 |
+
const testCases = [
|
| 496 |
+
{ gradient: 'minimal', movement: 'linear', smoothness: 'seamless', energy: 'low', motion: 'low' },
|
| 497 |
+
{ gradient: 'low', movement: 'linear', smoothness: 'fluid', energy: 'medium', motion: 'low' },
|
| 498 |
+
{ gradient: 'medium', movement: 'rotational', smoothness: 'smooth', energy: 'medium', motion: 'low' },
|
| 499 |
+
{ gradient: 'medium', movement: 'zoom', smoothness: 'seamless', energy: 'high', motion: 'high' },
|
| 500 |
+
{ gradient: 'high', movement: 'complex', smoothness: 'fluid', energy: 'high', motion: 'high' },
|
| 501 |
+
{ gradient: 'extreme', movement: 'compound', smoothness: 'seamless', energy: 'extreme', motion: 'high' }
|
| 502 |
+
];
|
| 503 |
+
|
| 504 |
+
testCases.forEach(test => {
|
| 505 |
+
const gradient = grammarData.gradient[test.gradient].words[0];
|
| 506 |
+
const movement = grammarData.movement[test.movement][0];
|
| 507 |
+
const smoothness = test.smoothness;
|
| 508 |
+
const energy = grammarData.energy[test.energy].words[0];
|
| 509 |
+
|
| 510 |
+
const prompt = `${gradient} camera ${movement}, ${smoothness}, ${energy} --motion ${test.motion}`;
|
| 511 |
+
const score = grammarData.gradient[test.gradient].score *
|
| 512 |
+
grammarData.energy[test.energy].multiplier *
|
| 513 |
+
grammarData.motionSetting[test.motion];
|
| 514 |
+
|
| 515 |
+
const item = document.createElement('div');
|
| 516 |
+
item.className = 'bg-gray-700 rounded-lg p-4 flex flex-col sm:flex-row justify-between items-center hover:bg-gray-600 transition cursor-pointer';
|
| 517 |
+
item.innerHTML = `
|
| 518 |
+
<div class="font-mono text-cyan-400 mb-2 sm:mb-0 sm:mr-4 flex-1">${prompt}</div>
|
| 519 |
+
<div class="bg-gradient-to-r from-purple-500 to-pink-500 text-white px-4 py-1 rounded-full font-bold text-sm whitespace-nowrap">
|
| 520 |
+
${score.toFixed(2)}
|
| 521 |
+
</div>
|
| 522 |
+
`;
|
| 523 |
+
|
| 524 |
+
item.onclick = () => {
|
| 525 |
+
navigator.clipboard.writeText(prompt);
|
| 526 |
+
item.classList.add('bg-green-900/30');
|
| 527 |
+
setTimeout(() => {
|
| 528 |
+
item.classList.remove('bg-green-900/30');
|
| 529 |
+
}, 500);
|
| 530 |
+
};
|
| 531 |
+
|
| 532 |
+
testItems.appendChild(item);
|
| 533 |
+
});
|
| 534 |
+
|
| 535 |
+
testMatrix.classList.remove('hidden');
|
| 536 |
+
testMatrix.scrollIntoView({ behavior: 'smooth' });
|
| 537 |
+
}
|
| 538 |
+
|
| 539 |
+
// Initialize on load
|
| 540 |
+
document.addEventListener('DOMContentLoaded', initializeBuilder);
|
| 541 |
+
</script>
|
| 542 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Malaji71/midjourney-video-prompt-test" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 543 |
+
</html>
|