INNER CODE UNIT · JavaScript

switchColorMode

lucky-sideburn/kubeinvaders · html/js/game_console.js:70

function switchColorMode() {
  let bodyElement = document.getElementById("kinvBody");
  let buttonsLightElement = document.getElementsByClassName("btn-light");
  let textkinv = document.getElementsByClassName("text-kinv");
  let alertkinv = document.getElementsByClassName("alert-kinv");

  if (current_color_mode == "light") {
    bodyElement.style.backgroundColor = "#0a0a0a";
    current_color_mode = "dark";

    for (var i = 0; i < buttonsLightElement.length; i++) {
      console.log("[COLOR-MODE-BUTTONS] Change color of " + buttonsLightElement[i].id);
      document.getElementById(buttonsLightElement[i].id).style.backgroundColor = "#1ed931";
    }

    for (var i = 0; i < textkinv.length; i++) {
      console.log("[COLOR-MODE-TEXT-KINV] Change color of " + textkinv[i].id);
      document.getElementById(textkinv[i].id).style.color = "#1ed931";

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…