Overlay QuiverPRO - Coneccta

Interface overlay

目前為 2023-06-01 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.cn-greasyfork.org/scripts/467601/1198371/Overlay%20QuiverPRO%20-%20Coneccta.js

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

function waitForElementToDisplay(selector, callback, checkFrequencyInMs, timeoutInMs) {
  var startTimeInMs = Date.now();
  function loopSearch() {
    if (document.querySelector(selector) !== null) {
      console.log(document.querySelector(selector));
      callback();
      return;
    } else {
      setTimeout(function() {
        if (timeoutInMs && Date.now() - startTimeInMs > timeoutInMs) {
          return;
        }
        loopSearch();
      }, checkFrequencyInMs);
    }
  }

  loopSearch();
}

(function() {
  'use strict';

  // Function to insert the first overlay element
  function insertElement(divReferencia, divClassName, labelClassName, styleName, labelText) {
    var referencia = document.getElementById(divReferencia);
    let div = document.createElement('div')
    div.className = divClassName
    let label = document.createElement('label');
    label.className = labelClassName
    label.textContent = labelText;
    label.style.cssText = styleName;
    referencia.appendChild(div);
    div.appendChild(label)
    console.log("Inseriu elemento " + referencia);
  }

  // Define the styles for the first overlay element
  const labelStyle = `
    position: static;
    font-family: inherit;
    font-size: 2em;
    letter-spacing: 0px;
    text-transform: uppercase;
    width: 100%;
    text-align: center;
    font-color: #fff;
    line-height: 2em;
    outline: none;
    animation: animate 10s linear infinite;
    border: 1px solid black;
    border-radius: 5px;
    animation: blinkingC 1s infinite;
  `;

  // Define the styles for the second overlay element
  const labelStyle2 = `
    position: static;
    font-family: inherit;
    font-size: 2em;
    letter-spacing: 0px;
    text-transform: uppercase;
    width: 100%;
    text-align: center;
    font-color: #fff;
    line-height: 2em;
    outline: none;
    animation: animate 10s linear infinite;
    border: 1px solid black;
    border-radius: 5px;
    animation: blinkingC2 1s infinite;
  `;

  // Define the blinking animation for the label element
  const blinkAnimation = `
    @keyframes blinkingC {
      0% {
        color: white;
        background: #03a600;
      }
      100% {
        color: lightcyan;
        background: #bfbf10;
      }
    }
  `;

  // Define the blinking animation for the label element
  const blinkAnimation2 = `
    @keyframes blinkingC2 {
      0% {
        color: white;
        background: #bfbf10;
      }
      100% {
        color: lightcyan;
        background: #03a600;
      }
    }
  `;

  // Add the blinking animation to the page
  const style = document.createElement('style');
  style.appendChild(document.createTextNode(blinkAnimation));
  style.appendChild(document.createTextNode(blinkAnimation2));
  document.head.appendChild(style);

  waitForElementToDisplay("#DIVPadrao2000_Observacoes", function() {
    console.log("testeatt");
    insertElement("DIVPadrao2000_Observacoes", "card-Overlay", "label-Overlay", labelStyle, "Informe que a ligação está sendo gravada");
  }, 10000, 900000);

  waitForElementToDisplay("#DIVPadrao2000_Cobertura190 > div", function() {
    insertElement("BoxDadosSegurado", "card-Overlay", "label-Overlay", labelStyle2, "Verificar grupo de afinidade");
  }, 10000, 900000);

  waitForElementToDisplay("#DIVPadrao2000_Cobertura190 > div", function() {
    insertElement("DIVPadrao2000_Cobertura190", "card-Overlay", "label-Overlay", labelStyle, "Esclarecer que uso particular implica em não utilizar o veículo para atividade comercial");
  }, 10000, 900000);

  waitForElementToDisplay("#BoxCobsBasicas", function() {
    insertElement("BoxCobsBasicas", "card-Overlay", "label-Overlay", labelStyle2, "Verificar se as coberturas atendem o segurado");
  }, 10000, 900000);

})();