Boyvol
Объект №: 1730
Допуск3
Класс содержания:
нейтрализованный
Вторичный класс:
none
Класс нарушения:
none
Класс риска:
none

Для продолжения введите свой ID



Приветствую, пользователь

Тестирование канала связи .  .  .

      function Echo(){
        document.body.innerHTML += 5 + 6;
      }
    Echo();

Декомпиляция информационных угроз .  .  .

class Eyes{
     constructor(Closedsource,OpenedEyeSource,pinsource){
     this.container = document.createElement("div");
     this.closedEyeLeft = document.createElement("img");
     this.closedEyeLeft.src = Closedsource;
     this.closedEyeLeft.setAttribute("width","20%");
     this.closedEyeLeft.style.margin = "5% 30%";
       this.closedEyeLeft.style.position = "absolute";
       this.closedEyeRight = document.createElement("img");
     this.closedEyeRight.src = Closedsource;
       this.closedEyeRight.setAttribute("width","20%");
       this.closedEyeRight.style.margin = "5% 50%";
       this.closedEyeRight.style.position = "relative";
       this.closedEyeRight.style.transform= "scaleX(-1)";
     this.openedEyeLeft = document.createElement("img");
     this.openedEyeLeft.src = OpenedEyeSource;
       this.openedEyeLeft.setAttribute("width","20%");
       this.openedEyeLeft.style.margin = "5% 30%";
       this.openedEyeLeft.style.position = "absolute";
       this.openedEyeRight = document.createElement("img");
     this.openedEyeRight.src = OpenedEyeSource;
       this.openedEyeRight.setAttribute("width","20%");
       this.openedEyeRight.style.margin = "5% 50%";
       this.openedEyeRight.style.position = "absolute";
       this.openedEyeRight.style.transform= "scaleX(-1)";
       this.EyePinLeft = document.createElement("img");
     this.EyePinLeft.src = pinsource;
       this.EyePinLeft.setAttribute("width","20%");
       this.EyePinLeft.style.position = "absolute";
       this.EyePinRight = document.createElement("img");
     this.EyePinRight.src = pinsource;
       this.EyePinRight.setAttribute("width","20%");
       this.EyePinRight.style.position = "relative";
       this.EyePinRight.style.transform= "scaleX(-1)";
       this.LeftEyePinMarg = [5.2,30];
       this.RightEyePinMarg = [5.2,50];
       this.LeftEyePinShift = [0,0];
       this.RightEyePinShift = [0,0];
       this.ParentBlock = null;
     this.state = 0;
     this.WaitForMoveCounter = 1000;
     }

     SetBlock(Block){
     this.ParentBlock = Block;
     }

     OpenEyes(){
     this.state = 1;
     }

     CloseEyes(){
     this.state = 0;
     }

     Blind(){
     this.state = 2;
     }

     IdleMove(){
     var LeftShift = (Math.random()-0.5)/5;
     var TopShift = (Math.random()-0.5)/5;
     this.RightEyePinShift[0] = LeftShift;
     this.RightEyePinShift[1] = TopShift;
     this.LeftEyePinShift[0] = LeftShift;
     this.LeftEyePinShift[1] = TopShift;
     }

     LoadEyes(time){
     this.WaitForMoveCounter-=time;
     if(this.WaitForMoveCounter<=0){
     this.WaitForMoveCounter = Math.random()*3000;
     this.IdleMove();
     }
     if(this.ParentBlock != null){
     switch(this.state){
     case 0:{
     this.ParentBlock.appendChild(this.closedEyeLeft);
     this.ParentBlock.appendChild(this.closedEyeRight);
     }
     break;
     case 1:{
       this.openedEyeRight.style.position = "absolute";
     this.ParentBlock.appendChild(this.openedEyeLeft);
     var leftLeft = this.LeftEyePinMarg[0]+this.LeftEyePinShift[0];
     var leftTop = this.LeftEyePinMarg[1]+this.LeftEyePinShift[1];
       this.EyePinLeft.style.margin =
       leftLeft+"% "+leftTop+"%";
     this.ParentBlock.appendChild(this.EyePinLeft);
     this.ParentBlock.appendChild(this.openedEyeRight);
     var rightLeft = this.RightEyePinMarg[0]+this.RightEyePinShift[0];
     var rightTop = this.RightEyePinMarg[1]+this.RightEyePinShift[1];
       this.EyePinRight.style.margin =
       rightLeft+"% "+rightTop+"%";
     this.ParentBlock.appendChild(this.EyePinRight);
     }
     break;
     case 2:{
       this.openedEyeRight.style.position = "relative";
     this.ParentBlock.appendChild(this.openedEyeLeft);
     this.ParentBlock.appendChild(this.openedEyeRight);
     }
     break;
     }
     }
     }
     }

     class Controller{
     constructor(DataArray,HelpArray,
     TableData = [],TableColumnCount = 3,TextBlock1 = "",TextBlock2 = "", minresumestate = 0, Eye = null){
     this.dataArray = DataArray;
     this.helpArray = HelpArray;
     this.parentBlock = null;
     if(Eye != null)
     {
     this.eyes = Eye;
     }
     else {
     this.eyes = new Eyes("Closed-eye.png","Pinless-eye.png","pin-of-eye.png");
     }
     this.tableData = TableData;
     this.tableColumnCount = TableColumnCount;
     this.textBlock1 = TextBlock1;
     this.textBlock2 = TextBlock2;
     this.state = 0;
     this.counter = DataArray[0].milliseconds;
     this.glitchcounter = DataArray[0].glitchtime;
     this.returnstate = 0;
     this.returning = false;
     this.minresumestate = minresumestate;
     this.LoadState();
     }

     Update(time){
     if(this.parentBlock != null){
     this.counter-=time;
     this.glitchcounter-=time;
     var state = 0;
     var element = null;
     if(this.returning == false || this.returnstate >= this.helpArray.length){
     if(this.counter <= 0){
     if(this.state < this.dataArray.length-1) {
     this.state++;
     this.glitchcounter = this.dataArray[this.state].glitchtime;
     }
     this.counter = this.dataArray[this.state].milliseconds;
     }
     state = this.state;
     element = this.dataArray[this.state];
     } else {
     if(this.counter <= 0){
     if(this.returnstate< this.helpArray.length-1){
     this.returnstate++;
     } else {
     this.returning = false;
     this.counter = this.dataArray[this.state].milliseconds;
     return;
     }
     this.glitchcounter = this.helpArray[this.returnstate].glitchtime;
     this.counter = this.helpArray[this.returnstate].milliseconds;
     }
     state = this.returnstate;
     element = this.helpArray[this.returnstate];
     }
     switch(element.behaviour){
             case 'idle':{
             this.parentBlock.innerHTML = '';
             this.parentBlock.appendChild(generateParagraph(this.textBlock1));
             this.parentBlock.appendChild(generateTable(this.tableData,3,"wiki-content-table"));
             this.parentBlock.appendChild(generateParagraph(this.textBlock2));
             }
             break;
             case 'idlemessage':{
             this.parentBlock.innerHTML = '';
             if(this.glitchcounter < 0){
             var block = generateParagraph(element.text);
             } else {
             var block = generateRandomisedParagraph(this.textBlock1.length);
             }
             block.setAttribute("align","center");
             block.style.fontSize = "xx-large";
             this.parentBlock.appendChild(block);
             this.parentBlock.appendChild(generateTable(this.tableData,this.tableColumnCount,"wiki-content-table"));
             this.parentBlock.appendChild(generateParagraph(this.textBlock2));
             }
             break;
             case 'clearmessage':{
             this.parentBlock.innerHTML = '';
             if(this.glitchcounter < 0){
             var block = generateParagraph(element.text);
             } else {
             var block = generateRandomisedParagraph(element.text.length);
             }
             block.setAttribute("align","center");
             block.style.fontSize = "xx-large";
             this.parentBlock.appendChild(block);
             }
             break;
             case 'glitching':{
             this.parentBlock.innerHTML = '';
             this.parentBlock.appendChild(generateRandomisedParagraph(this.textBlock1.length));
             this.parentBlock.appendChild(generateRandomisedTable(this.tableData,this.tableColumnCount,"wiki-content-table"));
             this.parentBlock.appendChild(generateRandomisedParagraph(this.textBlock2.length));
             }
             break;
             case 'closedeyes':{
             this.parentBlock.innerHTML = '';
             if(this.glitchcounter < 0){
             var block = generateParagraph(element.text);
             } else {
             var block = generateRandomisedParagraph(element.text.length);
             }
             block.setAttribute("align","center");
             block.style.fontSize = "xx-large";
             this.parentBlock.appendChild(block);
     this.eyes.CloseEyes();
     this.eyes.LoadEyes(time);
             }
             break;
             case 'openedeyes':{
             this.parentBlock.innerHTML = '';
             if(this.glitchcounter < 0){
             var block = generateParagraph(element.text);
             } else {
             var block = generateRandomisedParagraph(element.text.length);
             }
             block.setAttribute("align","center");
             block.style.fontSize = "xx-large";
             this.parentBlock.appendChild(block);
     this.eyes.OpenEyes();
     this.eyes.LoadEyes(time);
             }
             break;
             case 'creepyeyes':{
             this.parentBlock.innerHTML = '';
             if(this.glitchcounter < 0){
             var block = generateParagraph("<strong>"+element.text+"</strong>");
             } else {
             var block = generateRandomisedParagraph(element.text.length);
             }
             block.setAttribute("align","center");
             block.style.fontSize = "70px";
             block.style.color = "red";
             this.parentBlock.appendChild(block);
     this.eyes.Blind();
     this.eyes.LoadEyes(time);
             }
             break;
             }
             }
     }

     SetBlock(Block){
     this.parentBlock = Block;
     this.eyes.SetBlock(this.parentBlock);
     }

     SaveState(){
     document.cookie = "Bla="+this.state;
     }

     Reset(){
     this.LoadState();
     this.counter = this.dataArray[0].milliseconds;
     this.returnstate = 0;
     }

     LoadState(){
     var Cookie = getCookie("Bla");
     if(typeof(Cookie)=="undefined"){
     this.state = 0;
     } else {
     this.state = Cookie;
     console.log(this.state);
     if(this.state < this.dataArray.length-1){
     if(this.state >= this.minresumestate){
     this.returning = true;
     } else {
     this.state = 0;
     }
     }
     }
     }
     }

     function getCookie(name) {
       var matches = document.cookie.match(new RegExp(
         "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
       ));
       return matches ? decodeURIComponent(matches[1]) : undefined;
     }

     function toggleSpoiler(el) {
     var par = el.parentElement.parentElement;
     if(par.className=="collapsible-block-unfolded") {
     par = par.parentElement;
     AnimationCancel = true;
     controller.SaveState();
     } else {
     Reload();
     InitUpdate();
     AnimationCancel = false;
     }

     var folded =  par.childNodes[1];
     var unfolded =  par.childNodes[3];

     folded.style.display=(folded.style.display!='block') ? 'block' : 'none';
     unfolded.style.display=(unfolded.style.display!='block') ? 'block' : 'none';

     }

     function generateTable(array,columnCount,customClass){
     var count = 0;
     var Tab = document.createElement("TABLE");
     Tab.classList.add(customClass);
     Tab.insertRow();
     array.forEach(function(element){
     count+=1;
     var tabRowId = Tab.rows.length-1;
     Tab.rows[tabRowId].insertCell();
     var data = element;
     if(tabRowId == 0){
     data = "<strong>"+data+"</strong>";
     }
     Tab.rows[tabRowId].cells[Tab.rows[tabRowId].cells.length-1].innerHTML = data;
     if(count>=columnCount) {
     count = 0;
     Tab.insertRow();
     }
     });
     return Tab;
     }

     function generateRandomText(number){
     var array = [];
     array.length = number;
     for (var i = number - 1; i >= 0; i--) {
     array[i] = Math.floor(Math.random()*1000);
     };
     return String.fromCharCode.apply(null, array);
     }

     function generateRandomisedTable(array,columnCount,customClass){
     var count = 0;
     var Tab = document.createElement("TABLE");
     Tab.classList.add(customClass);
     Tab.insertRow();
     array.forEach(function(element){
     count+=1;
     var tabRowId = Tab.rows.length-1;
     Tab.rows[tabRowId].insertCell();
     var data = element;
     data = generateRandomText(element.length);
     if(tabRowId == 0){
     data = "<strong>"+data+"</strong>";
     }
     Tab.rows[tabRowId].cells[Tab.rows[tabRowId].cells.length-1].innerHTML = data;
     if(count>=columnCount) {
     count = 0;
     Tab.insertRow();
     }
     });
     return Tab;
     }

     function generateParagraph(text){
     var Par = document.createElement("p");
     Par.innerHTML = text;
     return Par;
     }

     function generateRandomisedParagraph(text){
     var Par = document.createElement("p");
     Par.innerHTML = generateRandomText(text);
     return Par;
     }

     function InitUpdate(){
     CurrentAnimation = requestAnimationFrame(Update);
     }

     function Update(time){
     if(Prev != 0) controller.Update(time - Prev);
     if(!AnimationCancel) requestAnimationFrame(Update);
     Prev = time;
     }

     function Reload(){
     Prev = 0;
     controller.Reset();
     var Block = document.getElementById("mainblock");
     controller.SetBlock(Block);
     eyes.SetBlock(Block);
     Block.innerHTML = '';
     Block.appendChild(generateTable(Arr,3,"wiki-content-table"));
     }

Завершение потока событий управления …


Завершение сеанса

Вставленная страница ":scp-wiki:theme:black-highlighter-theme" не существует (создать её сейчас)

Вставленная страница ":scp-wiki:theme:isolated-terminal" не существует (создать её сейчас)

версия страницы: 271, Последняя правка: 01 Апрель 2022, 21:35 (748 дней назад)
Пока не указано иное, содержимое этой страницы распространяется по лицензии Creative Commons Attribution-ShareAlike 3.0 License.