A quick port of GitHub/BitBucket HTML preview for use with Codeberg. https://htmlpreview.codeberg.eu/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

59 lines
2.6 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Codeberg HTML Preview</title>
  6. <style>
  7. body {
  8. font: 12px 'Helvetica Neue', Helvetica, Arial, freesans, clean, sans-serif;
  9. color: #333;
  10. }
  11. h1 {
  12. font-size: 20px;
  13. }
  14. a {
  15. color: #666;
  16. }
  17. #previewform {
  18. display: none;
  19. padding: 20px;
  20. text-align: center;
  21. }
  22. strong {
  23. color: #333;
  24. background-color: #FAFFA6;
  25. padding: 0.1em;
  26. }
  27. #footer {
  28. margin: 20px 0;
  29. font-size: 10px;
  30. color: #666;
  31. }
  32. #warning {
  33. background-color: #FAFFA6;
  34. padding: 10px;
  35. border: 1px solid green;
  36. }
  37. svg {
  38. display: block;
  39. margin: auto;
  40. }
  41. </style>
  42. </head>
  43. <body>
  44. <form id="previewform" onsubmit="location.href='/?'+this.file.value;return false">
  45. <h1>Codeberg HTML Preview</h1>
  46. <p>
  47. Enter URL of the HTML file to preview:
  48. <input type="url" id="file" value="" placeholder="e.g. https://codeberg.org/docs/pages/raw/branch/main/index.html" size="60" autofocus>
  49. <input type="submit" value="Preview">
  50. </p>
  51. <p>or prepend to the URL: <code><strong>http://htmlpreview.codeberg.eu/?</strong>https://codeberg.org/docs/pages/raw/branch/main/index.html</code></p>
  52. <p id="footer">Forked on <a href="https://codeberg.org/htmlpreview/pages">Codeberg</a> | Developed by <a href="https://github.com/niutech">niu tech</a> | Contribute on <a href="https://github.com/htmlpreview/htmlpreview.github.com">GitHub</a></p>
  53. <p id="warning"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 117.828 103.684" width="20px" height="20px"><path xlink:href="#path3422" d="M58.13.298c-1.88.29-3.533 1.402-4.48 3.048L1.016 94.534c-1.1 1.914-1.118 4.303 0 6.23a6.3 6.3 0 0 0 5.448 3.142h105.27c2.25.002 4.33-1.21 5.45-3.142a6.25 6.25 0 0 0 0-6.229L64.547 3.346a6.29 6.29 0 0 0-6.42-3.05z" fill="#fdee1c"/><g fill="#010101"><path d="M58.61 2.878c-1.018.158-1.885.77-2.375 1.625l-53 91.812c-.58 1.01-.582 2.308 0 3.312.592 1.02 1.685 1.688 2.875 1.688h106c1.19 0 2.283-.668 2.875-1.688.582-1.006.58-2.303 0-3.312l-53-91.812c-.7-1.18-2-1.84-3.4-1.62zm.5 10.56l45 79.25H14.05l45.06-79.25z"/><g stroke="#010101"><path d="M62.63 82.983a4.72 4.72 0 1 1-9.443 0 4.72 4.72 0 1 1 9.443.002z" stroke-width="1.657"/><path d="M56.102 39.1h3.725c1.892 0 3.412 2.302 3.412 5.16l-1.592 23.657c0 2.86-1.522 5.162-3.412 5.162h-.54c-1.892 0-3.413-2.303-3.413-5.162L52.7 44.25c-.004-2.863 1.52-5.166 3.4-5.166z" stroke-width="1.573"/></g></g></svg>
  54. Warning: the files you preview are served through third-party proxy services <a href="https://jsonp.afeld.me/">JSONProxy</a> and <a href="https://cors-anywhere.herokuapp.com/">CORS Anywhere</a></p>
  55. </form>
  56. <script src="/htmlpreview.js"></script>
  57. </body>
  58. </html>