sdk-label.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <style>
  8. html,
  9. body{
  10. width: 100%;
  11. height: 100%;
  12. margin: 0;
  13. overflow: hidden;
  14. color: #fff;
  15. font-size: 14px;
  16. line-height: normal;
  17. font-family: OpenSans,sans-serif;
  18. user-select: none;
  19. }
  20. .scene{
  21. width: 100%;
  22. height: 100%;
  23. }
  24. #toolbar{
  25. position: absolute;
  26. left: 50%;
  27. top: 0;
  28. z-index: 10000;
  29. }
  30. </style>
  31. <style>
  32. .widgets-doll-labels .room-label {
  33. position: absolute;
  34. width: 0;
  35. height: 0;
  36. -webkit-transform: translateZ(0);
  37. transform: translateZ(0);
  38. -webkit-animation: room-label 0.3s ease 0.1s;
  39. animation: room-label 0.3s ease 0.1s;
  40. -webkit-animation-fill-mode: both;
  41. animation-fill-mode: both;
  42. cursor: pointer;
  43. }
  44. .widgets-doll-labels .room-label:not(.noLine):after {
  45. content: "";
  46. display: block;
  47. position: absolute;
  48. width: 4px;
  49. height: 68px;
  50. background-image: url("./images/labelline.png");
  51. background-size: contain;
  52. background-repeat: no-repeat;
  53. bottom: 0;
  54. left: 50%;
  55. -webkit-transform: translate(-50%);
  56. transform: translate(-50%);
  57. }
  58. .widgets-doll-labels .room-label a {
  59. display: block;
  60. position: absolute;
  61. line-height: 22px;
  62. top: -66px;
  63. transform: translate(-50%, -100%);
  64. text-align: center;
  65. white-space: nowrap;
  66. font-size: 12px;
  67. font-style: normal;
  68. pointer-events: auto;
  69. background-repeat: no-repeat;
  70. background-size: 100% 100%;
  71. background: rgba(210, 210, 210, 0.7);
  72. border: 1px solid rgba(255, 255, 255, 0.4);
  73. border-radius: 3px;
  74. text-shadow: 0px 1px 3px rgb(0,0, 0, 0.5);
  75. }
  76. .widgets-doll-labels .room-label a::before {
  77. content: "";
  78. position: absolute;
  79. left: -1px;
  80. top: -1px;
  81. width: 10px;
  82. height: 10px;
  83. background-image: url(./images/svg/doll_label_corner.svg);
  84. background-repeat: no-repeat;
  85. background-position: top left;
  86. }
  87. .widgets-doll-labels .room-label a::after {
  88. content: "";
  89. position: absolute;
  90. left: -1px;
  91. bottom: -1px;
  92. width: 10px;
  93. height: 10px;
  94. background-image: url(./images/svg/doll_label_corner.svg);
  95. background-repeat: no-repeat;
  96. background-position: top left;
  97. transform: rotate(270deg);
  98. }
  99. .widgets-doll-labels .room-label a > p {
  100. margin: 0;
  101. padding: 2px 10px;
  102. height: 100%;
  103. line-height: 1.5;
  104. }
  105. .widgets-doll-labels .room-label a > p::before {
  106. content: "";
  107. position: absolute;
  108. right: -1px;
  109. top: -1px;
  110. width: 10px;
  111. height: 10px;
  112. background-image: url(./images/svg/doll_label_corner.svg);
  113. background-repeat: no-repeat;
  114. background-position: top left;
  115. transform: rotate(90deg);
  116. }
  117. .widgets-doll-labels .room-label a > p::after {
  118. content: "";
  119. position: absolute;
  120. right: -1px;
  121. bottom: -1px;
  122. width: 10px;
  123. height: 10px;
  124. background-image: url(./images/svg/doll_label_corner.svg);
  125. background-repeat: no-repeat;
  126. background-position: top left;
  127. transform: rotate(180deg);
  128. }
  129. .widgets-doll-labels .room-label.noLine a {
  130. top: 16px;
  131. }
  132. .widgets-doll-labels .room-label a span {
  133. white-space: nowrap;
  134. user-select: none;
  135. }
  136. .widgets-doll-labels .room-label.with-entrance:after {
  137. display: none;
  138. }
  139. .widgets-doll-labels .room-label.with-entrance a {
  140. top: 50%;
  141. width: 38.5px;
  142. height: 15.75px;
  143. background-size: 38.5px 15.75px;
  144. -webkit-transform: translate(-50%, -50%);
  145. transform: translate(-50%, -50%);
  146. }
  147. .widgets-doll-labels .room-label.with-entrance a span {
  148. margin-left: -0.875px;
  149. margin-top: -0.875px;
  150. }
  151. .widgets-plan-labels .room-label {
  152. position: absolute;
  153. -webkit-animation: room-label 0.3s ease 0.1s;
  154. animation: room-label 0.3s ease 0.1s;
  155. -webkit-animation-fill-mode: both;
  156. animation-fill-mode: both;
  157. }
  158. .widgets-plan-labels .room-label a {
  159. display: block;
  160. position: absolute;
  161. line-height: 24px;
  162. -webkit-transform: translate(-50%);
  163. transform: translate(-50%, -50%);
  164. text-align: center;
  165. white-space: nowrap;
  166. font-size: 14px;
  167. font-style: normal;
  168. }
  169. .widgets-doors {
  170. position: absolute;
  171. pointer-events: none;
  172. top: 0;
  173. left: 0;
  174. bottom: 0;
  175. right: 0;
  176. }
  177. .widgets-doors[data-camera-toward=right] .door.show-arrow.right a:before,
  178. .widgets-doors[data-camera-toward=forward] .door.show-arrow.right a:before {
  179. margin-right: 3.5px;
  180. -webkit-transform: rotate(180deg);
  181. transform: rotate(180deg);
  182. }
  183. .widgets-doors[data-camera-toward=right] .door.show-arrow.right a:before,
  184. .widgets-doors[data-camera-toward=forward] .door.show-arrow.forward a:before,
  185. .widgets-doors[data-camera-toward=forward] .door.show-arrow.left a:after,
  186. .widgets-doors[data-camera-toward=forward] .door.show-arrow.right a:before {
  187. content: "";
  188. position: relative;
  189. display: inline-block;
  190. width: 10.5px;
  191. height: 10.5px;
  192. background: url(./images/svg/room-arrow-label.svg) no-repeat 50%;
  193. background-size: 100% 100%;
  194. vertical-align: middle;
  195. }
  196. .widgets-doors[data-camera-toward="forward"] .door.show-arrow.left a:after {
  197. margin-left: 4px;
  198. }
  199. .widgets-doors[data-camera-toward="forward"] .door.show-arrow.back a:after,
  200. .widgets-doors[data-camera-toward="right"] .door.show-arrow.left a:after {
  201. content: "";
  202. display: inline-block;
  203. vertical-align: middle;
  204. width: 10.5px;
  205. height: 10.5px;
  206. background: url(./images/svg/room-arrow-label.svg) no-repeat 50%;
  207. background-size: 100% 100%;
  208. margin-left: 4px;
  209. -webkit-transform: rotate(-90deg);
  210. transform: rotate(-90deg);
  211. }
  212. .widgets-doors[data-camera-toward=forward] .door.show-arrow.forward a:before ,
  213. .widgets-doors[data-camera-toward=right] .door.show-arrow.back a:before {
  214. margin-right: 3.5px;
  215. -webkit-transform: rotate(180deg);
  216. transform: rotate(180deg);
  217. }
  218. .widgets-doors[data-camera-toward="right"] .door.show-arrow.back a:before,
  219. .widgets-doors[data-camera-toward="right"] .door.show-arrow.forward a:after {
  220. content: "";
  221. position: relative;
  222. display: inline-block;
  223. width: 10.5px;
  224. height: 10.5px;
  225. background: url(./images/svg/room-arrow-label.svg) no-repeat 50%;
  226. background-size: 100% 100%;
  227. vertical-align: middle;
  228. }
  229. .widgets-doors[data-camera-toward="right"] .door.show-arrow.forward a:after {
  230. margin-left: 4px;
  231. }
  232. .widgets-doors[data-camera-toward="left"] .door.show-arrow.right a:after {
  233. -webkit-transform: rotate(-90deg);
  234. transform: rotate(-90deg);
  235. }
  236. .widgets-doors[data-camera-toward=back] .door.show-arrow.back a:after,
  237. .widgets-doors[data-camera-toward=left] .door.show-arrow.left a:after,
  238. .widgets-doors[data-camera-toward=left] .door.show-arrow.back a:after,
  239. .widgets-doors[data-camera-toward=left] .door.show-arrow.right a:after {
  240. content: "";
  241. display: inline-block;
  242. vertical-align: middle;
  243. width: 10.5px;
  244. height: 10.5px;
  245. background: url(./images/svg/room-arrow-label.svg) no-repeat 50%;
  246. background-size: 100% 100%;
  247. margin-left: 4px;
  248. }
  249. .widgets-doors[data-camera-toward="left"] .door.show-arrow.back a:after {
  250. position: relative;
  251. }
  252. .widgets-doors[data-camera-toward="left"] .door.show-arrow.forward a:before {
  253. position: relative;
  254. margin-right: 3.5px;
  255. -webkit-transform: rotate(180deg);
  256. transform: rotate(180deg);
  257. }
  258. .widgets-doors[data-camera-toward="back"] .door.show-arrow.forward a:after,
  259. .widgets-doors[data-camera-toward="left"] .door.show-arrow.forward a:before {
  260. content: "";
  261. display: inline-block;
  262. width: 10.5px;
  263. height: 10.5px;
  264. background: url(./images/svg/room-arrow-label.svg) no-repeat 50%;
  265. background-size: 100% 100%;
  266. vertical-align: middle;
  267. }
  268. .widgets-doors[data-camera-toward="back"] .door.show-arrow.forward a:after {
  269. margin-left: 4px;
  270. -webkit-transform: rotate(-90deg);
  271. transform: rotate(-90deg);
  272. }
  273. .widgets-doors[data-camera-toward="back"] .door.show-arrow.right a:after {
  274. margin-left: 4px;
  275. }
  276. .widgets-doors[data-camera-toward="back"] .door.show-arrow.left a:before,
  277. .widgets-doors[data-camera-toward="back"] .door.show-arrow.right a:after {
  278. content: "";
  279. position: relative;
  280. display: inline-block;
  281. width: 10.5px;
  282. height: 10.5px;
  283. background: url(./images/svg/room-arrow-label.svg) no-repeat 50%;
  284. background-size: 100% 100%;
  285. vertical-align: middle;
  286. }
  287. .widgets-doors[data-camera-toward="back"] .door.show-arrow.left a:before {
  288. margin-right: 3.5px;
  289. -webkit-transform: rotate(180deg);
  290. transform: rotate(180deg);
  291. }
  292. .widgets-doors .door {
  293. position: absolute;
  294. width: 0;
  295. height: 0;
  296. /* display: none; */
  297. -webkit-animation: viewport-door-label 0.3s ease 1s;
  298. animation: viewport-door-label 0.3s ease 1s;
  299. -webkit-animation-fill-mode: both;
  300. animation-fill-mode: both;
  301. -webkit-transform: translateZ(0);
  302. transform: translateZ(0);
  303. cursor: pointer;
  304. }
  305. .widgets-doors .door a {
  306. display: block;
  307. position: absolute;
  308. top: 50%;
  309. left: 50%;
  310. -webkit-transform: translate(-50%, -50%);
  311. transform: translate(-50%, -50%);
  312. border-radius: 1.75px;
  313. background: rgba(0, 0, 0, 0.5);
  314. line-height: 14px;
  315. padding: 8px 8px;
  316. border-radius: 4px;
  317. white-space: nowrap;
  318. font-size: 14px;
  319. font-style: normal;
  320. pointer-events: auto;
  321. -webkit-transition: background 0.3s ease, color 0.3s ease, -webkit-transform 1s ease;
  322. transition: background 0.3s ease, color 0.3s ease, -webkit-transform 1s ease;
  323. transition: transform 1s ease, background 0.3s ease, color 0.3s ease;
  324. transition: transform 1s ease, background 0.3s ease, color 0.3s ease, -webkit-transform 1s ease;
  325. }
  326. .widgets-doors .door a:after {
  327. -webkit-transition: opacity 0.3s ease;
  328. transition: opacity 0.3s ease;
  329. }
  330. .widgets-doors .door a:active {
  331. background: rgba(0, 0, 0, 0.5);
  332. color: hsla(0, 0%, 100%, 0.5);
  333. }
  334. .widgets-doors .door a:active:after {
  335. opacity: 0.5;
  336. }
  337. @-webkit-keyframes room-label {
  338. 0% {
  339. opacity: 0;
  340. margin-top: 8.75px;
  341. }
  342. to {
  343. opacity: 1;
  344. margin-top: 0;
  345. }
  346. }
  347. @keyframes room-label {
  348. 0% {
  349. opacity: 0;
  350. margin-top: 8.75px;
  351. }
  352. to {
  353. opacity: 1;
  354. margin-top: 0;
  355. }
  356. }
  357. @-webkit-keyframes door-label {
  358. 0% {
  359. opacity: 0;
  360. margin-top: 8.75px;
  361. }
  362. to {
  363. opacity: 1;
  364. margin-top: 0;
  365. }
  366. }
  367. @keyframes door-label {
  368. 0% {
  369. opacity: 0;
  370. margin-top: 8.75px;
  371. }
  372. to {
  373. opacity: 1;
  374. margin-top: 0;
  375. }
  376. }
  377. </style>
  378. </head>
  379. <body>
  380. <div id="scene" class="scene"></div>
  381. <div id="toolbar"></div>
  382. <script src="../dist/sdk/kankan-sdk-deps.js"></script>
  383. <script src="../dist/sdk/kankan-sdk.js"></script>
  384. <script>
  385. // ?data-old
  386. window.dontForbitSetsize = true
  387. var kankan = new KanKan({
  388. dom:'#scene',
  389. num:'t-jrjyXqu'
  390. })
  391. kankan.use("Controls")
  392. kankan.use("Tag").then(tour=>{
  393. })
  394. kankan.render()
  395. kankan.Scene.on('loaded',()=>{
  396. })
  397. </script>
  398. </body>
  399. </html>