forked from ewowi/StarBase
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into HomeAssistant
- Loading branch information
Showing
56 changed files
with
4,613 additions
and
3,653 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// @title StarMod | ||
// @title StarBase | ||
// @file app.js | ||
// @date 20240411 | ||
// @repo https://github.com/ewowi/StarMod | ||
// @Authors https://github.com/ewowi/StarMod/commits/main | ||
// @Copyright © 2024 Github StarMod Commit Authors | ||
// @repo https://github.com/ewowi/StarBase | ||
// @Authors https://github.com/ewowi/StarBase/commits/main | ||
// @Copyright © 2024 Github StarBase Commit Authors | ||
// @license GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 | ||
// @license For non GPL-v3 usage, commercial licenses must be purchased. Contact [email protected] | ||
|
||
|
@@ -228,13 +228,21 @@ function preview3D(canvasNode, buffer) { | |
led.push(0); | ||
if (led.length <= 2) //1D and 2D: maak 3D | ||
led.push(0); | ||
const geometry = new THREE.SphereGeometry( 0.2); //was 1/factor | ||
const material = new THREE.MeshBasicMaterial({transparent: true, opacity: 0.7}); | ||
|
||
// ppf("size and shape", jsonValues.pview.ledSize, jsonValues.pview.shape); | ||
if (!jsonValues.pview.ledSize) jsonValues.pview.ledSize = 7; | ||
|
||
let geometry; | ||
if (jsonValues.pview.shape == 1) | ||
geometry = new THREE.TetrahedronGeometry(jsonValues.pview.ledSize / 30); //was 1/factor | ||
else // default | ||
geometry = new THREE.SphereGeometry(jsonValues.pview.ledSize / 30); //was 1/factor | ||
const material = new THREE.MeshBasicMaterial({transparent: true, opacity: 1.0}); | ||
// material.color = new THREE.Color(`${x/mW}`, `${y/mH}`, `${z/mD}`); | ||
const sphere = new THREE.Mesh( geometry, material ); | ||
sphere.position.set(offset_x + d*led[0]/factor, -offset_y - d*led[1]/factor, - offset_z - d*led[2]/factor); | ||
sphere.name = outputsIndex + " - " + ledsIndex++; | ||
scene.add( sphere ); | ||
const mesh = new THREE.Mesh( geometry, material ); | ||
mesh.position.set(offset_x + d*led[0]/factor, -offset_y - d*led[1]/factor, - offset_z - d*led[2]/factor); | ||
mesh.name = outputsIndex + " - " + ledsIndex++; | ||
scene.add( mesh ); | ||
} | ||
} | ||
else { | ||
|
@@ -260,17 +268,19 @@ function preview3D(canvasNode, buffer) { | |
} | ||
|
||
//light up the cube | ||
let firstLed = 5; | ||
var i = 1; | ||
let headerBytes = 4; | ||
var i = 0; | ||
if (jsonValues.pview.outputs) { | ||
// console.log("preview3D jsonValues", jsonValues.pview); | ||
for (var output of jsonValues.pview.outputs) { | ||
if (output.leds) { | ||
for (var led of output.leds) { | ||
if (i < scene.children.length) { | ||
scene.children[i].visible = buffer[i*3 + firstLed] + buffer[i*3 + firstLed + 1] + buffer[i*3 + firstLed+2] > 10; //do not show blacks | ||
if (scene.children[i].visible) | ||
scene.children[i].material.color = new THREE.Color(`${buffer[i*3 + firstLed]/255}`, `${buffer[i*3 + firstLed + 1]/255}`, `${buffer[i*3 + firstLed + 2]/255}`); | ||
// scene.children[i].visible = buffer[headerBytes + i*3] + buffer[headerBytes + i*3 + 1] + buffer[headerBytes + i*3 + 2] > 10; //do not show blacks | ||
// if (scene.children[i].visible) { | ||
scene.children[i].material.color = new THREE.Color(`${buffer[headerBytes + i*3]/255}`, `${buffer[headerBytes + i*3 + 1]/255}`, `${buffer[headerBytes + i*3 + 2]/255}`); | ||
// scene.children[i].geometry.setAtttribute("radius", buffer[4] / 30); | ||
// } | ||
} | ||
i++; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
/* | ||
@title StarMod | ||
@title StarBase | ||
@file index.css | ||
@date 20240411 | ||
@repo https://github.com/ewowi/StarMod, submit changes to this file as PRs to ewowi/StarMod | ||
@Authors https://github.com/ewowi/StarMod/commits/main | ||
@Copyright © 2024 Github StarMod Commit Authors | ||
@repo https://github.com/ewowi/StarBase, submit changes to this file as PRs to ewowi/StarBase | ||
@Authors https://github.com/ewowi/StarBase/commits/main | ||
@Copyright © 2024 Github StarBase Commit Authors | ||
@license GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 | ||
@license For non GPL-v3 usage, commercial licenses must be purchased. Contact [email protected] | ||
*/ | ||
|
||
:root, | ||
:root.starmod { | ||
:root.starbase { | ||
--bg-color: #121212; | ||
--text-color: #cfd096; | ||
--th-color: #c27e66; | ||
--h-color:#c27e66; | ||
--border-color: #cdad6a; | ||
--select-color: #1a8aff; /*used for view buttons*/ | ||
--label-color: #83c5eb; | ||
--comment-color: #598a43; | ||
--font-size: 10px; | ||
} | ||
:root.starLeds { | ||
--bg-color: linear-gradient(to bottom, #ffbe33 0%, #b60f62 100%); | ||
--text-color: #030303; | ||
--th-color: #b60f6281; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
<!-- | ||
@title StarMod | ||
@title StarBase | ||
@file index.htm | ||
@date 20240411 | ||
@repo https://github.com/ewowi/StarMod, submit changes to this file as PRs to ewowi/StarMod | ||
@Authors https://github.com/ewowi/StarMod/commits/main | ||
@Copyright © 2024 Github StarMod Commit Authors | ||
@repo https://github.com/ewowi/StarBase, submit changes to this file as PRs to StarBase | ||
@Authors https://github.com/ewowi/StarBase/commits/main | ||
@Copyright © 2024 Github StarBase Commit Authors | ||
@license GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 | ||
@license For non GPL-v3 usage, commercial licenses must be purchased. Contact [email protected] | ||
*/ | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>StarMod💫 LEDs 🎨 by MoonModules 🌔</title> | ||
<meta content="yes" name="apple-mobile-web-app-capable"> | ||
<meta name="author" content="MoonModules and its contributors"> | ||
<title>Star💫LEDs🎨 by MoonModules🌔</title> | ||
<link rel="icon" href="https://ewowi.github.io/StarDocs/assets/images/ui/starbase/favicon-16x16.png"> | ||
<!-- <link rel="icon" type="image/x-icon" href="favicon-16x16.png"> currently only works in chrome --> | ||
<!-- <link rel="mask-icon" type="image/x-icon" href="favicon-16x16.png"> for safari tabs? --> | ||
<!-- <link rel="shortcut icon" href="https://ewowi.github.io/StarDocs/assets/images/ui/StarBase/favicon-16x16.png"> --> | ||
<link rel="stylesheet" href="index.css"> | ||
<script src="app.js"></script> | ||
<script src="index.js"></script> | ||
|
||
<!-- tbd: add max-age=86400 to imports --> | ||
<!-- favicon in safari not working. see: --> | ||
<!-- https://stackoverflow.com/questions/68885882/favicon-not-displaying-on-safari --> | ||
<!-- test: rm /Users/ewoudwijma/Library/Safari/Favicon\ Cache also from trash bin --> | ||
|
||
<!-- tbd: add max-age=86400 to imports --> | ||
|
||
<!-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules --> | ||
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script> | ||
|
@@ -35,7 +44,7 @@ | |
<body onload="onLoad()"> | ||
<div class="module"> | ||
<hgroup> | ||
<h1 style="float: left;">StarMod💫 LEDs 🎨 by MoonModules 🌔</h1> | ||
<h1 style="float: left;">Star💫LEDs🎨 by MoonModules🌔</h1> | ||
<a href="https://ewowi.github.io/StarDocs" style="float: right;">ⓘ</a> | ||
</hgroup> | ||
<br> | ||
|
@@ -50,12 +59,13 @@ <h2><div id="serverName"></div></h2> | |
<input type="button" value="Save" id="bSave" onclick="saveModel(this)"> | ||
<span> | </span> | ||
<label>Theme</label> <select name="theme-select" id="theme-select" onchange="setTheme(this)"> | ||
<option value="starmod">StarMod</option> | ||
<option value="starbase">StarBase</option> | ||
<option value="starleds">StarLeds</option> | ||
<option value="wled">WLED</option> | ||
<option value="grayeen">Grayeen</option> | ||
<option value="dev">Dev</option> | ||
<option value="light">Light</option> | ||
<option value="dark">Dark</option> | ||
<option value="dark">DeathStar</option> | ||
<option value="blue">Blue</option> | ||
<option value="pink">Pink</option> | ||
<option value="space">Space</option> | ||
|
@@ -75,7 +85,7 @@ <h2><div id="serverName"></div></h2> | |
</div> | ||
<div id="connind">☾</div> | ||
<div id="modalView" class="modal"></div> | ||
<p style="color:grey;"> © 2024 MoonModules ☾ - Licensed under GPL-v3</p> | ||
<p style="color:grey;"> © 2024 MoonModules ☾ - StarMod, StarBase and StarLeds is licensed under GPL-v3</p> | ||
<div id="canvasMenu" style="position:absolute;display:none"> <!--;background-color:#b60f62--> | ||
<p><button id="canvasButton1"></button></p> | ||
<p><button id="canvasButton2"></button></p> | ||
|
Oops, something went wrong.