This repository has been archived by the owner on Jan 22, 2022. It is now read-only.
forked from Autodesk/3DViewerComponent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
three-d-viewer.html
129 lines (104 loc) · 2.75 KB
/
three-d-viewer.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
<dom-module id="three-d-viewer">
<template>
<style>
:host {
display: block;
width: 100%;
height: 100%;
}
.three-d-viewer-wrapper {
position: relative;
height: 100%;
width: 100%;
}
.three-d-viewer-wrapper:before {
content: "";
display: block;
}
.viewer-anchor {
position: relative;
display: inline-block;
height: 100%;
width: 100%;
}
.arrow-left {
font-size: 25px;
position: absolute;
top: 45%;
left: 4%;
cursor: pointer;
transform:rotate(135deg);
-webkit-transform:rotate(135deg);
}
.arrow-right {
font-size: 25px;
position: absolute;
top: 45%;
right: 4%;
cursor: pointer;
transform:rotate(-45deg);
-webkit-transform:rotate(-45deg);
}
.viewer {
height: 100%;
width: 99%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 1px solid #e0e0e0;
overflow: hidden;
}
.img-box-rel-size {
width: 100%;
height: 100%;
}
[class^=arrow-]{
z-index: 2;
border: solid #222;
border-width: 0 .2em .2em 0;
display: inline-block;
padding: .20em;
}
.loader {
width: 100%;
height: 100%;
position: absolute;
top: 44%;
left: 0;
font-size: 20px;
text-align: center;
z-index: 3;
}
.loader.error {
z-index: 1;
}
</style>
<div class="viewer-anchor">
<!--<template is="dom-repeat" items="{{previews}}">-->
<!--<template is="dom-if" >-->
<div class="img-box-rel-size">
<div class="three-d-viewer-wrapper">
<div class="viewer" id="three-d-viewer"></div>
</div>
</div>
<!--</template>-->
<!--</template>-->
<template is="dom-if" if="{{showViewerArrows(previews)}}">
<div class="arrow-left" on-click="showPreviousPreview"></div>
<div class="arrow-right" on-click="showNextPreview"></div>
</template>
<template is="dom-if" if="{{!isThreeDViewerReady}}">
<div class$="loader {{computeErrorClass(loadingMessage)}}">[[loadingMessage]]</div>
</template>
</div>
</template>
<link rel="import" href="../../polymer/polymer.html">
<script src="js/viewer.js"></script>
<script src="js/three.min.js"></script>
<script src="js/OBJLoader.js"></script>
<script src="js/STLLoader.js"></script>
<script src="js/OrbitControls.js"></script>
<script src="three-d-viewer-es5.js"></script>
</dom-module>