chronodiagram/app/www/draw.html

217 lines
3.5 KiB
HTML
Raw Normal View History

2021-11-22 20:54:04 +01:00
<!DOCTYPE html>
<html lang="en" dir="ltr">
2021-11-23 12:17:48 +01:00
<head>
<meta charset="utf-8">
2021-11-23 12:28:40 +01:00
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' />
2021-11-23 12:17:48 +01:00
<title>Draw a line animation</title>
<style media="screen">
body{
background:black;
}
2021-11-23 12:17:48 +01:00
#sample,
svg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
font-family: sans-serif;
z-index: 2;
cursor: url('/cursor.png') 6 6, auto;
}
img {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
path {
fill: none;
stroke: auto;
2021-11-23 12:17:48 +01:00
stroke-width: 1mm;
stroke-linecap: round;
}
#wrapper {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: none;
}
.gray {
position: absolute;
background: rgba(255, 255, 255, 0.7);
}
html,
body {
height: 100%;
width: 100%;
margin: 0;
font-family: sans-serif;
/* prevent reload on scroll in chrome */
position: fixed;
2022-01-19 13:11:57 +01:00
overscroll-behavior: contain;
overflow-y: hidden;
/* prevent capture of poienter event: https://stackoverflow.com/a/48254578 */
touch-action: none;
2021-11-23 12:17:48 +01:00
}
#interface {
height: 0;
overflow: hidden;
2022-01-19 13:11:57 +01:00
/* padding-top: calc( {
2021-11-23 12:17:48 +01:00
HEIGHT
}
/ {
WIDTH
}
2022-01-19 13:11:57 +01:00
* 100%); */
2021-11-23 12:17:48 +01:00
position: relative;
margin: 0 auto;
background-size: 100% 100%;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background:white;
2021-11-23 12:17:48 +01:00
}
#info {
2021-11-22 20:54:04 +01:00
position: absolute;
bottom: 15px;
width: 600px;
left: calc(50% - 250px);
z-index: 999;
2021-11-23 12:17:48 +01:00
}
.buttons {
text-align: center;
}
#submit {
background: lightblue;
border: solid 1px blue;
border-radius: 5px;
font-size: 110%;
padding: 5px 10px;
}
.toolbox {
position: absolute;
left: 0;
2022-02-08 09:28:30 +01:00
top: 40%;
2021-11-23 12:17:48 +01:00
z-index: 100;
background-color: white;
padding: 5px;
border-radius: 0 5px 5px 0;
background-color: #ccc;
}
.toolbox>ul {
padding: 0;
margin: 0;
}
.toolbox>ul>li {
cursor: pointer;
}
.toolbox .colors>li.selected {
border-width: 3px;
border-color: gray;
}
.toolbox .colors>li {
display: block;
border: solid 3px white;
border-radius: 5px;
margin: 5px;
width: 25px;
height: 25px;
}
.filename {
position: absolute;
bottom: 0;
left: 0;
color: gray;
z-index: 1;
2021-11-23 12:17:48 +01:00
font-size: 8pt;
}
.closed {
background-color: lightgray;
}
.closed svg {
cursor: wait;
pointer-events: none;
}
.button-fullscreen{
display: block;
cursor:pointer;
position: absolute;
bottom: 50px;
left: calc(50% - 200px);
width: 400px;
border-radius: 50px;
background:black; color:white;
text-align: center;
line-height: 2;
font-size: 40px;
z-index: 10;
}
body.fullscreen .button-fullscreen{
display:none;
}
2021-11-23 12:17:48 +01:00
</style>
</head>
<body>
<div id='interface'>
</div>
<script src="draw.js"></script>
<script type='text/javascript'>
// let canvas;
// if (location.search) {
// const
// canvas = new Canvas(
// document.getElementById("interface"),
// ["map", "text", "relation", "figure"],
// location.search.substring(1)
// );
// } else{
let preload;
if (location.hash.length) {
preload = location.hash.substring(1);
} else {
preload = null
}
const canvas = new Canvas(document.getElementById("interface"), preload);
// }
2021-11-23 12:17:48 +01:00
</script>
</body>
</html>