ismdrobiul489 commited on
Commit
5324cbd
·
1 Parent(s): 1574979

Fix: Remove orphaned Art Reels JS code that was breaking Quiz form

Browse files
Files changed (1) hide show
  1. static/index.html +0 -126
static/index.html CHANGED
@@ -956,132 +956,6 @@
956
  }
957
  });
958
 
959
- // ==========================================
960
- // ART REELS MODULE
961
- // ==========================================
962
-
963
- // Helper function for polling art job status
964
- async function pollArtStatus(jobId, statusDiv, type) {
965
- const checkStatus = async () => {
966
- try {
967
- const res = await fetch(`/api/art/${jobId}/status`);
968
- const status = await res.json();
969
-
970
- if (status.status === 'ready') {
971
- statusDiv.className = 'status success';
972
- statusDiv.innerHTML = `✅ Video Ready! <a href="${status.video_url}" target="_blank" style="color: var(--accent);">Download Video</a>`;
973
- return;
974
- } else if (status.status === 'failed') {
975
- statusDiv.className = 'status error';
976
- statusDiv.innerHTML = `❌ Failed: ${status.error}`;
977
- return;
978
- } else {
979
- statusDiv.innerHTML = `⏳ ${status.status}... ${status.progress}%`;
980
- setTimeout(checkStatus, 2000);
981
- }
982
- } catch (err) {
983
- statusDiv.className = 'status error';
984
- statusDiv.innerHTML = `❌ Error: ${err.message}`;
985
- }
986
- };
987
- checkStatus();
988
- }
989
-
990
- // Minecraft Form
991
- document.getElementById('minecraftForm').addEventListener('submit', async (e) => {
992
- e.preventDefault();
993
- const status = document.getElementById('minecraftStatus');
994
- status.className = 'status';
995
- status.classList.remove('hidden');
996
- status.innerHTML = '⏳ Starting Minecraft video generation...';
997
-
998
- const data = {
999
- description: document.getElementById('mcDescription').value,
1000
- blocks: 50,
1001
- speed: parseFloat(document.getElementById('mcSpeed').value)
1002
- };
1003
-
1004
- try {
1005
- const res = await fetch('/api/art/minecraft', {
1006
- method: 'POST',
1007
- headers: { 'Content-Type': 'application/json' },
1008
- body: JSON.stringify(data)
1009
- });
1010
- const result = await res.json();
1011
-
1012
- if (result.job_id) {
1013
- status.innerHTML = `⏳ Job started: ${result.job_id}`;
1014
- pollArtStatus(result.job_id, status, 'minecraft');
1015
- }
1016
- } catch (err) {
1017
- status.className = 'status error';
1018
- status.innerHTML = '❌ Error: ' + err.message;
1019
- }
1020
- });
1021
-
1022
- // Drawing Form
1023
- document.getElementById('drawingForm').addEventListener('submit', async (e) => {
1024
- e.preventDefault();
1025
- const status = document.getElementById('drawingStatus');
1026
- status.className = 'status';
1027
- status.classList.remove('hidden');
1028
- status.innerHTML = '⏳ Starting drawing animation...';
1029
-
1030
- const data = {
1031
- subject: document.getElementById('drawSubject').value,
1032
- style: 'outline_first',
1033
- colors: true
1034
- };
1035
-
1036
- try {
1037
- const res = await fetch('/api/art/drawing', {
1038
- method: 'POST',
1039
- headers: { 'Content-Type': 'application/json' },
1040
- body: JSON.stringify(data)
1041
- });
1042
- const result = await res.json();
1043
-
1044
- if (result.job_id) {
1045
- status.innerHTML = `⏳ Job started: ${result.job_id}`;
1046
- pollArtStatus(result.job_id, status, 'drawing');
1047
- }
1048
- } catch (err) {
1049
- status.className = 'status error';
1050
- status.innerHTML = '❌ Error: ' + err.message;
1051
- }
1052
- });
1053
-
1054
- // Stick Figure Form
1055
- document.getElementById('stickForm').addEventListener('submit', async (e) => {
1056
- e.preventDefault();
1057
- const status = document.getElementById('stickStatus');
1058
- status.className = 'status';
1059
- status.classList.remove('hidden');
1060
- status.innerHTML = '⏳ Starting stick figure video...';
1061
-
1062
- const data = {
1063
- script: document.getElementById('stickScript').value,
1064
- voice: 'af_heart'
1065
- };
1066
-
1067
- try {
1068
- const res = await fetch('/api/art/stick-figure', {
1069
- method: 'POST',
1070
- headers: { 'Content-Type': 'application/json' },
1071
- body: JSON.stringify(data)
1072
- });
1073
- const result = await res.json();
1074
-
1075
- if (result.job_id) {
1076
- status.innerHTML = `⏳ Job started: ${result.job_id}`;
1077
- pollArtStatus(result.job_id, status, 'stick');
1078
- }
1079
- } catch (err) {
1080
- status.className = 'status error';
1081
- status.innerHTML = '❌ Error: ' + err.message;
1082
- }
1083
- });
1084
-
1085
  // ==========================================
1086
  // QUIZ REEL MODULE
1087
  // ==========================================
 
956
  }
957
  });
958
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
959
  // ==========================================
960
  // QUIZ REEL MODULE
961
  // ==========================================