1
0

controller.scss 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. .dplayer-controller-mask {
  2. background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom;
  3. height: 98px;
  4. width: 100%;
  5. position: absolute;
  6. bottom: 0;
  7. transition: all 0.3s ease;
  8. }
  9. .dplayer-controller {
  10. position: absolute;
  11. bottom: 0;
  12. left: 0;
  13. right: 0;
  14. height: 41px;
  15. padding: 0 20px;
  16. user-select: none;
  17. transition: all 0.3s ease;
  18. &.dplayer-controller-comment {
  19. .dplayer-icons {
  20. display: none;
  21. }
  22. .dplayer-icons.dplayer-comment-box {
  23. display: block;
  24. }
  25. }
  26. .dplayer-bar-wrap {
  27. padding: 5px 0;
  28. cursor: pointer;
  29. position: absolute;
  30. bottom: 33px;
  31. width: calc(100% - 40px);
  32. height: 3px;
  33. &:hover {
  34. .dplayer-bar .dplayer-played .dplayer-thumb {
  35. transform: scale(1);
  36. }
  37. .dplayer-highlight {
  38. display: block;
  39. width: 8px;
  40. transform: translateX(-4px);
  41. top: 4px;
  42. height: 40%;
  43. }
  44. }
  45. .dplayer-highlight {
  46. z-index: 12;
  47. position: absolute;
  48. top: 5px;
  49. width: 6px;
  50. height: 20%;
  51. border-radius: 6px;
  52. background-color: #fff;
  53. text-align: center;
  54. transform: translateX(-3px);
  55. transition: all .2s ease-in-out;
  56. &:hover {
  57. .dplayer-highlight-text {
  58. display: block;
  59. }
  60. &~.dplayer-bar-preview {
  61. opacity: 0;
  62. }
  63. &~.dplayer-bar-time {
  64. opacity: 0;
  65. }
  66. }
  67. .dplayer-highlight-text {
  68. display: none;
  69. position: absolute;
  70. left: 50%;
  71. top: -24px;
  72. padding: 5px 8px;
  73. background-color: rgba(0, 0, 0, .62);
  74. color: #fff;
  75. border-radius: 4px;
  76. font-size: 12px;
  77. white-space: nowrap;
  78. transform: translateX(-50%);
  79. }
  80. }
  81. .dplayer-bar-preview {
  82. position: absolute;
  83. background: #fff;
  84. pointer-events: none;
  85. display: none;
  86. background-size: 16000px 100%;
  87. }
  88. .dplayer-bar-preview-canvas {
  89. position: absolute;
  90. width: 100%;
  91. height: 100%;
  92. z-index: 1;
  93. pointer-events: none;
  94. }
  95. .dplayer-bar-time {
  96. &.hidden {
  97. opacity: 0;
  98. }
  99. position: absolute;
  100. left: 0px;
  101. top: -20px;
  102. border-radius: 4px;
  103. padding: 5px 7px;
  104. background-color: rgba(0, 0, 0, 0.62);
  105. color: #fff;
  106. font-size: 12px;
  107. text-align: center;
  108. opacity: 1;
  109. transition: opacity .1s ease-in-out;
  110. word-wrap: normal;
  111. word-break: normal;
  112. z-index: 2;
  113. pointer-events: none;
  114. }
  115. .dplayer-bar {
  116. position: relative;
  117. height: 3px;
  118. width: 100%;
  119. background: rgba(255, 255, 255, .2);
  120. cursor: pointer;
  121. .dplayer-loaded {
  122. position: absolute;
  123. left: 0;
  124. top: 0;
  125. bottom: 0;
  126. background: rgba(255, 255, 255, .4);
  127. height: 3px;
  128. transition: all 0.5s ease;
  129. will-change: width;
  130. }
  131. .dplayer-played {
  132. position: absolute;
  133. left: 0;
  134. top: 0;
  135. bottom: 0;
  136. height: 3px;
  137. will-change: width;
  138. .dplayer-thumb {
  139. position: absolute;
  140. top: 0;
  141. right: 5px;
  142. margin-top: -4px;
  143. margin-right: -10px;
  144. height: 11px;
  145. width: 11px;
  146. border-radius: 50%;
  147. cursor: pointer;
  148. transition: all .3s ease-in-out;
  149. transform: scale(0);
  150. }
  151. }
  152. }
  153. }
  154. .dplayer-icons {
  155. height: 38px;
  156. position: absolute;
  157. bottom: 0;
  158. &.dplayer-comment-box {
  159. display: none;
  160. position: absolute;
  161. transition: all .3s ease-in-out;
  162. z-index: 2;
  163. height: 38px;
  164. bottom: 0;
  165. left: 20px;
  166. right: 20px;
  167. color: #fff;
  168. .dplayer-icon {
  169. padding: 7px;
  170. }
  171. .dplayer-comment-setting-icon {
  172. position: absolute;
  173. left: 0;
  174. top: 0;
  175. }
  176. .dplayer-send-icon {
  177. position: absolute;
  178. right: 0;
  179. top: 0;
  180. }
  181. .dplayer-comment-setting-box {
  182. position: absolute;
  183. background: rgba(28, 28, 28, 0.9);
  184. bottom: 41px;
  185. left: 0;
  186. box-shadow: 0 0 25px rgba(0, 0, 0, .3);
  187. border-radius: 4px;
  188. padding: 10px 10px 16px;
  189. font-size: 14px;
  190. width: 204px;
  191. transition: all .3s ease-in-out;
  192. transform: scale(0);
  193. &.dplayer-comment-setting-open {
  194. transform: scale(1);
  195. }
  196. input[type=radio] {
  197. display: none;
  198. }
  199. label {
  200. cursor: pointer;
  201. }
  202. .dplayer-comment-setting-title {
  203. font-size: 13px;
  204. color: #fff;
  205. line-height: 30px;
  206. }
  207. .dplayer-comment-setting-type {
  208. font-size: 0;
  209. .dplayer-comment-setting-title {
  210. margin-bottom: 6px;
  211. }
  212. label {
  213. &:nth-child(2) {
  214. span {
  215. border-radius: 4px 0 0 4px;
  216. }
  217. }
  218. &:nth-child(4) {
  219. span {
  220. border-radius: 0 4px 4px 0;
  221. }
  222. }
  223. }
  224. span {
  225. width: 33%;
  226. padding: 4px 6px;
  227. line-height: 16px;
  228. display: inline-block;
  229. font-size: 12px;
  230. color: #fff;
  231. border: 1px solid #fff;
  232. margin-right: -1px;
  233. box-sizing: border-box;
  234. text-align: center;
  235. cursor: pointer;
  236. }
  237. input:checked+span {
  238. background: #E4E4E6;
  239. color: #1c1c1c;
  240. }
  241. }
  242. .dplayer-comment-setting-color {
  243. font-size: 0;
  244. label {
  245. font-size: 0;
  246. padding: 6px;
  247. display: inline-block;
  248. }
  249. span {
  250. width: 22px;
  251. height: 22px;
  252. display: inline-block;
  253. border-radius: 50%;
  254. box-sizing: border-box;
  255. cursor: pointer;
  256. &:hover {
  257. animation: my-face 5s infinite ease-in-out;
  258. }
  259. }
  260. }
  261. }
  262. .dplayer-comment-input {
  263. outline: none;
  264. border: none;
  265. padding: 8px 31px;
  266. font-size: 14px;
  267. line-height: 18px;
  268. text-align: center;
  269. border-radius: 4px;
  270. background: none;
  271. margin: 0;
  272. height: 100%;
  273. box-sizing: border-box;
  274. width: 100%;
  275. color: #fff;
  276. &::placeholder {
  277. color: #fff;
  278. opacity: 0.8;
  279. }
  280. &::-ms-clear {
  281. display: none;
  282. }
  283. }
  284. }
  285. &.dplayer-icons-left {
  286. .dplayer-icon {
  287. padding: 7px;
  288. }
  289. }
  290. &.dplayer-icons-right {
  291. right: 20px;
  292. .dplayer-icon {
  293. padding: 8px;
  294. }
  295. }
  296. .dplayer-time,
  297. .dplayer-live-badge {
  298. line-height: 38px;
  299. color: #eee;
  300. text-shadow: 0 0 2px rgba(0, 0, 0, .5);
  301. vertical-align: middle;
  302. font-size: 13px;
  303. cursor: default;
  304. }
  305. .dplayer-live-dot {
  306. display: inline-block;
  307. width: 6px;
  308. height: 6px;
  309. vertical-align: 4%;
  310. margin-right: 5px;
  311. content: '';
  312. border-radius: 6px;
  313. }
  314. .dplayer-icon {
  315. width: 40px;
  316. height: 100%;
  317. border: none;
  318. background-color: transparent;
  319. outline: none;
  320. cursor: pointer;
  321. vertical-align: middle;
  322. box-sizing: border-box;
  323. display: inline-block;
  324. .dplayer-icon-content {
  325. transition: all .2s ease-in-out;
  326. opacity: .8;
  327. }
  328. &:hover {
  329. .dplayer-icon-content {
  330. opacity: 1;
  331. }
  332. }
  333. &.dplayer-quality-icon {
  334. color: #fff;
  335. width: auto;
  336. line-height: 22px;
  337. font-size: 14px;
  338. }
  339. &.dplayer-comment-icon {
  340. padding: 10px 9px 9px;
  341. }
  342. &.dplayer-setting-icon {
  343. padding-top: 8.5px;
  344. }
  345. &.dplayer-volume-icon {
  346. width: 43px;
  347. }
  348. }
  349. .dplayer-volume {
  350. position: relative;
  351. display: inline-block;
  352. cursor: pointer;
  353. height: 100%;
  354. &:hover {
  355. .dplayer-volume-bar-wrap .dplayer-volume-bar {
  356. width: 45px;
  357. }
  358. .dplayer-volume-bar-wrap .dplayer-volume-bar .dplayer-volume-bar-inner .dplayer-thumb {
  359. transform: scale(1);
  360. }
  361. }
  362. &.dplayer-volume-active {
  363. .dplayer-volume-bar-wrap .dplayer-volume-bar {
  364. width: 45px;
  365. }
  366. .dplayer-volume-bar-wrap .dplayer-volume-bar .dplayer-volume-bar-inner .dplayer-thumb {
  367. transform: scale(1);
  368. }
  369. }
  370. .dplayer-volume-bar-wrap {
  371. display: inline-block;
  372. margin: 0 10px 0 -5px;
  373. vertical-align: middle;
  374. height: 100%;
  375. .dplayer-volume-bar {
  376. position: relative;
  377. top: 17px;
  378. width: 0;
  379. height: 3px;
  380. background: #aaa;
  381. transition: all 0.3s ease-in-out;
  382. .dplayer-volume-bar-inner {
  383. position: absolute;
  384. bottom: 0;
  385. left: 0;
  386. height: 100%;
  387. transition: all 0.1s ease;
  388. will-change: width;
  389. .dplayer-thumb {
  390. position: absolute;
  391. top: 0;
  392. right: 5px;
  393. margin-top: -4px;
  394. margin-right: -10px;
  395. height: 11px;
  396. width: 11px;
  397. border-radius: 50%;
  398. cursor: pointer;
  399. transition: all .3s ease-in-out;
  400. transform: scale(0);
  401. }
  402. }
  403. }
  404. }
  405. }
  406. .dplayer-subtitle-btn {
  407. display: inline-block;
  408. height: 100%;
  409. }
  410. .dplayer-setting {
  411. display: inline-block;
  412. height: 100%;
  413. .dplayer-setting-box {
  414. position: absolute;
  415. right: 0;
  416. bottom: 50px;
  417. transform: scale(0);
  418. width: 150px;
  419. border-radius: 2px;
  420. background: rgba(28, 28, 28, 0.9);
  421. padding: 7px 0;
  422. transition: all .3s ease-in-out;
  423. overflow: hidden;
  424. z-index: 2;
  425. &>div {
  426. display: none;
  427. &.dplayer-setting-origin-panel {
  428. display: block;
  429. }
  430. }
  431. &.dplayer-setting-box-open {
  432. transform: scale(1);
  433. }
  434. &.dplayer-setting-box-narrow {
  435. width: 70px;
  436. text-align: center;
  437. }
  438. &.dplayer-setting-box-speed {
  439. .dplayer-setting-origin-panel {
  440. display: none;
  441. }
  442. .dplayer-setting-speed-panel {
  443. display: block;
  444. }
  445. }
  446. }
  447. .dplayer-setting-item,
  448. .dplayer-setting-speed-item {
  449. height: 30px;
  450. padding: 5px 10px;
  451. box-sizing: border-box;
  452. cursor: pointer;
  453. position: relative;
  454. &:hover {
  455. background-color: rgba(255, 255, 255, .1);
  456. }
  457. }
  458. .dplayer-setting-danmaku {
  459. padding: 5px 0;
  460. .dplayer-label {
  461. padding: 0 10px;
  462. display: inline;
  463. }
  464. &:hover {
  465. .dplayer-label {
  466. display: none;
  467. }
  468. .dplayer-danmaku-bar-wrap {
  469. display: inline-block;
  470. }
  471. }
  472. &.dplayer-setting-danmaku-active {
  473. .dplayer-label {
  474. display: none;
  475. }
  476. .dplayer-danmaku-bar-wrap {
  477. display: inline-block;
  478. }
  479. }
  480. .dplayer-danmaku-bar-wrap {
  481. padding: 0 10px;
  482. box-sizing: border-box;
  483. display: none;
  484. vertical-align: middle;
  485. height: 100%;
  486. width: 100%;
  487. .dplayer-danmaku-bar {
  488. position: relative;
  489. top: 8.5px;
  490. width: 100%;
  491. height: 3px;
  492. background: #fff;
  493. transition: all 0.3s ease-in-out;
  494. .dplayer-danmaku-bar-inner {
  495. position: absolute;
  496. bottom: 0;
  497. left: 0;
  498. height: 100%;
  499. transition: all 0.1s ease;
  500. background: #aaa;
  501. will-change: width;
  502. .dplayer-thumb {
  503. position: absolute;
  504. top: 0;
  505. right: 5px;
  506. margin-top: -4px;
  507. margin-right: -10px;
  508. height: 11px;
  509. width: 11px;
  510. border-radius: 50%;
  511. cursor: pointer;
  512. transition: all .3s ease-in-out;
  513. background: #aaa;
  514. }
  515. }
  516. }
  517. }
  518. }
  519. }
  520. .dplayer-full {
  521. display: inline-block;
  522. height: 100%;
  523. position: relative;
  524. &:hover {
  525. .dplayer-full-in-icon {
  526. display: block;
  527. }
  528. }
  529. .dplayer-full-in-icon {
  530. position: absolute;
  531. top: -30px;
  532. z-index: 1;
  533. display: none;
  534. }
  535. }
  536. .dplayer-quality {
  537. position: relative;
  538. display: inline-block;
  539. height: 100%;
  540. z-index: 2;
  541. &:hover {
  542. .dplayer-quality-list {
  543. display: block;
  544. }
  545. .dplayer-quality-mask {
  546. display: block;
  547. }
  548. }
  549. .dplayer-quality-mask {
  550. display: none;
  551. position: absolute;
  552. bottom: 38px;
  553. left: -18px;
  554. width: 80px;
  555. padding-bottom: 12px;
  556. }
  557. .dplayer-quality-list {
  558. display: none;
  559. font-size: 12px;
  560. width: 80px;
  561. border-radius: 2px;
  562. background: rgba(28, 28, 28, 0.9);
  563. padding: 5px 0;
  564. transition: all .3s ease-in-out;
  565. overflow: hidden;
  566. color: #fff;
  567. text-align: center;
  568. }
  569. .dplayer-quality-item {
  570. height: 25px;
  571. box-sizing: border-box;
  572. cursor: pointer;
  573. line-height: 25px;
  574. &:hover {
  575. background-color: rgba(255, 255, 255, .1);
  576. }
  577. }
  578. }
  579. .dplayer-comment {
  580. display: inline-block;
  581. height: 100%;
  582. }
  583. .dplayer-label {
  584. color: #eee;
  585. font-size: 13px;
  586. display: inline-block;
  587. vertical-align: middle;
  588. white-space: nowrap;
  589. }
  590. .dplayer-toggle {
  591. width: 32px;
  592. height: 20px;
  593. text-align: center;
  594. font-size: 0;
  595. vertical-align: middle;
  596. position: absolute;
  597. top: 5px;
  598. right: 10px;
  599. input {
  600. max-height: 0;
  601. max-width: 0;
  602. display: none;
  603. }
  604. input+label {
  605. display: inline-block;
  606. position: relative;
  607. box-shadow: rgb(223, 223, 223) 0 0 0 0 inset;
  608. border: 1px solid rgb(223, 223, 223);
  609. height: 20px;
  610. width: 32px;
  611. border-radius: 10px;
  612. box-sizing: border-box;
  613. cursor: pointer;
  614. transition: .2s ease-in-out;
  615. }
  616. input+label:before {
  617. content: "";
  618. position: absolute;
  619. display: block;
  620. height: 18px;
  621. width: 18px;
  622. top: 0;
  623. left: 0;
  624. border-radius: 15px;
  625. transition: .2s ease-in-out;
  626. }
  627. input+label:after {
  628. content: "";
  629. position: absolute;
  630. display: block;
  631. left: 0;
  632. top: 0;
  633. border-radius: 15px;
  634. background: #fff;
  635. transition: .2s ease-in-out;
  636. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  637. height: 18px;
  638. width: 18px;
  639. }
  640. input:checked+label {
  641. border-color: rgba(255, 255, 255, 0.5);
  642. }
  643. input:checked+label:before {
  644. width: 30px;
  645. background: rgba(255, 255, 255, 0.5);
  646. }
  647. input:checked+label:after {
  648. left: 12px;
  649. }
  650. }
  651. }
  652. }
  653. .dplayer-mobile-play {
  654. display: none;
  655. width: 50px;
  656. height: 50px;
  657. border: none;
  658. background-color: transparent;
  659. outline: none;
  660. cursor: pointer;
  661. box-sizing: border-box;
  662. position: absolute;
  663. bottom: 0;
  664. opacity: 0.8;
  665. position: absolute;
  666. left: 50%;
  667. top: 50%;
  668. transform: translate(-50%, -50%);
  669. }