├── README.md ├── src ├── index.html ├── script.js └── style.css ├── license.txt └── docs ├── index.html ├── script.js └── style.css /README.md: -------------------------------------------------------------------------------- 1 | # for stream 2 | 3 | A Pen created on CodePen.io. Original URL: [https://codepen.io/thatkookooguy/pen/eYWBaoa](https://codepen.io/thatkookooguy/pen/eYWBaoa). 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 10 | Reo - Time Machine of the Heart 11 |
12 |
13 |
14 |
-------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 by neil kalman (https://codepen.io/thatkookooguy/pen/eYWBaoa) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | 9 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodePen - for stream 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 21 | Reo - Time Machine of the Heart 22 |
23 |
24 |
25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/script.js: -------------------------------------------------------------------------------- 1 | const title = getParameterByName('title'); 2 | const img = getParameterByName('img'); 3 | 4 | const songName = $('#songname'); 5 | const albumImage = $('#cover'); 6 | 7 | if (title) { 8 | songName.text(title); 9 | } 10 | 11 | if (img) { 12 | albumImage.attr('src', img); 13 | } 14 | 15 | setTimeout(function() { 16 | onItemClick(1); 17 | $('.btn-flat').on('click', onItemClick); 18 | $('.album-play').on('click', function() { 19 | if ($(this).find('i').text() === 'pause') { 20 | reset(); 21 | } else { 22 | onItemClick(0); 23 | } 24 | }); 25 | }, 1000); 26 | 27 | function onItemClick(index) { 28 | var allBtns = $('.btn-flat'); 29 | var $this = Number.isInteger(index) ? $(allBtns[index]) : $(this); 30 | var wasActive = $this.hasClass('active'); 31 | 32 | // reset all buttons 33 | reset(); 34 | 35 | // activate if needed 36 | if (!wasActive) { 37 | $('.vinyl-container').addClass('play'); 38 | $this.addClass('active'); 39 | $this.find('i').text('pause_circle_filled'); 40 | $this.closest(".card").find('.album-play i').text('pause'); 41 | $this.append([].join('')); 42 | } 43 | 44 | } 45 | 46 | function reset() { 47 | var allBtns = $('.btn-flat'); 48 | 49 | // reset all buttons 50 | $('.vinyl-container').removeClass('play'); 51 | allBtns.removeClass('active'); 52 | allBtns.find('i').text('play_circle_outline'); 53 | $('.album-play i').text('play_arrow'); 54 | $('.card.music .play-bars').remove(); 55 | } 56 | 57 | function getParameterByName (name, url) { 58 | if (!url) url = window.location.href; 59 | name = name.replace(/[[]]/g, '\\$&'); 60 | const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'); 61 | const results = regex.exec(url); 62 | if (!results) return null; 63 | if (!results[2]) return ''; 64 | return decodeURIComponent(results[2].replace(/\+/g, ' ')); 65 | } 66 | -------------------------------------------------------------------------------- /docs/script.js: -------------------------------------------------------------------------------- 1 | const title = getParameterByName('title'); 2 | const img = getParameterByName('img'); 3 | 4 | const songName = $('#songname'); 5 | const albumImage = $('#cover'); 6 | 7 | if (title) { 8 | songName.text(title); 9 | } else { 10 | songName.hide(); 11 | } 12 | 13 | if (img) { 14 | albumImage.attr('src', img); 15 | } 16 | 17 | setTimeout(function() { 18 | onItemClick(1); 19 | $('.btn-flat').on('click', onItemClick); 20 | $('.album-play').on('click', function() { 21 | if ($(this).find('i').text() === 'pause') { 22 | reset(); 23 | } else { 24 | onItemClick(0); 25 | } 26 | }); 27 | }, 1000); 28 | 29 | function onItemClick(index) { 30 | var allBtns = $('.btn-flat'); 31 | var $this = Number.isInteger(index) ? $(allBtns[index]) : $(this); 32 | var wasActive = $this.hasClass('active'); 33 | 34 | // reset all buttons 35 | reset(); 36 | 37 | // activate if needed 38 | if (!wasActive) { 39 | $('.vinyl-container').addClass('play'); 40 | $this.addClass('active'); 41 | $this.find('i').text('pause_circle_filled'); 42 | $this.closest(".card").find('.album-play i').text('pause'); 43 | $this.append([].join('')); 44 | } 45 | 46 | } 47 | 48 | function reset() { 49 | var allBtns = $('.btn-flat'); 50 | 51 | // reset all buttons 52 | $('.vinyl-container').removeClass('play'); 53 | allBtns.removeClass('active'); 54 | allBtns.find('i').text('play_circle_outline'); 55 | $('.album-play i').text('play_arrow'); 56 | $('.card.music .play-bars').remove(); 57 | } 58 | 59 | function getParameterByName (name, url) { 60 | if (!url) url = window.location.href; 61 | name = name.replace(/[[]]/g, '\\$&'); 62 | const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'); 63 | const results = regex.exec(url); 64 | if (!results) return null; 65 | if (!results[2]) return ''; 66 | return decodeURIComponent(results[2].replace(/\+/g, ' ')); 67 | } 68 | -------------------------------------------------------------------------------- /docs/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: transparent; 3 | } 4 | 5 | #everything { 6 | animation: fadeIn 800ms; 7 | } 8 | 9 | .card.music .card-title { 10 | background-color: rgba(0,0,0, 0.3); 11 | width: 100%; 12 | } 13 | 14 | .card.music .collection { 15 | border: none; 16 | margin-top: 1rem; 17 | overflow: visible; 18 | } 19 | 20 | .card.music .card-image a { 21 | z-index: 2 22 | } 23 | 24 | .card.music .card-image { 25 | position: relative; 26 | } 27 | 28 | @keyframes spin { 29 | from { 30 | transform: rotate(0deg); 31 | } 32 | to { 33 | transform: rotate(360deg); 34 | } 35 | } 36 | 37 | .card.music .card-image .vinyl-container { 38 | position:absolute; 39 | top: 0; 40 | right: 0; 41 | left: 0; 42 | bottom: 0; 43 | transition: transform 500ms; 44 | } 45 | 46 | .card.music .card-image .vinyl-container .shadow { 47 | width: 100%; 48 | height: 100%; 49 | background-color: rgba(0, 0, 0, 0.1); 50 | border-radius: 50%; 51 | position: absolute; 52 | top: 5px; 53 | right: 5px; 54 | } 55 | 56 | .card.music .card-image .vinyl-container.play { 57 | transform: translateX(30%); 58 | } 59 | 60 | .waves-effect.waves-dark-orange .waves-ripple { 61 | /* The alpha value allows the text and background color 62 | of the button to still show through. */ 63 | background-color: #ff6d00; 64 | } 65 | 66 | .card.music .card-image .vinyl { 67 | transform-origin: center center; 68 | animation-name: spin; 69 | animation-duration: 4000ms; 70 | animation-iteration-count: infinite; 71 | animation-timing-function: linear; 72 | z-index: -11; 73 | display: block; 74 | -webkit-transition: all .25s ease-out; 75 | transition: all .25s ease-out; 76 | background-size: cover; 77 | width: 100%; 78 | height: 100%; 79 | background-image:url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/154887/vinyl.png); 80 | 81 | } 82 | 83 | .card.music .collection a.btn-flat { 84 | display: flex; 85 | align-items: center; 86 | color: #ffab40; 87 | margin-bottom: 3px; 88 | /* border-radius: 0; */ 89 | } 90 | 91 | .card.music .collection a.btn-flat:hover { 92 | transition: transform 1s box-shadow 1s; 93 | background-color: #ffab40; 94 | color: white; 95 | /* transform: translateX(10px); */ 96 | box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2); 97 | } 98 | 99 | .card.music .collection a.btn-flat.active::after { 100 | content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/154887/bars.svg); 101 | width: 20px; 102 | height: 15px; 103 | width: 15px; 104 | transform: translateY(-8px); 105 | margin-left: 10px; 106 | } 107 | 108 | .card.music .collection a.btn-flat.active { 109 | transition: transform 1s box-shadow 1s; 110 | background-color: #ff6d00; 111 | color: white; 112 | transform: translateX(10px); 113 | box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2); 114 | } 115 | 116 | .card.music .collection a.btn-flat.active .waves-ripple { 117 | background-color: #ffab40; 118 | } 119 | 120 | .dark-orange { 121 | background-color: #ffab40; 122 | } 123 | 124 | .dark-orange:hover { 125 | background-color: #ff6d00; 126 | } 127 | 128 | .card.music .collection a.btn-flat i { 129 | margin-right: 10px 130 | } 131 | 132 | .card.music .collection a.collection-item::after { 133 | position: absolute; 134 | bottom: 0; 135 | left: 10px; 136 | right: 10px; 137 | content: ""; 138 | height: 1px; 139 | background-color: white; 140 | display: block; 141 | } -------------------------------------------------------------------------------- /src/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: transparent; 3 | } 4 | 5 | #everything { 6 | animation: fadeIn 800ms; 7 | } 8 | 9 | .card.music .card-title { 10 | background-color: rgba(0,0,0, 0.3); 11 | width: 100%; 12 | } 13 | 14 | .card.music .collection { 15 | border: none; 16 | margin-top: 1rem; 17 | overflow: visible; 18 | } 19 | 20 | .card.music .card-image a { 21 | z-index: 2 22 | } 23 | 24 | .card.music .card-image { 25 | position: relative; 26 | } 27 | 28 | @keyframes spin { 29 | from { 30 | transform: rotate(0deg); 31 | } 32 | to { 33 | transform: rotate(360deg); 34 | } 35 | } 36 | 37 | .card.music .card-image .vinyl-container { 38 | position:absolute; 39 | top: 0; 40 | right: 0; 41 | left: 0; 42 | bottom: 0; 43 | transition: transform 500ms; 44 | } 45 | 46 | .card.music .card-image .vinyl-container .shadow { 47 | width: 100%; 48 | height: 100%; 49 | background-color: rgba(0, 0, 0, 0.1); 50 | border-radius: 50%; 51 | position: absolute; 52 | top: 5px; 53 | right: 5px; 54 | } 55 | 56 | .card.music .card-image .vinyl-container.play { 57 | transform: translateX(30%); 58 | } 59 | 60 | .waves-effect.waves-dark-orange .waves-ripple { 61 | /* The alpha value allows the text and background color 62 | of the button to still show through. */ 63 | background-color: #ff6d00; 64 | } 65 | 66 | .card.music .card-image .vinyl { 67 | transform-origin: center center; 68 | animation-name: spin; 69 | animation-duration: 4000ms; 70 | animation-iteration-count: infinite; 71 | animation-timing-function: linear; 72 | z-index: -11; 73 | display: block; 74 | -webkit-transition: all .25s ease-out; 75 | transition: all .25s ease-out; 76 | background-size: cover; 77 | width: 100%; 78 | height: 100%; 79 | background-image:url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/154887/vinyl.png); 80 | 81 | } 82 | 83 | .card.music .collection a.btn-flat { 84 | display: flex; 85 | align-items: center; 86 | color: #ffab40; 87 | margin-bottom: 3px; 88 | /* border-radius: 0; */ 89 | } 90 | 91 | .card.music .collection a.btn-flat:hover { 92 | transition: transform 1s box-shadow 1s; 93 | background-color: #ffab40; 94 | color: white; 95 | /* transform: translateX(10px); */ 96 | box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2); 97 | } 98 | 99 | .card.music .collection a.btn-flat.active::after { 100 | content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/154887/bars.svg); 101 | width: 20px; 102 | height: 15px; 103 | width: 15px; 104 | transform: translateY(-8px); 105 | margin-left: 10px; 106 | } 107 | 108 | .card.music .collection a.btn-flat.active { 109 | transition: transform 1s box-shadow 1s; 110 | background-color: #ff6d00; 111 | color: white; 112 | transform: translateX(10px); 113 | box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2); 114 | } 115 | 116 | .card.music .collection a.btn-flat.active .waves-ripple { 117 | background-color: #ffab40; 118 | } 119 | 120 | .dark-orange { 121 | background-color: #ffab40; 122 | } 123 | 124 | .dark-orange:hover { 125 | background-color: #ff6d00; 126 | } 127 | 128 | .card.music .collection a.btn-flat i { 129 | margin-right: 10px 130 | } 131 | 132 | .card.music .collection a.collection-item::after { 133 | position: absolute; 134 | bottom: 0; 135 | left: 10px; 136 | right: 10px; 137 | content: ""; 138 | height: 1px; 139 | background-color: white; 140 | display: block; 141 | } --------------------------------------------------------------------------------