A quick port of GitHub/BitBucket HTML preview for use with Codeberg. https://htmlpreview.codeberg.page/
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 

58 lines
2.5 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Codeberg HTML Preview</title>
<style>
body {
font: 12px 'Helvetica Neue', Helvetica, Arial, freesans, clean, sans-serif;
color: #333;
}
h1 {
font-size: 20px;
}
a {
color: #666;
}
#previewform {
display: none;
padding: 20px;
text-align: center;
}
strong {
color: #333;
background-color: #FAFFA6;
padding: 0.1em;
}
#footer {
margin: 20px 0;
font-size: 10px;
color: #666;
}
#warning {
background-color: #FAFFA6;
padding: 10px;
border: 1px solid green;
}
svg {
display: block;
margin: auto;
}
</style>
</head>
<body>
<form id="previewform" onsubmit="location.href='/?'+this.file.value;return false">
<h1>Codeberg HTML Preview</h1>
<p>
Enter URL of the HTML file to preview:
<input type="url" id="file" value="" placeholder="e.g. https://codeberg.org/docs/pages/raw/branch/main/index.html" size="60" autofocus>
<input type="submit" value="Preview">
</p>
<p>or prepend to the URL: <code><strong>http://htmlpreview.codeberg.page/?</strong>https://codeberg.org/docs/pages/raw/branch/main/index.html</code></p>
<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>
<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>
Warning: the files you preview are served through third-party proxy services.</p>
</form>
<script src="/htmlpreview.js"></script>
</body>
</html>