WIP: viz
This commit is contained in:
parent
49c405216b
commit
3e8efa7264
3 changed files with 33 additions and 13 deletions
|
|
@ -184,9 +184,18 @@ export class Visualizer {
|
||||||
) {
|
) {
|
||||||
stats.kick = 1.0;
|
stats.kick = 1.0;
|
||||||
stats.lastBeatTime = now;
|
stats.lastBeatTime = now;
|
||||||
|
} else {
|
||||||
|
if (stats.upbeatSmoother > 0.6 && stats.energyAverage > 0.4) {
|
||||||
|
const upbeatLevel = (stats.upbeatSmoother - 0.6) / 0.4;
|
||||||
|
if (stats.kick < upbeatLevel) {
|
||||||
|
stats.kick = upbeatLevel;
|
||||||
} else {
|
} else {
|
||||||
stats.kick *= 0.95;
|
stats.kick *= 0.95;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
stats.kick *= 0.9;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
stats.kick *= 0.95;
|
stats.kick *= 0.95;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,13 +65,20 @@ export class UnknownPleasuresPreset {
|
||||||
}
|
}
|
||||||
|
|
||||||
draw(ctx, canvas, analyser, dataArray, params) {
|
draw(ctx, canvas, analyser, dataArray, params) {
|
||||||
|
// Init if empty (e.g. after destroy/switch)
|
||||||
|
if (this.history.length === 0) {
|
||||||
|
this.reset();
|
||||||
|
}
|
||||||
|
|
||||||
const pts = this.dataPoints;
|
const pts = this.dataPoints;
|
||||||
const len = (dataArray.length) | 0;
|
const len = (dataArray.length) | 0;
|
||||||
|
|
||||||
const line = this.history[this.writeIndex];
|
const line = this.history[this.writeIndex];
|
||||||
|
if (line) {
|
||||||
for (let i = 0; i < pts; i++) {
|
for (let i = 0; i < pts; i++) {
|
||||||
line[i] = (dataArray[(this.xLookup[i] * len) | 0] / 255) * this.pLookup[i];
|
line[i] = (dataArray[(this.xLookup[i] * len) | 0] / 255) * this.pLookup[i];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.writeIndex = (this.writeIndex + 1) % this.historySize;
|
this.writeIndex = (this.writeIndex + 1) % this.historySize;
|
||||||
|
|
||||||
if (this._paletteColor !== params.primaryColor) {
|
if (this._paletteColor !== params.primaryColor) {
|
||||||
|
|
|
||||||
|
|
@ -719,6 +719,7 @@ input[type='search']::-webkit-search-cancel-button {
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes pulse {
|
@keyframes pulse {
|
||||||
|
|
||||||
0%,
|
0%,
|
||||||
100% {
|
100% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
@ -1037,6 +1038,7 @@ input[type='search']::-webkit-search-cancel-button {
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1100px) {
|
@media (max-width: 1100px) {
|
||||||
|
|
||||||
#home-recommended-songs,
|
#home-recommended-songs,
|
||||||
#artist-detail-tracks,
|
#artist-detail-tracks,
|
||||||
#playlist-detail-recommended {
|
#playlist-detail-recommended {
|
||||||
|
|
@ -2126,10 +2128,12 @@ input:checked + .slider::before {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
background: color-mix(in srgb, var(--card), transparent 80%);
|
background-color: color-mix(in srgb, var(--card) 40%, transparent);
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
padding: 0.75rem 1.5rem;
|
padding: 0.75rem 1.5rem;
|
||||||
border-radius: var(--radius);
|
border-radius: var(--radius);
|
||||||
border: 1px solid color-mix(in srgb, var(--card), transparent 70%);
|
border: 1px solid var(--border);
|
||||||
|
box-shadow: 0 8px 32px rgb(0, 0, 0, 0.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
#fullscreen-track-title {
|
#fullscreen-track-title {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue