Something like this
[{"id":"e709dc02.32591","type":"inject","z":"dee586f8.76a168","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":330,"y":1340,"wires":[["c560959d.897b38"]]},{"id":"c560959d.897b38","type":"ui_template","z":"dee586f8.76a168","group":"ad9b95d4.4d2718","name":"fading text","order":12,"width":"6","height":"1","format":"<style>\n .fadingtext{\n margin: auto 15px auto 5px;\n }\n</style>\n<div class=\"fadingtext\" id=\"{{'my_'+$id}}\"></div>\n\n<script>\n(function(scope) {\n scope.visible = document.visibilityState === 'visible'\n document.addEventListener(\"visibilitychange\", function() {\n if (document.visibilityState === 'visible') {\n scope.visible = true;\n } else {\n scope.visible = false;\n }\n });\n scope.$watch('msg', function(msg) {\n if (msg) {\n if(scope.visible){\n $(\"#my_\"+scope.$id).fadeOut(function() {\n $(this).text(msg.payload)\n }\n ).fadeIn();\n }\n else{\n $(\"#my_\"+scope.$id).text(msg.payload) \n }\n }\n });\n})(scope);\n</script>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":530,"y":1340,"wires":[[]]},{"id":"ad9b95d4.4d2718","type":"ui_group","name":"Default","tab":"c38fb46f.de97f8","order":4,"disp":true,"width":"6","collapse":false},{"id":"c38fb46f.de97f8","type":"ui_tab","name":"Controls","icon":"dashboard","disabled":false,"hidden":false}]