-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
179 lines (150 loc) · 4.66 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
<html>
<head>
<link rel="stylesheet" href="assets/font-awesome/css/font-awesome.css">
<style>
body {
height: 100%;
margin: 0;
overflow-y: hidden;
}
#tabs-div {
margin: auto;
margin-top: 1%;
margin-bottom: 2%;
width: 100%;
height: 5%;
}
.tabBtns {
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 1% 3%;
font-family: Arial;
font-size: 16px;
font-weight: bold;
background-color: #e8e8e8;
color: #636363;
width: 20%;
}
button:hover {
background-color: #d1d1d1 !important;
}
#iframe-container {
width: 100%;
height: 95%;
display: flex;
flex-direction: column;
}
iframe {
width: 100%;
height: 100%;
border: none;
}
#iframe-div {
width: 100%;
height: 90%;
border: none;
}
#description-div {
height: 10%;
padding: 1%;
padding-top: 0;
}
p {
font-size: 16px;
font-family: sans-serif;
}
</style>
</head>
<body>
<div id='tabs-div'>
<button class='tabBtns' id="default-btn" onclick='openTab(event, "CCS130A")'>CCS130A</button>
<button class='tabBtns' onclick='openTab(event, "SpRln07c1")'>SpRln07c1</button>
<button class='tabBtns' onclick='openTab(event, "CCS134A")'>CCS134A</button>
<button class='tabBtns' onclick='openTab(event, "BSK06")'>BSK06</button>
<button class='tabBtns' onclick='openTab(event, "CCL01A")'>CCL01A</button>
</div>
<div id='iframe-container'>
<div id='iframe-div'>
</div>
<div id='description-div'>
</div>
</div>
<script>
const coreArray = [
{'assetName': 'CCS130A',
'src': 'coreassets/ccs130a.html',
'description': 'Core with no measurements or annotations.',
},
{'assetName': 'SpRln07c1',
'src': 'coreassets/sprln07c1.html',
'description': 'Core measured forward annually.',
},
{'assetName': 'CCS134A',
'src': 'coreassets/ccs134a.html',
'description': 'Core measured backwards annually.',
},
{'assetName': 'BSK06',
'src': 'coreassets/bsk06.html',
'description': 'Core measure forward subannually.',
},
{'assetName': 'CCL01A',
'src': 'coreassets/ccl01a.html',
'description': 'Core measured backwards subannually.',
},
];
function openTab (e, assetName) {
// reset color of all tabs
var tabClass = document.getElementsByClassName('tabBtns');
let i = 0;
for (i; i < tabClass.length; i++) {
tabClass[i].style.backgroundColor = '#e8e8e8';
};
// change tab color to show it was selected
e.currentTarget.style.backgroundColor = '#d1d1d1';
var iframeDiv = document.getElementById('iframe-div');
var descriptionDiv = document.getElementById('description-div');
// reset iframe & description
iframeDiv.innerHTML = '';
descriptionDiv.innerHTML = '';
// find clicked core to
for (let core of coreArray) {
if (core.assetName == assetName) {
var newiFrame = document.createElement('iframe');
newiFrame.src = core.src;
iframeDiv.appendChild(newiFrame);
var newDescription = document.createElement('p');
newDescription.innerHTML = core.description;
descriptionDiv.appendChild(newDescription);
return;
};
};
};
</script>
<script id='instructions-script'>
function resetBoxes(measurementBoxes) {
if (measurementBoxes) {
var checkboxes = document.getElementsByClassName('measurement-checkbox');
} else {
var checkboxes = document.getElementsByTagName('input');
};
for (let i = 0; i < checkboxes.length; i++) {
checkboxes[i].checked = false;
};
};
function openInstructions() {
var instructionsDiv = document.getElementById('instructions').outerHTML;
var newWindow = window.open('', '', 'width=600, height=600');
var stylesheet = document.getElementById('instructions-style').outerHTML;
var script = document.getElementById('instructions-script').outerHTML;
newWindow.document.open();
newWindow.document.write(stylesheet);
newWindow.document.write('<link rel="stylesheet" href="assets/font-awesome/css/font-awesome.css">');
newWindow.document.write(instructionsDiv);
newWindow.document.write(script);
};
document.getElementById('default-btn').click();
</script>
</body>
</html>