<! DOCTYPE  html > < htmllang = " en" > < head> < metacharset = " UTF-8" > < metaname = " viewport" content = " width=device-width, initial-scale=1.0" > < title> </ title> < linkrel = " stylesheet" href = " https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity = " sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin = " anonymous" > < scriptsrc = " https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity = " sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin = " anonymous" > </ script> < style> *  { margin :  0; padding :  0; } body  { background :  #2980b9; } .loading  { height :  40px; position :  absolute; top :  50%; left :  50%; display :  flex; transform :  translate ( -50%,  -50%) ; align-items :  center; } .object  { width :  6px; height :  40px; background :  white; margin :  0 3px; border-radius :  10px; animation :  loading 0.8s infinite; animation-play-state :  paused; } .xyBtn  { position :  absolute; top :  60%; left :  50%; transform :  translate ( -40%,  -50%) ; } .object:nth-child(2)  { animation-delay :  0.1s; } .object:nth-child(3)  { animation-delay :  0.2s; } .object:nth-child(4)  { animation-delay :  0.3s; } .object:nth-child(5)  { animation-delay :  0.4s; } .object:nth-child(6)  { animation-delay :  0.5s; } .object:nth-child(7)  { animation-delay :  0.6s; } .object:nth-child(8)  { animation-delay :  0.7s; } @keyframes  loading{ 0%  { height :  0; } 50%  { height :  40px; } 100%  { height :  0; } } .animate  { animation-play-state :  running; } .paused  { animation-play-state :  paused; } </ style> </ head> < body> < divclass = " loading" > < divclass = " object" > </ div> < divclass = " object" > </ div> < divclass = " object" > </ div> < divclass = " object" > </ div> < divclass = " object" > </ div> < divclass = " object" > </ div> < divclass = " object" > </ div> < divclass = " object" > </ div> </ div> < buttontype = " button" class = " btn btn-info xyBtn" id = " toggleButton" > </ button> < script> var  toggleButton =  document. getElementById ( "toggleButton" ) ; var  objectElements =  document. getElementsByClassName ( "object" ) ; var  animationState =  false ; toggleButton. addEventListener ( "click" ,  function  ( )  { animationState =  ! animationState; if  ( animationState)  { for  ( var  i =  0 ;  i <  objectElements. length;  i++ )  { objectElements[ i] . classList. add ( "animate" ) ; objectElements[ i] . classList. remove ( "paused" ) ; } toggleButton. textContent =  "暂停动画" ; }  else  { for  ( var  i =  0 ;  i <  objectElements. length;  i++ )  { objectElements[ i] . classList. add ( "paused" ) ; objectElements[ i] . classList. remove ( "animate" ) ; } toggleButton. textContent =  "开始动画" ; } } ) ; </ script> </ body> </ html> 
 
<! DOCTYPE  html > < htmllang = " en" > < head> < metacharset = " UTF-8" > < metaname = " viewport" content = " width=device-width, initial-scale=1.0" > < title> </ title> < style> *  { margin :  0; padding :  0; } body  { overflow :  hidden; } section  { position :  absolute; top :  -100px; left :  -100px; right :  -100px; bottom :  -100px; display :  flex; justify-content :  center; align-items :  center; } section video  { position :  absolute; top :  0; left :  0; width :  100%; height :  100%; object-fit :  cover; filter :  blur ( 35px) ; } section .sphere  { position :  relative; width :  600px; height :  600px; border-radius :  50%; z-index :  10; } section .sphere::before  { content :  "" ; position :  absolute; top :  0; left :  0; width :  100%; height :  100%; z-index :  100; border-radius :  50%; box-shadow :  inset 0 100px 100px rgba ( 255,  255,  255,  0.5) , inset 0 -100px 100px rgba ( 0,  0,  0,  1) , inset 0 0 100px rgba ( 0,  0,  0,  1) ; } section .sphere::after  { content :  "" ; position :  absolute; top :  550px; left :  -50px; width :  700px; height :  100px; z-index :  -1; border-radius :  50%; background :  black; background :  radial-gradient ( black,  transparent,  transparent) ; } section .sphere video  { width :  100%; height :  100%; position :  absolute; top :  0; left :  0; object-fit :  cover; border-radius :  50%; filter :  blur ( 0) ; } section .controls  { position :  absolute; bottom :  100px; left :  50%; transform :  translateX ( -50%) ; display :  flex; align-items :  center; } section .controls button  { background :  none; border :  none; outline :  none; cursor :  pointer; color :  white; font-size :  20px; margin-right :  10px; font-family :  'Times New Roman' ,  Times,  serif; } section .controls input[type="range"]  { width :  800px; margin-right :  10px; } section .controls span  { color :  white; font-size :  18px; font-family :  'Times New Roman' ,  Times,  serif; } </ style> </ head> < body> < section> < videoid = " backgroundVideo" src = " ../Videos/1-“挑 战 B 站 画 质 上 限”-4K 超清-AVC.mp4" > </ video> < divclass = " sphere" > < videoid = " sphereVideo" src = " ../Videos/1-“挑 战 B 站 画 质 上 限”-4K 超清-AVC.mp4" > </ video> </ div> < divclass = " controls" > < buttonid = " playPauseButton" > </ button> < inputtype = " range" id = " progressBar" min = " 0" step = " 0.001" > < spanid = " currentTime" > </ span>   < span> </ span>   < spanid = " duration" > </ span> </ div> </ section> < script> document. addEventListener ( "DOMContentLoaded" ,  function  ( )  { var  backgroundVideo =  document. getElementById ( "backgroundVideo" ) ;  var  sphereVideo =  document. getElementById ( "sphereVideo" ) ;  var  playPauseButton =  document. getElementById ( "playPauseButton" ) ;  var  progressBar =  document. getElementById ( "progressBar" ) ;  var  currentTime =  document. getElementById ( "currentTime" ) ;  var  duration =  document. getElementById ( "duration" ) ;  backgroundVideo. pause ( ) ; sphereVideo. pause ( ) ; progressBar. value =  0 ; playPauseButton. addEventListener ( "click" ,  function  ( )  { if  ( backgroundVideo. paused)  { backgroundVideo. play ( ) ; sphereVideo. play ( ) ; playPauseButton. textContent =  "暂停" ;  }  else  { backgroundVideo. pause ( ) ; sphereVideo. pause ( ) ; playPauseButton. textContent =  "播放" ;  } } ) ; backgroundVideo. addEventListener ( "timeupdate" ,  function  ( )  { var  progress =  ( backgroundVideo. currentTime /  backgroundVideo. duration)  *  100 ; progressBar. value =  progress;  currentTime. textContent =  formatTime ( backgroundVideo. currentTime) ;  } ) ; progressBar. addEventListener ( "input" ,  function  ( )  { var  progressTime =  ( progressBar. value /  100 )  *  backgroundVideo. duration; backgroundVideo. currentTime =  progressTime; sphereVideo. currentTime =  progressTime; currentTime. textContent =  formatTime ( progressTime) ;  } ) ; function  formatTime ( time )  { var  minutes =  Math. floor ( time /  60 ) ;  var  seconds =  Math. floor ( time %  60 ) ;  return  ( minutes <  10  ?  "0"  :  "" )  +  minutes +  ":"  +  ( seconds <  10  ?  "0"  :  "" )  +  seconds; } backgroundVideo. addEventListener ( "loadedmetadata" ,  function  ( )  { duration. textContent =  formatTime ( backgroundVideo. duration) ;  } ) ; backgroundVideo. addEventListener ( "ended" ,  function  ( )  { playPauseButton. textContent =  "播放" ;  progressBar. value =  0 ;  currentTime. textContent =  "00:00" ;  } ) ; } ) ;  </ script> </ body> </ html>