-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.html
124 lines (105 loc) · 2.97 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>bpmn-js-sketchy demo</title>
<!-- sketchy font -->
<link rel="preload" href="FG_Virgil.ttf" as="font" type="font/ttf" crossorigin>
<!-- required modeler styles -->
<link rel="stylesheet" href="https://unpkg.com/bpmn-js/dist/assets/diagram-js.css">
<link rel="stylesheet" href="https://unpkg.com/bpmn-js/dist/assets/bpmn-js.css">
<link rel="stylesheet" href="https://unpkg.com/bpmn-js/dist/assets/bpmn-font/css/bpmn.css">
<!-- example styles -->
<style>
/* http://www.eaglefonts.com/fg-virgil-ttf-131249.htm */
@font-face {
font-family: "Virgil";
src: url("FG_Virgil.ttf");
font-display: swap;
}
html, body, #canvas {
height: 100%;
padding: 0;
margin: 0;
}
.buttons {
position: fixed;
bottom: 20px;
left: 50%;
transform: translate(-50%, 0)
}
.notification {
position: fixed;
top: 20px;
left: 50%;
transform: translate(-50%, 0);
font: .9em sans-serif;
background: #BBDEFB;
border: solid 1px #64B5F6;
border-radius: 3px;
padding: 10px 13px;
}
button {
background: #FAFAFA;
border: solid 1px #CCC;
border-radius: 3px;
padding: 7px 10px;
}
button:hover {
border-color: #AAA;
background: #E9E9E9;
}
button + button {
margin-left: 10px;
}
.drop-overlay {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
padding: 20px;
background: rgba(0,0,0, .3);
z-index: 500;
text-align: left;
}
.drop-overlay .label {
color: #ededed;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font: bold 2em sans-serif ;
}
.drop-overlay .box {
border: dashed 5px #ededed;
position: absolute;
left: 50%;
top: 50%;
width: 90%;
height: 90%;
transform: translate(-50%, -50%);
border-radius: 20px;
}
</style>
</head>
<body>
<div id="canvas"></div>
<div class="buttons">
<button id="download-bpmn">Save BPMN</button>
<button id="download-svg">Save as SVG</button>
</div>
<div class="notification">
<strong>Hint: </strong> Drop your own diagram to sketchify it!
</div>
<!-- viewer distro -->
<script src="https://unpkg.com/bpmn-js/dist/bpmn-modeler.production.min.js"></script>
<!-- sketchy distro -->
<script src="https://unpkg.com/bpmn-js-sketchy/dist/index.umd.js"></script>
<!-- app misc -->
<script src="https://unpkg.com/downloadjs@1.4.7/download.js"></script>
<script src="https://unpkg.com/file-drops@0.4.0/dist/file-drops.umd.js"></script>
<!-- demo script -->
<script src="index.js"></script>
</body>
</html>