PHP Classes

File: ui/assets/js/demo/ai-image-generator.demo.js

Recommend this page to a friend!
  Packages of madi kais   PHP KAI Harness   ui/assets/js/demo/ai-image-generator.demo.js   Download  
File: ui/assets/js/demo/ai-image-generator.demo.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP KAI Harness
AI Agent framework with telemetry dashboard
Author: By
Last change:
Date: 4 months ago
Size: 1,626 bytes
 

 

Contents

Class file image Download
var toggleAiGenerateImage = function() { $(document).on('submit', '[data-form-submit="generate-image"]', function(e) { e.preventDefault(); const aiContainer = document.getElementById('aiGeneratedContainer'); const aiGenerating = document.getElementById('aiGeneratingResult'); const aiGenerated = document.getElementById('aiGeneratedResult'); if (aiContainer && aiGenerating && aiGenerated) { aiContainer.classList.remove('d-none'); aiGenerating.classList.remove('d-none'); aiGenerating.classList.add('show'); const aiContainerPosition = aiContainer.getBoundingClientRect().top + window.scrollY; window.scrollTo({ top: aiContainerPosition - 100, behavior: "smooth" }); setTimeout(() => { aiGenerating.classList.add('d-none'); aiGenerated.classList.remove('d-none'); }, 3000); } }); }; var toggleAiDropdownSelection = function() { $(document).on('click', '[data-select="ai-dropdown-selection"]', function(e) { e.preventDefault(); const targetValue = $(this).attr('data-value'); const targetContainer = $(this).attr('data-target'); $(targetContainer).html(targetValue); }); }; var previewImage = function(event) { const file = event.target.files[0]; if (file) { const reader = new FileReader(); reader.onload = function (e) { const img = document.getElementById('previewImage'); if (img) { img.src = e.target.result; img.classList.remove('d-none'); } else { img.classList.add('d-none'); } }; reader.readAsDataURL(file); } } $(document).ready(function() { toggleAiGenerateImage(); toggleAiDropdownSelection(); });