scripts.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. Amplitude.init({
  2. "songs": [
  3. {
  4. "name": "Mazurka in A minor, Op. 17 No. 4",
  5. "artist": "Frédéric Chopin",
  6. "album": "",
  7. "url": "/audio/mazurka_am.mp3",
  8. "cover_art_url": "/img/chopin.png"
  9. },
  10. {
  11. "name": "Doctor Gradus as Parnuassum",
  12. "artist": "Claude Debussy",
  13. "album": "Children's Corner Suite, L 113",
  14. "url": "/audio/dr_gradus.m4a",
  15. "cover_art_url": "/img/gradus.png"
  16. },
  17. {
  18. "name": "Sonatina in C Major, Op. 55 No. 1",
  19. "artist": "Friedrich Kuhlau",
  20. "album": "",
  21. "url": "/audio/Kuhlau.mp3",
  22. "cover_art_url": "/img/kuhlau.png"
  23. },
  24. {
  25. "name": "Domenica",
  26. "artist": "2014",
  27. "album": "Album - Unknown",
  28. "url": "/audio/domenica.mp3",
  29. "cover_art_url": "/img/scriabin.png"
  30. },
  31. {
  32. "name": "Poem #2",
  33. "artist": "2007",
  34. "album": "Album - Unknown",
  35. "url": "/audio/poem2.mp3",
  36. "cover_art_url": "/img/unknown.png"
  37. },
  38. {
  39. "name": "Poem #3",
  40. "artist": "2007",
  41. "album": "Album - Unknown",
  42. "url": "/audio/poem3.mp3",
  43. "cover_art_url": "/img/unknown.png"
  44. },
  45. {
  46. "name": "Protos",
  47. "artist": "2007",
  48. "album": "Album - Unknown",
  49. "url": "/audio/mystic/1-Protos.mp3",
  50. "cover_art_url": "/img/unknown.png"
  51. },
  52. ],
  53. "callbacks": {
  54. 'play': function(){
  55. document.getElementById('album-art').style.visibility = 'hidden';
  56. document.getElementById('large-visualization').style.visibility = 'visible';
  57. },
  58. 'pause': function(){
  59. document.getElementById('album-art').style.visibility = 'visible';
  60. document.getElementById('large-visualization').style.visibility = 'hidden';
  61. }
  62. },
  63. waveforms: {
  64. sample_rate: 200
  65. }
  66. });
  67. let songElements = document.getElementsByClassName('song');
  68. for( var i = 0; i < songElements.length; i++ ){
  69. /*
  70. Ensure that on mouseover, CSS styles don't get messed up for active songs.
  71. */
  72. songElements[i].addEventListener('mouseover', function(){
  73. this.style.backgroundColor = '#494949';
  74. this.querySelectorAll('.song-meta-data .song-title')[0].style.color = '#FFFFFF';
  75. this.querySelectorAll('.song-meta-data .song-artist')[0].style.color = '#FFFFFF';
  76. if( !this.classList.contains('amplitude-active-song-container') ){
  77. this.querySelectorAll('.play-button-container')[0].style.display = 'block';
  78. }
  79. this.querySelectorAll('.song-duration')[0].style.color = '#FFFFFF';
  80. });
  81. /*
  82. Ensure that on mouseout, CSS styles don't get messed up for active songs.
  83. */
  84. songElements[i].addEventListener('mouseout', function(){
  85. this.style.backgroundColor = '#FFFFFF';
  86. this.querySelectorAll('.song-meta-data .song-title')[0].style.color = '#272726';
  87. this.querySelectorAll('.song-meta-data .song-artist')[0].style.color = '#607D8B';
  88. this.querySelectorAll('.play-button-container')[0].style.display = 'none';
  89. this.querySelectorAll('.song-duration')[0].style.color = '#607D8B';
  90. });
  91. /*
  92. Show and hide the play button container on the song when the song is clicked.
  93. */
  94. songElements[i].addEventListener('click', function(){
  95. this.querySelectorAll('.play-button-container')[0].style.display = 'none';
  96. });
  97. }
  98. const myModalEl = document.getElementById('Video');
  99. var video = document.getElementById("redemption");
  100. function stopVideo() {
  101. video.pause();
  102. video.currentTime = 0;
  103. }
  104. myModalEl.addEventListener('hidden.bs.modal', event => {
  105. stopVideo();
  106. })