|
| 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>Boxer-Python</title> |
| 7 | + <style> |
| 8 | + body { |
| 9 | + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; |
| 10 | + margin: 0; |
| 11 | + padding: 0; |
| 12 | + display: flex; |
| 13 | + justify-content: center; |
| 14 | + align-items: center; |
| 15 | + height: 100vh; |
| 16 | + background-color: lightblue; |
| 17 | + color: #f0f0f0; |
| 18 | + } |
| 19 | + #fileList { |
| 20 | + font-size: 12px; /* Smaller font size */ |
| 21 | + color: black; /* Black font color */ |
| 22 | + } |
| 23 | + #fileList a { |
| 24 | + text-decoration: none; |
| 25 | + color: black; /* Black font color for links */ |
| 26 | + } |
| 27 | + #fileList a:hover { |
| 28 | + text-decoration: underline; /* Underline on hover */ |
| 29 | + } |
| 30 | + h1 { |
| 31 | + color: #007acc; |
| 32 | + font-size: 25px; |
| 33 | + position: absolute; |
| 34 | + top: 25px; |
| 35 | + margin-bottom: 5%; |
| 36 | + z-index: 1000; /* Ensure it is on top of other content */ |
| 37 | + } |
| 38 | + .container { |
| 39 | + display: flex; |
| 40 | + flex-wrap: wrap; |
| 41 | + width: 100%; |
| 42 | + max-width: 1200px; |
| 43 | + padding: 20px; |
| 44 | + box-sizing: border-box; |
| 45 | + } |
| 46 | + .image { |
| 47 | + flex: 1; |
| 48 | + padding: 10px; |
| 49 | + display: flex; |
| 50 | + height: 60vh; |
| 51 | + justify-content: center; |
| 52 | + align-items: center; |
| 53 | + } |
| 54 | + .image img { |
| 55 | + max-width: 100%; |
| 56 | + height: 20vh; |
| 57 | + border-radius: 8px; |
| 58 | + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); |
| 59 | + } |
| 60 | + .code { |
| 61 | + flex: 1; |
| 62 | + padding: 10px; |
| 63 | + display: flex; |
| 64 | + flex-direction: column; |
| 65 | + } |
| 66 | + .github-input { |
| 67 | + flex: 1; |
| 68 | + padding: 10px; |
| 69 | + display: flex; |
| 70 | + flex-direction: column; |
| 71 | + } |
| 72 | + .code textarea { |
| 73 | + width: 100%; |
| 74 | + height: 60vh; |
| 75 | + border: none; |
| 76 | + border-radius: 8px; |
| 77 | + padding: 10px; |
| 78 | + font-family: 'Fira Code', monospace; |
| 79 | + font-size: 16px; |
| 80 | + background-color: #2b2b2b; |
| 81 | + color: #f0f0f0; |
| 82 | + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); |
| 83 | + resize: none; |
| 84 | + } |
| 85 | + .code textarea:focus { |
| 86 | + outline: none; |
| 87 | + box-shadow: 0 0 10px #007acc; |
| 88 | + } |
| 89 | + .button { |
| 90 | + margin-top: 20px; |
| 91 | + padding: 10px 20px; |
| 92 | + background-color: #007acc; |
| 93 | + width: 180px; |
| 94 | + align-self: center; |
| 95 | + color: #f0f0f0; |
| 96 | + border: none; |
| 97 | + border-radius: 8px; |
| 98 | + font-size: 16px; |
| 99 | + cursor: pointer; |
| 100 | + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); |
| 101 | + } |
| 102 | + .github-btn { |
| 103 | + position: absolute; |
| 104 | + top: 20px; |
| 105 | + right: 20px; |
| 106 | + z-index: 1000; /* Ensure it is on top of other content */ |
| 107 | + } |
| 108 | + @media (max-width: 600px) { |
| 109 | + .container { |
| 110 | + flex-direction: column; |
| 111 | + padding-top: 300px; |
| 112 | + } |
| 113 | + h1 { |
| 114 | + margin-top: 10%; |
| 115 | + margin-left: 3%; |
| 116 | + } |
| 117 | + .code textarea { |
| 118 | + height: 50vh; |
| 119 | + } |
| 120 | + } |
| 121 | + </style> |
| 122 | +</head> |
| 123 | +<body> |
| 124 | + <h1>Boxer - Deploy a Python App Now</h1> |
| 125 | + <div class="github-btn"> |
| 126 | + <iframe src="https://ghbtns.com/github-btn.html?user=dphilla&repo=boxer&type=star&count=true&size=large" frameborder="0" scrolling="0" width="125" height="30" title="GitHub"></iframe> |
| 127 | + </div> |
| 128 | + <div class="container"> |
| 129 | + <div class="code"> |
| 130 | + <div class="github-input"> |
| 131 | + <input type="text" id="repoUrl" placeholder="Enter GitHub repo URL"> |
| 132 | + <button id="fetchFiles">Fetch Files</button> |
| 133 | + <ul id="fileList"></ul> |
| 134 | + </div> |
| 135 | + (Dockerfile) |
| 136 | + <textarea> |
| 137 | +FROM python:3 |
| 138 | +WORKDIR /usr/src/app |
| 139 | +COPY . . |
| 140 | +CMD [ "python", "./script.py" ] |
| 141 | + </textarea> |
| 142 | + <button id="deployButton" class="button">Deploy!</button> |
| 143 | + </div> |
| 144 | + |
| 145 | + <div class="image"> |
| 146 | + <a href="/" target="_blank"> |
| 147 | + <img src="https://user-images.githubusercontent.com/20820229/164059786-8d082b44-59d6-431a-adf4-993116c8d492.png" alt="Placeholder Image"> |
| 148 | + </a> |
| 149 | + <!--<img src="https://user-images.githubusercontent.com/20820229/164059786-8d082b44-59d6-431a-adf4-993116c8d492.png" alt="Mia St John" width="300" height="400">--> |
| 150 | + </div> |
| 151 | + </div> |
| 152 | + |
| 153 | + |
| 154 | + <script> |
| 155 | + document.getElementById('fetchFiles').onclick = async function() { |
| 156 | + const repoUrl = document.getElementById('repoUrl').value; |
| 157 | + const fileListElement = document.getElementById('fileList'); |
| 158 | + fileListElement.innerHTML = ''; |
| 159 | + |
| 160 | + const match = repoUrl.match(/github\.com\/([^\/]+)\/([^\/]+)/); |
| 161 | + if (!match) { |
| 162 | + alert('Invalid GitHub URL'); |
| 163 | + return; |
| 164 | + } |
| 165 | + |
| 166 | + const [_, owner, repo] = match; |
| 167 | + const apiUrl = `https://api.github.com/repos/${owner}/${repo}/contents`; |
| 168 | + |
| 169 | + try { |
| 170 | + const response = await fetch(apiUrl); |
| 171 | + if (!response.ok) { |
| 172 | + throw new Error(`Error fetching repository contents: ${response.statusText}`); |
| 173 | + } |
| 174 | + |
| 175 | + const files = await response.json(); |
| 176 | + files.forEach(file => { |
| 177 | + const listItem = document.createElement('li'); |
| 178 | + const link = document.createElement('a'); |
| 179 | + link.href = `https://github.com/${owner}/${repo}/blob/main/${file.path}`; |
| 180 | + link.target = '_blank'; // Open link in a new tab |
| 181 | + link.textContent = file.path; |
| 182 | + listItem.appendChild(link); |
| 183 | + fileListElement.appendChild(listItem); |
| 184 | + }); |
| 185 | + } catch (error) { |
| 186 | + alert('Failed to fetch repository contents: ' + error.message); |
| 187 | + } |
| 188 | + }; |
| 189 | + |
| 190 | + document.getElementById('deployButton').onclick = function() { |
| 191 | + window.location.href = 'https://boxer.dev'; |
| 192 | + }; |
| 193 | + </script> |
| 194 | +</body> |
| 195 | +</html> |
| 196 | + |
0 commit comments