navbar.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <style>
  2. nav-bar {
  3. position: absolute;
  4. height: 48px;
  5. width: 100%;
  6. bottom: 10px;
  7. display: flex;
  8. justify-content: center;
  9. }
  10. nav-bar .nav-container {
  11. display: flex;
  12. flex-direction: row;
  13. margin: 0 10px;
  14. height: 100%;
  15. width: 100%;
  16. justify-content: center;
  17. }
  18. nav-bar .animation-control {
  19. background-color: rgba(91, 93, 107, .75);
  20. display: flex;
  21. flex-direction: row;
  22. height: 100%;
  23. width: 100%;
  24. max-width: 1280px;
  25. justify-content: center;
  26. }
  27. nav-bar .flex-container {
  28. display: flex;
  29. flex-direction: row;
  30. justify-content: center;
  31. height: 100%;
  32. width: 100%;
  33. }
  34. nav-bar button {
  35. background: none;
  36. border: none;
  37. color: white;
  38. margin: 0;
  39. padding: 0;
  40. height: 100%;
  41. min-width: 48px;
  42. cursor: pointer;
  43. }
  44. nav-bar button:hover,
  45. nav-bar button:active,
  46. nav-bar button:focus {
  47. background: none;
  48. border: none;
  49. outline: none;
  50. }
  51. nav-bar button:hover {
  52. background-color: rgba(22, 24, 26, .20);
  53. }
  54. nav-bar .control-text {
  55. font-family: "Segoe UI";
  56. font-size: 12px;
  57. font-weight: 400;
  58. pointer-events: none;
  59. }
  60. nav-bar img,
  61. nav-bar .icon {
  62. pointer-events: none;
  63. }
  64. .logo-button {
  65. display: flex;
  66. align-items: center;
  67. flex-direction: row;
  68. justify-content: center;
  69. background-color: rgba(91, 93, 107, .75);
  70. height: 48px;
  71. min-width: 48px;
  72. margin-right: 4px;
  73. }
  74. .logo-button img {
  75. height: 20px;
  76. width: 20px;
  77. }
  78. .types {
  79. display: flex;
  80. flex-direction: column;
  81. width: 48px;
  82. }
  83. .types .flex-container,
  84. .speed .flex-container {
  85. align-items: center;
  86. }
  87. .menu-options {
  88. position: absolute;
  89. bottom: 48px;
  90. width: 48px;
  91. background-color: rgba(22, 24, 26, .90);
  92. }
  93. .logo-button,
  94. .animation-label,
  95. .types-icon,
  96. .help,
  97. .speed {
  98. display: none;
  99. }
  100. .types-icon:after {
  101. font-size: 16px;
  102. content: "\F6BE";
  103. }
  104. .up-icon:after {
  105. line-height: 16px;
  106. font-size: 12px;
  107. content: "\E70E";
  108. }
  109. .play-icon:after {
  110. font-size: 16px;
  111. content: "\E768";
  112. }
  113. .pause-icon:after {
  114. font-size: 16px;
  115. content: "\E769";
  116. }
  117. .fullscreen-icon:after {
  118. font-size: 16px;
  119. content: "\E740";
  120. }
  121. .help-icon:after {
  122. font-size: 16px;
  123. content: "\EF4E";
  124. }
  125. .progress-control {
  126. display: flex;
  127. flex: 1;
  128. position: relative;
  129. overflow: hidden;
  130. cursor: pointer;
  131. align-items: center;
  132. }
  133. .animation-number {
  134. margin: 0 6px;
  135. }
  136. .speed-text {
  137. margin-right: 6px;
  138. }
  139. .progress-circle {
  140. width: 12px;
  141. height: 12px;
  142. border: 2px solid rgb(255, 255, 255);
  143. border-radius: 50%;
  144. background-color: rgb(91, 93, 107);
  145. cursor: pointer;
  146. position: relative;
  147. bottom: 10px;
  148. pointer-events: none;
  149. }
  150. .default-control {
  151. display: flex;
  152. flex-direction: row;
  153. height: 100%;
  154. background-color: rgba(91, 93, 107, .75);
  155. }
  156. .menu-options button {
  157. width: 100%;
  158. height: 48px;
  159. color: rgb(142, 147, 155);
  160. }
  161. .menu-options button {
  162. width: 100%;
  163. height: 48px;
  164. color: rgb(142, 147, 155);
  165. }
  166. .menu-options button:hover {
  167. background-color: transparent;
  168. color: rgb(255, 255, 255);
  169. }
  170. .menu-options .animation-number {
  171. margin: 0 18px 0 6px;
  172. }
  173. .menu-options .speed-text {
  174. margin-right: 18px;
  175. }
  176. .menu-options {
  177. visibility: hidden;
  178. }
  179. .open .menu-options {
  180. visibility: visible;
  181. }
  182. .types .menu-options {
  183. width: 144px;
  184. }
  185. .types .menu-options button {
  186. padding: 0 8px;
  187. justify-content: left;
  188. }
  189. .types .menu-options button>* {
  190. display: flex;
  191. margin: 8px;
  192. }
  193. .types .menu-options button span.animation-number {
  194. display: none;
  195. }
  196. /* Disable fullscreen button for small screens */
  197. .fullscreen {
  198. display: none;
  199. }
  200. @media screen and (min-width: 540px) {
  201. .help,
  202. .types-icon,
  203. .speed {
  204. display: inline-block;
  205. }
  206. .logo-button {
  207. display: flex;
  208. }
  209. .types {
  210. width: 84px;
  211. }
  212. .progress-bar-container {
  213. margin: 0 12px;
  214. }
  215. .speed {
  216. width: 64px;
  217. }
  218. .speed .menu-options {
  219. width: 64px;
  220. }
  221. .fullscreen {
  222. display: block;
  223. }
  224. }
  225. @media screen and (min-width: 1024px) {
  226. .animation-label {
  227. display: block;
  228. margin-left: 6px;
  229. text-overflow: ellipsis;
  230. overflow: hidden;
  231. }
  232. nav-bar button.animation-buttons {
  233. padding: 0 8px;
  234. justify-content: left;
  235. }
  236. .icon.up-icon {
  237. margin-left: 8px;
  238. }
  239. nav-bar button.animation-buttons>div {
  240. display: flex;
  241. pointer-events: none;
  242. }
  243. .animation-number {
  244. display: none;
  245. }
  246. .progress-bar-container {
  247. margin: 0 12px;
  248. }
  249. .types {
  250. width: 144px;
  251. }
  252. }
  253. .progress-wrapper {
  254. -webkit-appearance: none;
  255. cursor: pointer;
  256. width: 100%;
  257. outline: none;
  258. margin: 0 12px;
  259. height: 30px;
  260. background-color: transparent;
  261. }
  262. /*Chrome -webkit */
  263. .progress-wrapper::-webkit-slider-thumb {
  264. -webkit-appearance: none;
  265. width: 20px;
  266. height: 20px;
  267. border: 2px solid white;
  268. border-radius: 50%;
  269. background: rgba(91, 93, 107, 1);
  270. margin-top: -10px;
  271. }
  272. .progress-wrapper::-webkit-slider-runnable-track {
  273. height: 2px;
  274. -webkit-appearance: none;
  275. background-color: white;
  276. }
  277. /** FireFox -moz */
  278. .progress-wrapper::-moz-range-progress {
  279. background-color: white;
  280. height: 2px;
  281. }
  282. .progress-wrapper::-moz-range-thumb {
  283. width: 20px;
  284. height: 20px;
  285. border: 2px solid white;
  286. border-radius: 50%;
  287. background: rgba(91, 93, 107, 1);
  288. }
  289. .progress-wrapper::-moz-range-track {
  290. background: white;
  291. height: 2px;
  292. }
  293. /** IE -ms */
  294. .progress-wrapper::-ms-track {
  295. height: 2px;
  296. /*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
  297. background: transparent;
  298. /*leave room for the larger thumb to overflow with a transparent border */
  299. border-color: transparent;
  300. border-width: 10px 0;
  301. /*remove default tick marks*/
  302. color: transparent;
  303. }
  304. .progress-wrapper::-ms-fill-lower {
  305. background: white;
  306. border-radius: 5px;
  307. }
  308. .progress-wrapper::-ms-fill-upper {
  309. background: white;
  310. border-radius: 5px;
  311. }
  312. .progress-wrapper::-ms-thumb {
  313. width: 16px;
  314. height: 16px;
  315. border: 2px solid white;
  316. border-radius: 50%;
  317. background: rgba(91, 93, 107, 1);
  318. margin-top: 0px;
  319. }
  320. span {
  321. display: inline-block;
  322. }
  323. </style>
  324. {{#if (or (not animations) hideAnimations)}} {{#if hideLogo}}
  325. <style>
  326. nav-bar .nav-container {
  327. justify-content: flex-end;
  328. }
  329. </style>
  330. {{else}}
  331. <style>
  332. nav-bar .nav-container {
  333. justify-content: space-between;
  334. }
  335. </style>
  336. {{/if}} {{/if}} {{#if disableOnFullscreen}}
  337. <style>
  338. viewer:fullscreen nav-bar {
  339. display: none;
  340. }
  341. viewer:-moz-full-screen nav-bar {
  342. display: none;
  343. }
  344. viewer:-webkit-full-screen nav-bar {
  345. display: none;
  346. }
  347. </style>
  348. {{/if}}
  349. <div class="nav-container" id="navbar-control">
  350. {{#unless hideLogo}}
  351. <div class="logo-button" title="{{logoText}}">
  352. {{#if logoLink}}
  353. <a href="{{logoLink}}" target="_blank">
  354. <img src="{{logoImage}}">
  355. </a>
  356. {{else}}
  357. <img src="{{logoImage}}"> {{/if}}
  358. </div>
  359. {{/unless}}{{#unless (or (not animations) hideAnimations)}}
  360. <div class="animation-control">
  361. <div class="types">
  362. <button class="flex-container animation-buttons" id="types-button">
  363. <!-- <div> -->
  364. <span class="icon types-icon"></span>
  365. <span class="control-text animation-label">{{selectedAnimationName}}</span>
  366. <span class="control-text animation-number">{{selectedAnimation}}</span>
  367. <!-- </div> -->
  368. {{#if (gt (count animations) 1)}}
  369. <span class="icon up-icon"></span>
  370. {{/if}}
  371. </button>
  372. <div class="menu-options">
  373. {{#each animations}} {{#unless (eq ../selectedAnimation (add @index 1))}}
  374. <button class="flex-container animation-buttons" id="label-option-button" data-value="{{this}}">
  375. <!-- <div> -->
  376. <span class="icon types-icon"></span>
  377. <span class="control-text animation-label">{{this}}</span>
  378. <span class="control-text animation-number">{{add @index 1}}</span>
  379. <!-- </div> -->
  380. </button>
  381. {{/unless}} {{/each}}
  382. </div>
  383. </div>
  384. <div class="progress-control" id="progress-control">
  385. <button class="play-pause" id="play-pause-button">
  386. {{#if paused}}
  387. <span class="icon play-icon"></span>
  388. {{else}}
  389. <span class="icon pause-icon"></span>
  390. {{/if}}
  391. </button>
  392. <input class="progress-wrapper" id="progress-wrapper" type="range" min="0" max="100" step="0.01">
  393. </div>
  394. <div class="speed">
  395. <button class="flex-container" id="speed-button">
  396. <span class="control-text speed-text">{{selectedSpeed}}</span>
  397. <span class="icon up-icon"></span>
  398. </button>
  399. <div class="menu-options">
  400. {{#eachInMap speedList}} {{#unless (eq ../selectedSpeed id)}}
  401. <button class="flex-container" id="speed-option-button" data-value="{{value}}">
  402. <span class="control-text speed-text">{{id}}</span>
  403. </button>
  404. {{/unless}} {{/eachInMap}}
  405. </div>
  406. </div>
  407. </div>
  408. {{/unless}}
  409. <div class="default-control">
  410. {{#unless hideHelp}}
  411. <button class="help" id="help-button" title="Help">
  412. <span class="icon help-icon"></span>
  413. </button>
  414. {{/unless}} {{#unless hideFullScreen}}
  415. <button class="fullscreen" id="fullscreen-button" title="Fullscreen">
  416. <span class="icon fullscreen-icon"></span>
  417. </button>
  418. {{/unless}}
  419. </div>
  420. </div>