-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
164 lines (155 loc) · 13 KB
/
index.html
File metadata and controls
164 lines (155 loc) · 13 KB
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
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Dependencies -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css">
<link rel="stylesheet" href="https://maxst.icons8.com/vue-static/landings/line-awesome/line-awesome/1.3.0/css/line-awesome.min.css">
<link rel="icon" href="./favicon.ico"/>
<!-- WhiteboardJS -->
<style>
#app .wbjs-content{min-width:100%;min-height:100%;touch-action:none}.wbjs-el:hover{outline:1px solid #f0f8ff;-webkit-box-shadow:0 0 5px 0 rgba(0,120,250,.75);-moz-box-shadow:0 0 5px 0 rgba(0,120,250,.75);box-shadow:0 0 5px 0 rgba(0,120,250,.75)}.wbjs-el div.drg-btn{opacity:0;cursor:move;left:-300000px;-webkit-transition:opacity .3s linear;transition:opacity .3s linear}.wbjs-el:hover div.drg-btn{opacity:1;left:-30px}#toolbar{top:15vh;left:3vh;z-index:1000}#move-toolbar{cursor:move}@media(pointer:coarse){.wbjs-el div.drg-btn{opacity:1;left:-30px}.wbjs-el div.drg-btn i{font-size:1.4em}#toolbar .btn{min-width:44px;min-height:44px}}@media print{#toolbar,.modal,.drg-btn{display:none!important}#app .wbjs-content{position:static!important}}
</style>
<title>WhiteboardJS - The tiny web Whiteboard</title>
</head>
<body id="app">
<main role="main">
<header>
<div class="bg-dark collapse" id="navbarHeader">
<div class="container">
<div class="row">
<div class="col-sm-8 col-md-7 py-4">
<h4 class="text-white">About</h4>
<p class="text-muted">WhiteBoardJS is a tiny, user-friendly, powerfull web whitboard. Powered by jQuery, Bootstrap, Line Awesome, TinyMCE and more coming soon !</p>
</div>
<div class="col-sm-4 offset-md-1 py-4">
<h4 class="text-white">Links</h4>
<ul class="list-unstyled">
<li><a href="https://github.com/ionutfinta/WhiteboardJS/" class="text-white">See on Github</a></li>
<li><a href="mailto:contact@itized.com" class="text-white">Email me</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="navbar navbar-dark bg-dark shadow-sm">
<div class="container d-flex justify-content-between">
<a href="#" class="navbar-brand d-flex align-items-center">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true" class="mr-2" viewBox="0 0 24 24" focusable="false"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"></path><circle cx="12" cy="13" r="4"></circle></svg>
<strong>WhiteboardJS</strong>
</a>
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
</header>
<section class="jumbotron text-center m-5">
<div class="container">
<h1 class="jumbotron-heading">WhiteBoardJS</h1>
<p class="lead text-muted">WhiteBoardJS is a tiny, user-friendly, powerfull web whitboard. It can be very usefull !</p>
<p>
<a href="https://github.com/ionutfinta/WhiteboardJS/" class="btn btn-primary my-2">See on Github</a>
<a href="#" id="gotoDemo" class="btn btn-secondary my-2" data-toggle="modal" data-target="#welcomeModal">Live Demo</a>
</p>
</div>
</section>
</main>
<!-- Unlimited Board -->
<div class="bg-light position-absolute wbjs-content"></div>
<!-- User Interface -->
<div class="position-absolute d-print-none" id="toolbar">
<!-- Toolbar -->
<div class="card text-white bg-dark" style="width: 4rem;">
<div class="card-header p-0">
<i class="position-absolute p-2 las la-arrows-alt" id="move-toolbar"></i>
<button type="button" class="btn btn-dark float-right" data-toggle="collapse" data-target="#tools-colapsable" aria-expanded="false" aria-controls="tools-colapsable">
<i class="las la-chevron-down"></i>
</button>
</div>
<div class="card-body p-0 collapse show" id="tools-colapsable">
<div class="btn-group-vertical btn-group-toggle" data-toggle="buttons">
<label class="btn btn-dark active" data-toggle="tooltip" data-placement="right" title="Pointeur, Déplaceur, Sélecteur">
<input type="radio" name="toolRadio" id="mouseTool" autocomplete="off" checked> <i class="las la-mouse-pointer"></i>
</label>
<label class="btn btn-dark">
<input type="radio" name="toolRadio" id="textTool" autocomplete="off"><i class="las la-font"></i>
</label>
<label class="btn btn-dark">
<input type="radio" name="toolRadio" id="rectTool" autocomplete="off"><i class="las la-vector-square"></i>
</label>
<label class="btn btn-dark">
<input type="radio" name="toolRadio" id="circleTool" autocomplete="off"><i class="las la-circle"></i>
</label>
<label class="btn btn-dark disabled">
<input type="radio" name="toolRadio" id="mathsTool" autocomplete="off"><i class="las la-square-root-alt"></i>
</label>
<label class="btn btn-dark disabled">
<input type="radio" name="toolRadio" id="codeTool" autocomplete="off"><i class="las la-code"></i>
</label>
<label class="btn btn-dark disabled">
<input type="radio" name="toolRadio" id="girdTool" autocomplete="off"><i class="las la-th"></i>
</label>
<label class="btn btn-dark disabled">
<input type="radio" name="toolRadio" id="penTool" autocomplete="off"><i class="las la-pen"></i>
</label>
<label class="btn btn-dark disabled">
<input type="radio" name="toolRadio" id="helpTool" autocomplete="off"><i class="las la-question-circle"></i>
</label>
</div>
<!-- Menu -->
<div class="dropdown">
<button class="btn btn-dark btn-sm dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="las la-bars"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item disabled" href="#" aria-disabled="true">Export html</a>
<a class="dropdown-item disabled" href="#" aria-disabled="true">Import html</a>
</div>
</div>
</div>
</div>
</div>
<!-- Welcome Window -->
<div class="modal fade" id="welcomeModal" tabindex="-1" role="dialog" aria-labelledby="welcomeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"> Welcome to WhiteboardJS ! </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
WhiteboardJS is a tiny powerfull whiteboard that you can use everywhere !<br />
Close this message and get impressed !
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- jQuery, Popper.js, Bootstrap JS, jQuery-ui, TinyMCE (CDN for portability) -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.touchpunch/0.2.3/jquery.ui.touch-punch.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/jquery.tinymce.min.js"></script>
<!-- Whiteboard JS -->
<script>
function getEventCoords(e){if(e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length)return{pageX:e.originalEvent.touches[0].pageX,pageY:e.originalEvent.touches[0].pageY};return{pageX:e.pageX,pageY:e.pageY}}function parseCssPx(v){var n=parseInt(v,10);return isNaN(n)?0:n}var elID=tool=0,appSelector="#app",contentSelector=appSelector+" .wbjs-content";$(function(){$(appSelector).addClass("vw-100").addClass("vh-100").addClass("overflow-hidden"),$("input[name='toolRadio']").change(function(){switch($(this).attr("id")){case"mouseTool":tool=0,$(contentSelector).css({cursor:"grab"});break;case"textTool":tool=1,$(contentSelector).css("cursor","text");break;case"rectTool":tool=2,$(contentSelector).css("cursor","crosshair");break;case"circleTool":tool=3,$(contentSelector).css("cursor","crosshair")}$(appSelector).css({cursor:"text"})}),$("#welcomeModal.modal").modal().show(),$("#toolbar").draggable({handle:"#move-toolbar",containment:appSelector,scroll:!1}),$(contentSelector).draggable({start:function(){$(this).css("cursor","grabbing")},stop:function(){var t=parseCssPx($(this).css("top")),s=parseCssPx($(this).css("left"));(t>0||s>0)&&($(this).children().css({top:"+="+t,left:"+="+s}),$(this).css({width:"+="+s,height:"+="+t,top:"0",left:"0"}));var e=$(appSelector).height()-t-$(this).height();t<0&&e>0&&$(this).css({height:"+="+e});var l=$(appSelector).width()-s-$(this).width();s<0&&l>0&&$(this).css({width:"+="+l}),$(this).css("cursor","grab")},cancel:contentSelector+" *",scroll:!1});document.querySelector(contentSelector).addEventListener("touchmove",function(e){if(tool!==0)e.preventDefault()},{passive:!1});var ignoreNextClick=!1;function addElement(t){var c=getEventCoords(t),cT=Math.abs(parseCssPx($(contentSelector).css("top"))),cL=Math.abs(parseCssPx($(contentSelector).css("left")));switch(tool){case 1:var s=$(contentSelector).append('<div class="wbjs-el"><div class="btn btn-link position-absolute drg-btn"><i class="las la-arrows-alt"></i></div><p class="p-2 m-0" id="wbjs-el-'+elID+'"></p></div>').children(":last-child");s.children("p").tinymce({menubar:!1,inline:!0,plugins:["link","textcolor","contextmenu","autolink"],toolbar:["bold italic underline | fontsizeselect | forecolor backcolor"],auto_focus:"wbjs-el-"+elID}),s.css({position:"absolute",top:cT+c.pageY,left:cL+c.pageX,"min-width":"62px","min-height":"24px"}),$("#mouseTool").trigger("click"),s.draggable({handle:"div.btn",scroll:!1}),elID++;break;case 2:var s=$(contentSelector).append('<div class="wbjs-el" id="wbjs-el-'+elID+'"><div class="btn btn-link position-absolute drg-btn"><i class="las la-arrows-alt"></i></div></div>').children(":last-child");s.css({position:"absolute",top:cT+c.pageY,left:cL+c.pageX,border:"1px solid black",width:"64px",height:"64px"}),$("#mouseTool").trigger("click"),s.draggable({scroll:!1}),s.resizable(),elID++;break;case 3:var s=$(contentSelector).append('<div class="wbjs-el" id="wbjs-el-'+elID+'"><div class="btn btn-link position-absolute drg-btn"><i class="las la-arrows-alt"></i></div></div>').children(":last-child");s.css({position:"absolute",top:cT+c.pageY,left:cL+c.pageX,border:"1px solid black","border-radius":"100%",width:"64px",height:"64px"}),$("#mouseTool").trigger("click"),s.draggable({scroll:!1}),s.resizable(),elID++}}$(contentSelector).on("click",function(e){if(ignoreNextClick){ignoreNextClick=!1;return}addElement(e)});var touchMoved=!1;$(contentSelector).on("touchstart",function(){touchMoved=!1}).on("touchmove",function(){touchMoved=!0}).on("touchend",function(e){if(!touchMoved&&tool!==0){var ct=e.originalEvent&&e.originalEvent.changedTouches;if(ct&&ct.length>0){addElement({pageX:ct[0].pageX,pageY:ct[0].pageY});ignoreNextClick=!0}}});
$("#app > *:not(main)").css('z-index', '-500');
$("#gotoDemo").click(function(){
$("#app > *").css('z-index', '500');
$("main").hide();
});
});
</script>
</body>
</html>