Skip to content

Commit

Permalink
Added noise overlay and more configurable settings
Browse files Browse the repository at this point in the history
  • Loading branch information
CatalinMustata committed May 17, 2021
1 parent 382955c commit a35c55d
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 7 deletions.
8 changes: 6 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
var displayConfig = {
let displayConfig = {
coreIP: "192.168.0.105",
corePort: 9100
corePort: 9100,
targetZone: "Node",
graphics: {
enableDithering: true
}
}
9 changes: 9 additions & 0 deletions img/noise.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<!-- MAIN SCREEN -->
<div id="main-content-box">
<img id="album-art-bg" />
<div id="noise-overlay"></div>
<div id="album-cover">
<div id="album-cover-body">
<div id="cover-front"></div>
<div id="cover-back"></div>
</div>
</div>


<div id="track-info">
<h4 id="song-name"></h4>
<div id="artist-album">
Expand Down
13 changes: 10 additions & 3 deletions src/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,27 @@ const AlbumImageConfig = {

const LoadingText = [".", "..", "..."]

const targetZone = "Node"

const FaceFront = "front"
const FaceBack = "back"

export default class Controller {

private core: RoonCore
private targetZone: string
private zone: Zone

private currentFace = FaceFront

private loadingAnimator = null

constructor(targetZone: string, enableDithering: boolean) {
this.targetZone = targetZone

if (enableDithering) {
$("#noise-overlay").show()
}
}

public setCore(core: RoonCore | null) {
this.core = core

Expand Down Expand Up @@ -63,7 +70,7 @@ export default class Controller {
const updatedZones = payload.zones || payload.zones_added || payload.zones_changed
const zoneSeekChange = payload.zones_seek_changed
if (updatedZones) {
const zone = updatedZones.find(zone => zone.display_name == targetZone)
const zone = updatedZones.find(zone => zone.display_name == this.targetZone)

if (!zone) {
console.log("Failed to find zone. Check config")
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import RoonApiImage from "node-roon-api-image"

import Controller from "./controller"

const controller = new Controller()
const controller = new Controller(displayConfig.targetZone, displayConfig.graphics.enableDithering)
controller.setCore(null) // init with no core

const roonConnected = (core) => {
Expand Down
13 changes: 13 additions & 0 deletions style/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ body {
opacity: 0.4;
}

#noise-overlay {
position: absolute;
display: none; /* default is hidden, will show if enabled through config */
top: 0; left: 0;
width: 800px;
height: 480px;
background-color: rgb(60, 60, 60);
mix-blend-mode: overlay;
opacity: 0.7;
mask: url("../img/noise.svg");
-webkit-mask: url("../img/noise.svg");
}

#album-cover {
position: relative;
display: block;
Expand Down

0 comments on commit a35c55d

Please sign in to comment.