UNPKG

@vime/core

Version:

Customizable, extensible, accessible and framework agnostic media player.

128 lines (117 loc) 3.58 kB
/** * @prop --vm-loading-screen-z-index: The position in the UI z-axis stack inside the player. * @prop --vm-loading-screen-dot-color: The color of the animated loading dot. * @prop --vm-loading-screen-dot-size: The size (wxh) of the dot in pixels. * @prop --vm-loading-screen-pulse-duration: The length of the pulse animation to complete one cycle. */ :host { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: var(--vm-loading-screen-z-index); display: flex; align-items: center; justify-content: center; } .loadingScreen { opacity: 100; transition: var(--vm-fade-transition); } .loadingScreen.inactive { opacity: 0; } /** * ============================================== * Dot Pulse - Thanks to Zongbin! (https://codepen.io/nzbin/pen/GGrXbp) * ============================================== */ .dotPulse { position: relative; left: -9999px; width: var(--vm-loading-screen-dot-size); height: var(--vm-loading-screen-dot-size); border-radius: calc(var(--vm-loading-screen-dot-size) / 2); background-color: var(--vm-loading-screen-dot-color); color: var(--vm-loading-screen-dot-color); box-shadow: 9999px 0 0 calc(calc(var(--vm-loading-screen-dot-size) / 2) * -1) var(--vm-loading-screen-dot-color); animation: dotPulse var(--vm-loading-screen-pulse-duration) infinite linear; animation-delay: calc(var(--vm-loading-screen-pulse-duration) / 6); } .dotPulse::before, .dotPulse::after { content: ''; display: inline-block; position: absolute; top: 0; width: var(--vm-loading-screen-dot-size); height: var(--vm-loading-screen-dot-size); border-radius: calc(var(--vm-loading-screen-dot-size) / 2); background-color: var(--vm-loading-screen-dot-color); color: var(--vm-loading-screen-dot-color); } .dotPulse::before { box-shadow: 9984px 0 0 calc(calc(var(--vm-loading-screen-dot-size) / 2) * -1) var(--vm-loading-screen-dot-color); animation: dotPulseBefore var(--vm-loading-screen-pulse-duration) infinite linear; animation-delay: 0s; } .dotPulse::after { box-shadow: 10014px 0 0 calc(calc(var(--vm-loading-screen-dot-size) / 2) * -1) var(--vm-loading-screen-dot-color); animation: dotPulseAfter var(--vm-loading-screen-pulse-duration) infinite linear; animation-delay: calc(var(--vm-loading-screen-pulse-duration) / 3); } @keyframes dotPulseBefore { 0% { box-shadow: 9984px 0 0 calc(calc(var(--vm-loading-screen-dot-size) / 2) * -1) var(--vm-loading-screen-dot-color); } 30% { box-shadow: 9984px 0 0 2px var(--vm-loading-screen-dot-color); } 60%, 100% { box-shadow: 9984px 0 0 calc(calc(var(--vm-loading-screen-dot-size) / 2) * -1) var(--vm-loading-screen-dot-color); } } @keyframes dotPulse { 0% { box-shadow: 9999px 0 0 calc(calc(var(--vm-loading-screen-dot-size) / 2) * -1) var(--vm-loading-screen-dot-color); } 30% { box-shadow: 9999px 0 0 2px var(--vm-loading-screen-dot-color); } 60%, 100% { box-shadow: 9999px 0 0 calc(calc(var(--vm-loading-screen-dot-size) / 2) * -1) var(--vm-loading-screen-dot-color); } } @keyframes dotPulseAfter { 0% { box-shadow: 10014px 0 0 calc(calc(var(--vm-loading-screen-dot-size) / 2) * -1) var(--vm-loading-screen-dot-color); } 30% { box-shadow: 10014px 0 0 2px var(--vm-loading-screen-dot-color); } 60%, 100% { box-shadow: 10014px 0 0 calc(calc(var(--vm-loading-screen-dot-size) / 2) * -1) var(--vm-loading-screen-dot-color); } }