Skip to content

Instantly share code, notes, and snippets.

@danhollick
Last active February 4, 2020 10:12
Show Gist options
  • Save danhollick/5112efd521b22c05fde446f599bb278c to your computer and use it in GitHub Desktop.
Save danhollick/5112efd521b22c05fde446f599bb278c to your computer and use it in GitHub Desktop.
Use text changing function
window.onmessage = async event => {
const message = event.data.pluginMessage
if (message.type === 'selectionChange') {
// this ๐Ÿ‘‡
const contrast = document.getElementById('contrast')
contrast.textContent = message.contrast
// becomes this ๐Ÿ‘‡
changeText('contrast', message.contrast)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment