Hello,
I try to make a dashboard inclinometer to see if the camper is level.
I have modified the https://discourse.nodered.org/t/how-to-rotate-a-text-ui/25657
[
{
"id": "9150c0c61a95662d",
"type": "tab",
"label": "Level",
"disabled": false,
"info": ""
},
{
"id": "256234d4c9cfdd8e",
"type": "ui_template",
"z": "9150c0c61a95662d",
"group": "2d39c4ed.6ee85c",
"name": "vertical text",
"order": 1,
"width": "4",
"height": "2",
"format": "<style>\n.rotated {\n writing-mode: tb-rl;\n white-space: nowrap;\n font-weight:500;\n color:red;\n margin: 0;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-right: -50%;\n transform: translate(-50%, -50%) rotate(85deg)\n}\n</style>\n\n<div id=\"blue-rotated\" class=\"rotated\">{{=============================}}</div>\n \n<script>\nfunction updateContainerStyle (el) {\n\tel = el.parentElement\n\tif (el && el.classList.contains('nr-dashboard-template')) {\n\t\tel.style.background = gray;\n\t}\n}\nupdateContainerStyle(document.getElementById(\"blue-rotated\"))\n</script>\n\n ",
"storeOutMessages": true,
"fwdInMessages": true,
"resendOnRefresh": true,
"templateScope": "local",
"x": 510,
"y": 280,
"wires": [
[]
]
},
{
"id": "fd346cfbd1056c80",
"type": "ui_slider",
"z": "9150c0c61a95662d",
"name": "",
"label": "slider",
"tooltip": "",
"group": "2d39c4ed.6ee85c",
"order": 6,
"width": 0,
"height": 0,
"passthru": false,
"outs": "end",
"topic": "topic",
"topicType": "msg",
"min": "80",
"max": "100",
"step": 1,
"x": 240,
"y": 280,
"wires": [
[
"256234d4c9cfdd8e"
]
]
},
{
"id": "2d39c4ed.6ee85c",
"type": "ui_group",
"name": "HOME",
"tab": "4486cc51.18fc44",
"order": 1,
"disp": true,
"width": 4,
"collapse": false
},
{
"id": "4486cc51.18fc44",
"type": "ui_tab",
"name": "TEST",
"icon": "dashboard",
"order": 3,
"disabled": false,
"hidden": false
}
]
How to rotate the "text" with the payload ?