|
| 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>Python Interpreter Online</title> |
| 7 | + <link rel="stylesheet" href="styles.css"> |
| 8 | + <!-- Monaco Editor CSS --> |
| 9 | + <link rel="stylesheet" data-name="vs/editor/editor.main" href="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.1/min/vs/editor/editor.main.min.css"> |
| 10 | +</head> |
| 11 | +<body> |
| 12 | + <header> |
| 13 | + <h1>Python Interpreter Online</h1> |
| 14 | + </header> |
| 15 | + |
| 16 | + <main> |
| 17 | + <div class="container"> |
| 18 | + <div id="editor-container"></div> |
| 19 | + <div class="button-container"> |
| 20 | + <button id="run-button">Run Code</button> |
| 21 | + <button id="clear-button">Clear Output</button> |
| 22 | + <button id="copy-button" title="Copy code to clipboard">Copy Code</button> |
| 23 | + <button id="share-button" title="Generate shareable link">Share Code</button> |
| 24 | + <select id="example-select"> |
| 25 | + <option value="">Select Example</option> |
| 26 | + <option value="hello">Hello World</option> |
| 27 | + <option value="error">Error Handling</option> |
| 28 | + <option value="loop">Performance Test</option> |
| 29 | + <option value="input">Input Handling</option> |
| 30 | + </select> |
| 31 | + </div> |
| 32 | + <div id="share-container" class="hidden"> |
| 33 | + <div class="share-content"> |
| 34 | + <input type="text" id="share-url" readonly> |
| 35 | + <button id="copy-share-url">Copy URL</button> |
| 36 | + <button id="close-share">Close</button> |
| 37 | + </div> |
| 38 | + </div> |
| 39 | + <div id="output-container"> |
| 40 | + <h3>Output</h3> |
| 41 | + <div id="execution-status" class="execution-status hidden"> |
| 42 | + <div class="spinner"></div> |
| 43 | + <span id="status-message">Running code...</span> |
| 44 | + </div> |
| 45 | + <pre id="output"></pre> |
| 46 | + </div> |
| 47 | + </div> |
| 48 | + </main> |
| 49 | + |
| 50 | + <footer> |
| 51 | + <div class="footer-content"> |
| 52 | + <p>Python Interpreter Online - A free, open-source project</p> |
| 53 | + <div class="support-options"> |
| 54 | + <a href="https://github.com/sponsors/GetGit789" target="_blank" class="support-link github-sponsor"> |
| 55 | + <span class="support-icon">❤️</span> Sponsor |
| 56 | + </a> |
| 57 | + <a href="https://ko-fi.com/getgit789" target="_blank" class="support-link kofi"> |
| 58 | + <span class="support-icon">☕</span> Buy me a coffee |
| 59 | + </a> |
| 60 | + </div> |
| 61 | + </div> |
| 62 | + </footer> |
| 63 | + |
| 64 | + <!-- Load Axios from CDN --> |
| 65 | + <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> |
| 66 | + |
| 67 | + <!-- Load Monaco Editor from CDN --> |
| 68 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.1/min/vs/loader.min.js"></script> |
| 69 | + <script> |
| 70 | + require.config({ |
| 71 | + paths: { |
| 72 | + 'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.1/min/vs' |
| 73 | + } |
| 74 | + }); |
| 75 | + window.MonacoEnvironment = { |
| 76 | + getWorkerUrl: function(workerId, label) { |
| 77 | + return `data:text/javascript;charset=utf-8,${encodeURIComponent(` |
| 78 | + self.MonacoEnvironment = { |
| 79 | + baseUrl: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.1/min/' |
| 80 | + }; |
| 81 | + importScripts('https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.1/min/vs/base/worker/workerMain.js'); |
| 82 | + `)}`; |
| 83 | + } |
| 84 | + }; |
| 85 | + </script> |
| 86 | + <script src="script.js"></script> |
| 87 | +</body> |
| 88 | +</html> |
0 commit comments