JavaScript

//テレビを見るときは部屋を明るくして離れて見てください



var HSLtoRGB = function (h,s,l){
  var r = 0;
  var g = 0;
  var b = 0;
  var max = 0;
  var min = 0;
  if(l<50){
    max = (255/100) * (l + l * (s/100));
    min = (255/100) * (l - l * (s/100));
  } else {
    max = (255/100) * (l + (100-l) * (s/100));
    min = (255/100) * (l - (100-l) * (s/100));
  }
   
  var hi = Math.floor(h/60);
  var mmm = function (hd){
    return min  + (max-min) * (hd/60);
  }
 

  if(hi===0){
    r = max;
    g = mmm(h);
    b = min;
  } else if(hi===1){
    r = mmm(120-h);
    g = max;
    b = min;
  } else if(hi===2){
    r = min;
    g = max;
    b = mmm(h-120);
  } else if(hi===3){
    r = min;
    g = mmm(240-h);
    b = max;
  } else if(hi===4){
    r = mmm(h-240);
    g = min;
    b = max;
  } else if(hi===5){
    r = max;
    g = min;
    b = mmm(360-h);
  }

  r = Math.round(r);
  g = Math.round(g);
  b = Math.round(b);

  return [r,g,b];
}

$(function(){
  $('html,body').css({
    overflow:'hidden',
    cursor: 'none',
  });
  $body = $('#demo');
  var setRandomColor = function(){
    var hue = 360 * Math.random();
    var rgbs = HSLtoRGB(hue, 100, 50);
    //var color = "hsl(" + hue + ", 100%, 50%)";//safari無効
    var rgbText = rgbs.join()
    var color = 'rgb(' + rgbs.join(',') + ')';
    $body.css({backgroundColor:color});
  }
  setRandomColor();
  setInterval(function(){
    setRandomColor();
  },10);
});


document.body.requestFullscreen();
document.getElementById("demo").addEventListener("click", function() {
  document.body.requestFullscreen();
}, false);

CSS