JSFiddle - React, Tailwind, and code Playground

by rx65m

HTML

<div style="display: flex; flex-flow: row nowrap;">
	<div onClick="setAleatoryNtfctnLines(); setAleatoryFarewell(); copyText(this); this.style.color='red';">
		<div><span id="AleatoryNotification"></span> <span id="AleatoryFarewell"></span></div>
		<div><span id="weekday"></span></div>
	</div>
	<div><span style="color: lightgray;">⋘--- please click there to get the new text</span></div>
</div>




<script>
const FirstTextLines = [
"2 «weekday» comments done, for your 2 lectures.",
"2 «weekday» comments done, on both your lectures.",
"2 «weekday» comments for both your lectures.",
"2 «weekday» comments for each of your lectures.",
"2 «weekday» comments for your two lectures.",
"2 «weekday» comments on both your lectures.",
"2 «weekday» comments on each of your lectures.",
"2 «weekday» comments x 2 lectures already done.",
"2 «weekday» comments x 2, already done.",
"2 «weekday» comments x 2, done for you.",
"2 «weekday» comments x 2, just done.",
"Already done 2 «weekday» comments x 2.",
"Done 2 «weekday» comments on both your lectures.",
"Done 2 «weekday» comments on each of your lectures.",
"Done 2 «weekday» comments x 2.",
"I just posted 2 «weekday» comments x 2.",
"Just posted 2 «weekday» comments x 2."
];

const getAleatoryLines = max => Math.floor(Math.random() * max); 

const getAleatoryNtfctnLines = () => `${FirstTextLines[getAleatoryLines(FirstTextLines.length)]}`;

const setAleatoryNtfctnLines = () => {
  document.getElementById('AleatoryNotification').innerText = getAleatoryNtfctnLines();
};

document.getElementById('GenerateFirstSetOfLines').
addEventListener('click', setAleatoryNtfctnLines);

setAleatoryNtfctnLines();
</script>


<script>
var d = new Date();
var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
document.getElementById("weekday").innerHTML = days[d.getDay()];
</script>


<script>
const SecondTextLines = [
"Bye bye!",
"Bye for now.",
"Catch you later.",
"Have a good one.",
"Have a nice day.",
"Peace...