2024-03-26 23:49:45 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2024-03-27 18:16:06 +01:00
|
|
|
<script src="/static/js/FileSaver.js"></script>
|
|
|
|
<style>
|
|
|
|
#save-svg{
|
|
|
|
position: fixed;
|
|
|
|
top: 0.5em;
|
|
|
|
right: 0.5em;
|
|
|
|
}
|
2024-03-28 10:42:47 +01:00
|
|
|
.svgbob text {
|
|
|
|
font-family: monospace !important;
|
|
|
|
font-weight: bold !important;
|
|
|
|
fill: red !important;
|
|
|
|
}
|
|
|
|
.svgbob text{
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
body.check-text .svgbob text{
|
|
|
|
visibility: visible;
|
|
|
|
}
|
2024-06-09 15:33:32 +02:00
|
|
|
input, button{
|
|
|
|
font-family: monospace;
|
|
|
|
}
|
2024-03-27 18:16:06 +01:00
|
|
|
</style>
|
2024-03-26 23:49:45 +01:00
|
|
|
</head>
|
2024-03-27 18:16:06 +01:00
|
|
|
|
|
|
|
<body>
|
|
|
|
|
2024-03-26 23:49:45 +01:00
|
|
|
{{ svg|safe }}
|
2024-03-27 18:16:06 +01:00
|
|
|
|
2024-06-09 15:33:32 +02:00
|
|
|
<button id="save-svg">get SVG</button>
|
2024-03-28 10:42:47 +01:00
|
|
|
|
|
|
|
<script>
|
|
|
|
function get2bodyclass(){
|
|
|
|
const url = new URL(window.location.href);
|
2024-06-09 15:33:32 +02:00
|
|
|
let checked;
|
|
|
|
checked = url.searchParams.get("c");
|
2024-03-28 10:42:47 +01:00
|
|
|
if(checked == "false"){
|
|
|
|
document.body.classList.remove("check-text");
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
document.body.classList.add("check-text");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
get2bodyclass();
|
|
|
|
</script>
|
2024-03-27 18:16:06 +01:00
|
|
|
|
|
|
|
<script>
|
|
|
|
let save_button = document.getElementById('save-svg');
|
|
|
|
|
|
|
|
save_button.addEventListener('click', function(){
|
|
|
|
//get svg element.
|
|
|
|
let svg = document.getElementsByTagName("svg")[0];
|
|
|
|
|
|
|
|
//get svg source.
|
|
|
|
let serializer = new XMLSerializer();
|
|
|
|
let source = serializer.serializeToString(svg);
|
|
|
|
|
|
|
|
let blob = new Blob([source], {type: "text/plain;charset=utf-8"});
|
|
|
|
saveAs(blob, 'cobbled-paths.svg');
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2024-03-26 23:49:45 +01:00
|
|
|
</body>
|
|
|
|
</html>
|