2019-07-22 18:46:55 +08:00
|
|
|
{% extends 'page.html' %}
|
|
|
|
|
|
|
|
|
2019-08-06 00:26:17 +08:00
|
|
|
{% block maincss %}overflow-hidden{% endblock %}
|
|
|
|
|
|
|
|
|
2019-07-22 18:46:55 +08:00
|
|
|
{% block js %}
|
|
|
|
|
|
|
|
<script src="/js/models/kf25.js"></script>
|
|
|
|
<script src="/js/models/viewport.js"></script>
|
|
|
|
<script src="/js/models/multiport.js"></script>
|
|
|
|
<script src="/js/models/chamber.js"></script>
|
|
|
|
<script src="/js/models/k526s-body.js"></script>
|
|
|
|
<script src="/js/models/k526s-head.js"></script>
|
|
|
|
<script src="/js/models/k526s-fixture.js"></script>
|
|
|
|
<script src="/js/models/k526s-adapter.js"></script>
|
|
|
|
<script src="/js/models/k526s-adapter-assy.js"></script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
(function () {
|
|
|
|
|
2019-08-04 21:31:40 +08:00
|
|
|
function findBootstrapEnvironment() {
|
|
|
|
let envs = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
|
|
|
|
|
|
let el = document.createElement('div');
|
|
|
|
document.body.appendChild(el);
|
|
|
|
|
|
|
|
let curEnv = envs.shift();
|
|
|
|
|
|
|
|
for (let env of envs.reverse()) {
|
|
|
|
el.classList.add(`d-${env}-none`);
|
|
|
|
|
|
|
|
if (window.getComputedStyle(el).display === 'none') {
|
|
|
|
curEnv = env;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
document.body.removeChild(el);
|
|
|
|
return curEnv;
|
|
|
|
}
|
|
|
|
|
|
|
|
var bootstrap_env = findBootstrapEnvironment();
|
2019-08-06 00:26:17 +08:00
|
|
|
var params_chamber = (bootstrap_env === 'xs' || bootstrap_env == 'sm') ? {width: 310, height: 200, scale: 1} : {width: 800, height: 600, scale: 3};
|
|
|
|
var params_kf25 = (bootstrap_env === 'xs' || bootstrap_env == 'sm') ? {width: 310, height: 300, scale: 10, offset: new THREE.Vector3(-8, 0, 0)} : {width: 400, height: 300, scale: 10, offset: new THREE.Vector3(-8, 0, 0)};
|
|
|
|
var params_viewport = (bootstrap_env === 'xs' || bootstrap_env == 'sm') ? {width: 310, height: 300, scale: 3} : {width: 400, height: 300, scale: 3};
|
|
|
|
var params_multiport = (bootstrap_env === 'xs' || bootstrap_env == 'sm') ? {width: 310, height: 300, scale: 3} : {width: 400, height: 300, scale: 3};
|
|
|
|
var params_k526s_body = (bootstrap_env === 'xs' || bootstrap_env == 'sm') ? {width: 310, height: 300, scale: 6, offset: new THREE.Vector3(-10, -15, 0)} : {width: 400, height: 300, scale: 6, offset: new THREE.Vector3(-10, -15, 0)};
|
|
|
|
var params_k526s_head = (bootstrap_env === 'xs' || bootstrap_env == 'sm') ? {width: 310, height: 300, scale: 8, offset: new THREE.Vector3(25, 0, 0)} : {width: 400, height: 300, scale: 8, offset: new THREE.Vector3(25, 0, 0)};
|
|
|
|
var params_k526s_fixture = (bootstrap_env === 'xs' || bootstrap_env == 'sm') ? {width: 310, height: 200, scale: 6} : {width: 800, height: 400, scale: 12};
|
|
|
|
var params_k526s_adapter = (bootstrap_env === 'xs' || bootstrap_env == 'sm') ? {width: 310, height: 300, scale: 8, offset: new THREE.Vector3(-8, 0, 0)} : {width: 400, height: 300, scale: 8, offset: new THREE.Vector3(-8, 0, 0)};
|
|
|
|
var params_k526s_assy = (bootstrap_env === 'xs' || bootstrap_env == 'sm') ? {width: 310, height: 300, scale: 8} : {width: 400, height: 300, scale: 8};
|
2019-08-04 21:31:40 +08:00
|
|
|
|
2019-07-22 18:46:55 +08:00
|
|
|
var nodes = [{
|
|
|
|
id: 'kf25',
|
|
|
|
model: solvespace_model_kf25,
|
2019-08-05 01:21:00 +08:00
|
|
|
params: params_kf25,
|
2019-07-22 18:46:55 +08:00
|
|
|
}, {
|
|
|
|
id: 'viewport',
|
|
|
|
model: solvespace_model_viewport,
|
2019-08-05 01:21:00 +08:00
|
|
|
params: params_viewport,
|
2019-07-22 18:46:55 +08:00
|
|
|
}, {
|
|
|
|
id: 'multiport',
|
|
|
|
model: solvespace_model_multiport,
|
2019-08-05 01:21:00 +08:00
|
|
|
params: params_multiport,
|
2019-07-22 18:46:55 +08:00
|
|
|
}, {
|
|
|
|
id: 'chamber',
|
|
|
|
model: solvespace_model_chamber,
|
2019-08-04 21:31:40 +08:00
|
|
|
params: params_chamber,
|
2019-07-22 18:46:55 +08:00
|
|
|
}, {
|
|
|
|
id: 'k526s-body',
|
|
|
|
model: solvespace_model_k526s_body,
|
2019-08-05 01:21:00 +08:00
|
|
|
params: params_k526s_body,
|
2019-07-22 18:46:55 +08:00
|
|
|
}, {
|
|
|
|
id: 'k526s-head',
|
|
|
|
model: solvespace_model_k526s_head,
|
2019-08-05 01:21:00 +08:00
|
|
|
params: params_k526s_head,
|
2019-08-12 21:31:18 +08:00
|
|
|
}, {
|
2019-07-22 18:46:55 +08:00
|
|
|
id: 'k526s-fixture',
|
|
|
|
model: solvespace_model_k526s_fixture,
|
2019-08-04 21:31:40 +08:00
|
|
|
params: params_k526s_fixture,
|
2019-08-12 21:31:18 +08:00
|
|
|
}, {
|
2019-07-22 18:46:55 +08:00
|
|
|
id: 'k526s-adapter',
|
|
|
|
model: solvespace_model_k526s_adapter,
|
2019-08-05 01:21:00 +08:00
|
|
|
params: params_k526s_adapter,
|
2019-08-12 20:51:56 +08:00
|
|
|
}, {
|
2019-07-22 18:46:55 +08:00
|
|
|
id: 'k526s-adapter-assy',
|
|
|
|
model: solvespace_model_k526s_adapter_assy,
|
2019-08-05 01:21:00 +08:00
|
|
|
params: params_k526s_assy,
|
2019-08-12 21:31:18 +08:00
|
|
|
}];
|
2019-07-22 18:46:55 +08:00
|
|
|
|
|
|
|
for (var i = nodes.length - 1; i >= 0; i--) {
|
2019-08-12 20:51:56 +08:00
|
|
|
let n = nodes[i];
|
|
|
|
if (n.id) {
|
|
|
|
let node = document.getElementById(n.id);
|
|
|
|
node.parentNode.replaceChild(solvespace(n.model, n.params), node);
|
|
|
|
}
|
2019-07-22 18:46:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
})();
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{% endblock %}
|