Skip to content

Instantly share code, notes, and snippets.

Created May 19, 2017 09:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Fun Title Changer
var title = document.title;
var blurMessage = [
"Please come back! :-( ",
"Don't you love me anymore? :-(",
"Fancy a cookie? ",
"I'm feeling lonely :-( ",
"I need a hug... ",
"Just checking my email...",
"Let's have a pizza party!",
"Doing a quick FB Live!",
"Are you Seriously Social?",
"In Space, no one can hear you scream...",
"Researching the Meaning of Life",
"Just connecting to Skynet...",
"2468 Who do you appreciate?",
"Fancy a cup of tea?",
"Nice weather we're having!",
"Checking my Twitter...",
"Just updating my tool list",
"Drinking a cup of coffee...",
"Was it something I said?",
"Busy procrastinating..."
var intervalTimer = null;
var timeoutTimer = null;
window.addEventListener("blur", function () {
intervalTimer = setInterval(function() {
var rand = Math.floor((Math.random() * blurMessage.length));
document.title = blurMessage[rand];
timeoutTimer = setTimeout(function() {
document.title = title;
window.addEventListener("focus", function(){
document.title = title;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment