MCPcopy Create free account
hub / github.com/Tracktion/choc / getMainHTML

Method getMainHTML

examples/webview_desktop_app.cpp:173–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171 }
172
173 std::string getMainHTML()
174 {
175 return R"HTML(
176<!DOCTYPE html>
177<html lang="en">
178<head>
179 <meta charset="UTF-8">
180 <meta name="viewport" content="width=device-width, initial-scale=1.0">
181 <title>CHOC WebView App</title>
182 <link rel="stylesheet" href="style.css">
183</head>
184<body>
185 <div class="container">
186 <header>
187 <h1>🎯 CHOC WebView Desktop Application</h1>
188 <p>Demonstrating C++ ↔ JavaScript integration</p>
189 </header>
190
191 <section class="demo-section">
192 <h2>System Information</h2>
193 <button onclick="getSystemInfo()">Get System Info</button>
194 <div id="systemInfo" class="info-box"></div>
195 </section>
196
197 <section class="demo-section">
198 <h2>Current Time</h2>
199 <button onclick="getCurrentTime()">Get Current Time</button>
200 <div id="timeDisplay" class="info-box"></div>
201 </section>
202
203 <section class="demo-section">
204 <h2>Calculator (C++ Backend)</h2>
205 <div class="calculator">
206 <input type="number" id="num1" placeholder="First number" value="10">
207 <select id="operation">
208 <option value="+">+</option>
209 <option value="-">-</option>
210 <option value="*">×</option>
211 <option value="/">/</option>
212 </select>
213 <input type="number" id="num2" placeholder="Second number" value="5">
214 <button onclick="calculate()">Calculate</button>
215 </div>
216 <div id="calcResult" class="info-box"></div>
217 </section>
218
219 <section class="demo-section">
220 <h2>JavaScript → C++ Alerts</h2>
221 <input type="text" id="alertMessage" placeholder="Enter message" value="Hello from JavaScript!">
222 <button onclick="sendAlert()">Send Alert to C++</button>
223 </section>
224
225 <section class="demo-section">
226 <h2>Live Data</h2>
227 <button onclick="toggleAutoUpdate()" id="autoUpdateBtn">Start Auto-Update</button>
228 <div id="liveData" class="info-box"></div>
229 </section>
230 </div>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected