File size: 6,289 Bytes
df9973f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84e1dd3
633f37b
 
df9973f
 
 
 
84e1dd3
df9973f
84e1dd3
df9973f
633f37b
84e1dd3
 
633f37b
df9973f
 
84e1dd3
633f37b
 
 
df9973f
633f37b
 
84e1dd3
 
 
633f37b
 
df9973f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI Pro Suite - Image Creator</title>
    <link rel="manifest" href="/manifest.json">
    <meta name="theme-color" content="#0f172a">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
    <script>

      if (window.pdfjsLib) pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js';

    </script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/localforage/1.10.0/localforage.min.js"></script>
    <link rel="stylesheet" href="style.css">
</head>
<body>
<div class="overlay" id="overlay"></div>

<div class="topbar">
  <div class="menuBtn" onclick="toggleSidebar()">โ˜ฐ</div>
  <div class="appTitle">AI Pro Suite</div>
</div>
<div class="apiTracker">
    <div>๐ŸŽจ Cloudflare Image Studio</div>
    <div>๐Ÿ“„ PDF + ๐Ÿ–ผ๏ธ Image context</div>
</div>

<div class="sidebar" id="sidebar" style="overflow-y:auto;">
  <button class="sidebar-close-btn" onclick="toggleSidebar()">โœ– Close Menu</button>
  <button onclick="window.location.href='index.html'">๐Ÿ  Dashboard</button>
  <button onclick="window.location.href='lens.html'">โœจ Lens Studio</button>
  <button onclick="window.location.href='books.html'">๐Ÿ“š Book Deep Study</button>
  <button onclick="window.location.href='maths.html'">๐Ÿงฎ Math Solver</button>
  <button onclick="window.location.href='search.html'">๐Ÿ”Ž Deep Search</button>
  <button onclick="window.location.href='downloader.html'">๐Ÿ“ฅ Video Downloader</button>
  <button onclick="window.location.href='board.html'">๐Ÿ“‹ Whiteboard</button>
  <button onclick="window.location.href='clone.html'">๐Ÿ“‘ Website Cloner</button>
  <button onclick="window.location.href='runhtml.html'">๐ŸŒ Write HTML</button>
  <button onclick="window.location.href='youtube.html'">โ–ถ๏ธ YouTube Search</button>
  <button onclick="window.location.href='managequiz.html'">โš™๏ธ Manage Quiz</button>
  <button onclick="window.location.href='tutor.html'">๐Ÿ‘จโ€๐Ÿซ AI Tutor</button>
  <button onclick="window.location.href='quiz.html'">๐Ÿ“ Take a Quiz!</button>
  <button onclick="window.location.href='book_quiz.html'">๐Ÿ“ Take a Book Quiz!</button>
  <button onclick="window.location.href='tables.html'">๐Ÿ”ข Maths Table</button>
  <button onclick="window.location.href='coding.html'">๐Ÿ’ป AI Coding</button>
  <button onclick="window.location.href='chess.html'">โ™Ÿ๏ธ Chess AI</button>
  <button onclick="window.location.href='translator.html'">๐ŸŽ™๏ธ Text Translator</button>
  <button onclick="window.location.href='image.html'">๐Ÿ–ผ๏ธ Image Translator</button>
  <button onclick="window.location.href='create.html'" style="border-left: 4px solid var(--primary); color: var(--primary); background: var(--border-light);">๐ŸŽจ Image Creator</button>
  <button onclick="window.location.href='qa.html'">๐Ÿ“š Document Q&A</button>
  <button onclick="window.location.href='history.html'">๐Ÿ•’ History & Downloads</button>
  <button onclick="window.location.href='storage.html'">๐Ÿ“‚ Storage</button>
  <button onclick="window.location.href='hub.html'">๐Ÿ›ฐ๏ธ HF Command Center</button>
  <button onclick="window.location.href='live.html'">๐Ÿ—ฃ๏ธ Gemini Live</button>
</div>

<div class="page active" id="createPage">
  <div class="creator-hero card">
    <div class="creator-orb">๐ŸŽจ</div>
    <div>
      <h1>Cloudflare Image Creator</h1>
      <p class="cardSub">Type your idea, upload a reference image, or attach a PDF. The app extracts helpful context and asks Cloudflare AI to generate a polished image.</p>
    </div>
  </div>

  <div class="creator-layout">
    <div class="card creator-panel">
      <div class="cardTitle">1. Describe your image</div>
      <textarea class="standard" id="createPrompt" rows="6" placeholder="Example: Create a neon cyberpunk classroom poster explaining fractions in Hindi, bright colors, readable text, 16:9..."></textarea>

      <div class="create-upload-grid">
        <label class="create-upload-card">
          <input id="createImageInput" type="file" accept="image/*" hidden>
          <span>๐Ÿ–ผ๏ธ</span>
          <strong>Upload image</strong>
          <small id="createImageName">Reference / inspiration</small>
        </label>
        <label class="create-upload-card">
          <input id="createPdfInput" type="file" accept="application/pdf" hidden>
          <span>๐Ÿ“„</span>
          <strong>Upload PDF</strong>
          <small id="createPdfName">Use notes / document text</small>
        </label>
      </div>

      <div class="creator-preview-row">
        <img id="createImagePreview" alt="Uploaded reference preview" style="display:none;">
        <div id="createPdfPreview" class="create-pdf-chip" style="display:none;">๐Ÿ“„ PDF attached</div>
      </div>

      <button class="btn purple creator-generate-btn" id="createGenerateBtn" onclick="generateCloudflareImage()">โœจ Generate Image</button>
      <button class="btn red" style="display:none;" id="createClearBtn" onclick="clearCreateInputs()">๐Ÿงน Clear Creator</button>
    </div>

    <div class="card creator-result-card">
      <div class="cardTitle">2. Generated result</div>
      <div id="createStatus" class="create-status">Ready. Add your prompt and optional files.</div>
      <div class="creator-result-stage" id="createResultStage">
        <div class="creator-placeholder">
          <div>๐ŸŒˆ</div>
          <strong>Your Cloudflare artwork appears here</strong>
          <span>No image generated yet.</span>
        </div>
      </div>
      <div class="creator-actions" id="createActions" style="display:none;">
        <a class="btn green" id="downloadCreatedImage" download="cloudflare-created-image.png">๐Ÿ’พ Download</a>
        <button class="btn blue" onclick="copyCreatedPrompt()">๐Ÿ“‹ Copy Prompt</button>
      </div>
    </div>
  </div>
</div>

<script src="ui-controls.js" defer></script>
<script src="create.js" defer></script>
</body>
</html>