added style config.js

This commit is contained in:
Janis
2022-10-25 21:01:04 +02:00
parent 3332826404
commit 84c6741944
4 changed files with 21 additions and 6 deletions

9
config.js Normal file
View File

@@ -0,0 +1,9 @@
const CONFIG = {
style: {
fontBackground: "rgba(19, 20, 33, 0.5)",
fontColor: "#ffffff",
fontSize: "70pt",
fontStrokeSize: "3px",
fontStrokeColor: "#000000",
},
};

View File

@@ -1,12 +1,8 @@
* {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
color: white;
font-size: 70pt;
padding: 0;
margin: 0;
-webkit-text-stroke: 3px black;
background-color: transparent;
}
#content div {
margin-top: 5px;
@@ -23,3 +19,9 @@
.content-text {
margin-left: 130px;
}
.content-text p {
display: inline;
padding-left: 20px;
padding-right: 20px;
}

View File

@@ -3,7 +3,8 @@ function drawClients() {
result = "";
getClientsInChannel(thisClient.channel).forEach((c) => {
result += '<div> <div class="content-img">';
result += `<div style="color:${CONFIG.style.fontColor}; font-size:${CONFIG.style.fontSize}">`;
result += '<div class="content-img">';
if (c.outputMuted) {
result += ' <img src="img/muted_output.svg" />';
} else if (c.inputMuted) {
@@ -14,7 +15,9 @@ function drawClients() {
result += ' <img src="img/off.svg" />';
}
result += "</div>";
result += '<div class="content-text">' + c.name + "</div></div>";
result += `<div class="content-text"
style="-webkit-text-stroke:${CONFIG.style.fontStrokeSize} ${CONFIG.style.fontStrokeColor};
"><p style="background:${CONFIG.style.fontBackground};">${c.name}</p></div></div>`;
});
elem.innerHTML = result;
}

View File

@@ -8,6 +8,7 @@
<title>TS5 - OBS Overlay</title>
</head>
<body>
<script src="config.js"></script>
<script src="js/objects.js"></script>
<script>
let clientList = new List();