Setting display: none and display: flex are instantaneous. Try it this way:
Free UK Delivery over £60
This way you can also add as many messages as you want, just make sure the first message is the one that’s initially set in the HTML. Let’s say you wanted to add a third message. You add a comma and quotes to the array and insert your third message into the quotes:
let messages = ["Free UK Delivery over £60", "Free Stockings over £120*", "Another message you'd like to set"]
And it would cycle through there. Also make sure that your timeout is set to the duration of your transition with opacity. Above the opacity transition is set to .5 milliseconds in the css. In the script the timeout is set to 500, which is 5 milliseconds. You can play around with it here, I left all the code in the HTML portion for your convenience: https://codepen.io/ninthony/pen/QWBjaWv
@Ninthony Thank you for all your help and this code works well but is there a way to add this code as a section so it can be managed from the customize theme editor ? currently it appears the texts need to be hardcoded and separated by commas.
Well liquid computes before JS, so you could just create text settings in your schema and add them into the array instead of the hard coded stuff so in the schema somewhere add settings for it like: