forked from wakufactory/MarkDownDiagram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
214 lines (204 loc) · 3.5 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width">
<title>MarkDownDiagram</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/mdg_draw.js"></script>
<script type="text/javascript" src="js/mdg_edit.js"></script>
<link rel="stylesheet" type="text/css" href="css/mdg.css">
<style type="text/css">
html,body{
width:100%;
height:100%;
margin:0 ;
padding:0 ;
box-sizing:border-box;
overflow:hidden ;
font-family:sans-serif ;
}
#main {
display:flex ;
flex-direction: row ;
width:100% ;
height:100% ;
background-color:#222 ;
color:white;
}
#edit {
width:30% ;
height:100% ;
display:flex ;
flex-direction:column ;
}
#view {
height:100% ;
flex-grow:1;
display:flex ;
flex-direction: column ;
}
#control {
margin-left:1rem ;
}
#vbase {
height:100% ;
position:relative ;
}
#rollbase {
position:absolute ;
top:5px ;
right:5px;
bottom:5px;
left:5px;
overflow:scroll ;
}
#base {
display:block ;
font-family:sans-serif;
background-color:#eef ;
transform-origin:0 0 ;
color:black ;
}
#sbase {
flex-grow:1;
position:relative ;
}
#source {
position:absolute;
width:calc(100% - 15px) ;
height:calc(100% - 15px) ;
left:5px ;
top:5px ;
bottom:5px ;
font-size:1rem ;
font-family:monospace,sans-serif ;
}
#exp_src {
display:none ;
}
#i_fname {
width:10rem ;
}
input,button {
font-size:1rem ;
}
input[type=range] {
width:300px ;
background-color:#ccc;
}
div.resbar_h {
width:4px ;
background-color:#ccc ;
cursor:col-resize ;
user-select: none;
}
div.mdiv {
margin:5px ;
}
</style>
<style id=szoom>
#base {
transform: scale(1.0);
}
</style>
<style>
@page {
size: A4 landscape ;
margin: 0;
}
@media print {
body {
width:297mm ;
}
#main {
background-color:white ;
}
#edit {
display:none ;
}
#view {
width:100% ;
}
#control {
display:none ;
}
#rb {
display:none ;
}
#base {
width:calc(100% - 10mm) ;
margin:5mm ;
padding:0 ;
background-color:white ;
transform: scale(0.37) ;
}
}
</style>
<link rel="stylesheet" type="text/css" href="css/custom.css">
</head>
<body>
<div id=main>
<section id=edit>
<div> MarkDownDiagram v0.1</div>
<div id=sbase>
<textarea id=source>
//[name]はブロックの定義
//--- はテーブル行の区切り
//==> はブロック間のリンク
[b1] <1,1>
#block1
content
---
to-block2
==>[b2]
to-block3
==>[b3]
[b2] <11,1.5>
#block2
content
---
to-block4
==>[b4]
[b3] <11,10.5>
block3
//==>の前後のlrudは、リンクを繋ぐ位置を指定
[b4] <20.6,4>
block4
d==>u[b5]
==>[b6]
//()内はスタイルを設定するクラス名
[b5] (bd_r6 red bold) <20.5,11.5>
block5
d=(S red)=>r[b7]
l<=(l_w4)=>r[b3]
//画像使用例
[b6] (image) <31,6>

//カスタムスタイル
[b7] (custom1) <6,16>
block6
</textarea>
</div>
<div class="mdiv">
<div>filename:<input type=text id=i_fname value="sample.mdg" /></div>
<button id=b_load>LOAD</button>
<input type=file id=f_load style="display:none" />
<a href="" id=l_save target="_blank"><button id=b_save>SAVE</button></a>
</div>
</section>
<div class=resbar_h id="rb"></div>
<section id=view>
<section id=control>
zoom:<input type=range id=zoom min=25 max=200 value=100>
width:<input type=text id=size_x size=6 value=2900> height:<input type=text id=size_y size=6 value=2000>
</section>
<div id=vbase>
<div id=rollbase>
<div id=base class=mdg><svg id=mdg_svg></svg></div>
</div>
</div>
</section>
</div>
</body>
</html>