-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
164 lines (138 loc) · 5.95 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
<html>
<head>
<script src="https://cdn.plot.ly/plotly-2.27.0.min.js" charset="utf-8"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
<link rel="stylesheet" href="./style.css" />
<script src="./libs/@alfredicus/app-stress-2.js" type="module"></script>
</head>
<body>
<div class="navbar">
<span style="font-size:30px;cursor:pointer; color: white; margin-left: 5px;" onclick="openNav()"
id="mainMenu">☰</span>
<h3 style="color: white;padding-right: 20px;">Tecto Stress</h3>
<!-- <button type="button" class="btn btn-primary" data-toggle="modal" id="myBtn"
style="margin-left: 5px; margin-right: 5px;">
Help
</button> -->
</div>
<!-- See https://www.w3schools.com/howto/howto_js_sidenav.asp -->
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<div class="col-sm-6" id="gui" style="margin: 5px; opacity: 100%; min-width: 95%;"></div>
</div>
<div id="main" style="margin-top: 50px;">
<div class="container" style="width: 100%;">
<div class="row align-items-start">
<div id="console"
style="left:0%; border: 2px solid #000000; padding-bottom: 10px; border-radius: 5px;margin-top: 0px; background-color: rgb(232, 232, 232);">
<p id="info"></p>
</div>
<div>
<center>
<div id="isoDiv" style="margin-top: 5px;">
</div>
<div id="domainDiv" style="margin-top: 5px;">
</div>
<div id="domainsDiv" style="margin-top: 5px;">
</div>
<div id="domain3DDiv" style="margin-top: 5px;">
</div>
<div id="histogramDiv" style="margin-top: 5px;">
</div>
<div id="scatterDiv" style="margin-top: 5px;">
</div>
</center>
</div>
</div>
</div>
<footer class="panel panel-default" id="logs" style="visibility: hidden">
<p>Logs...</p>
</footer>
</div>
<a href="http://youwol.com" target="_blank">
<img src="./media/youwol.png" width="150px" alt="http://www.youwol.com/"
style="position: fixed; right: 10px;bottom: 100px; opacity: 100%;" />
</a>
<a href="http://www.gm.univ-montp2.fr" target="_blank">
<img src="./media/geosciences.png" width="150px" alt="http://www.gm.univ-montp2.fr/"
style="position: fixed; right: 10px;bottom: 30px; opacity: 100%;" />
</a>
<input id="upload" multiple type="file" style="visibility: hidden" />
<script>
let oldConsole = undefined
function openNav() {
const w = 300
document.getElementById("mySidenav").style.width = `${w}px`
document.getElementById("main").style.marginLeft = `${w}px`
document.getElementById("mainMenu").style.opacity = 0
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0px"
document.getElementById("main").style.marginLeft = "0px"
document.getElementById("mainMenu").style.opacity = 1
}
function setupHelp() {
// Get the modal
var modal = document.getElementById("myModal");
// Get the button that opens the modal
var btn = document.getElementById("myBtn");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on the button, open the modal
btn.onclick = function () {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
span.onclick = function () {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function (event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
}
function redirectConsole() {
if (!console) {
console = {}
}
oldConsole = console.log
const logger = document.getElementById('logs')
console.log = (message) => {
if (typeof message == 'object') {
logger.innerHTML = (JSON && JSON.stringify ? JSON.stringify(message) : String(message)) + '<br />'
} else {
logger.innerHTML = message + '<br />'
}
}
}
function setupKeys() {
// ESC key for the navbar
$(document).keyup(e => {
if (e.keyCode === 27) {
const w = document.getElementById("mySidenav").style.width
if (w === '0px') {
openNav()
}
else {
closeNav()
}
}
})
}
</script>
<script type="module">
const gui = window['@alfredicus/app-stress-2']
// setupHelp()
setupKeys()
openNav()
gui.createGUI('gui')
</script>
</body>
</html>