console.log('111')

const startButton = document.getElementById("startButton");
const stopButton = document.getElementById("stopButton");
const numberButton = document.getElementById("numberButton");
const unlist = document.getElementById("unlist");
const sceneone = document.querySelector(".sceneone");
const scenetwo = document.querySelector(".scenetwo");

startButton.addEventListener("click", function () {
  chrome.storage.local.set({ basildi: true }, function () {
    stopButton.removeAttribute("disabled");
    startButton.setAttribute("disabled", "true");
    chrome.runtime.sendMessage({message: 'start'});
  });
});
chrome.storage.local.get(["basildi"], function (result) {
  if (result.basildi) {
    stopButton.removeAttribute("disabled");
    startButton.setAttribute("disabled", "true");
    chrome.runtime.sendMessage({message: 'start'});
  }
});
stopButton.addEventListener("click", function () {
  chrome.storage.local.remove("basildi", function () {
    stopButton.setAttribute("disabled", "true");
    startButton.removeAttribute("disabled", "true");
    chrome.runtime.sendMessage({message: 'stop'});
  });
});

chrome.storage.local.get(["scenetwo"], function (result) {
  if (result.scenetwo) {
    sceneone.style.display='block';
    scenetwo.style.display='none';
  }
});
unlist.addEventListener("click", function () {
  chrome.storage.local.remove("scenetwo", function () {
    sceneone.style.display='none';
    scenetwo.style.display='block';
  });
});
numberButton.addEventListener("click", function () {
  chrome.storage.local.set({ scenetwo: true }, function () {
    sceneone.style.display='block';
    scenetwo.style.display='none';
  });
});
