Создайте список массивов во всплывающем блоке, таком как LogEvent / Logging с установленной задержкой времени, когда выполняется листинг с использованием Javascript Основы - PullRequest
0 голосов
/ 22 апреля 2020

Моя цель заключается в том, чтобы я хотел, чтобы всплывающее окно с фоном было заблокировано, а создание списка из массива, который я создал в качестве образца, выглядит следующим образом: ["(1) Webkit", "(2) \'12345", "(3) Zxcvb", "(4) Asdfg", "(5) Qwerty", "(6) Hdrysa", "(7) Gtdtd", "(8) Fgsru", "(9) Ghfdts", "(10) Rysdn", "(11) Kyixb", "(12) Iyhkj", "(13) Qrsdc"]. Затем я хочу записать их во всплывающее окно, например, в виде отображения списка Logger () /Window.Log () / LogEvent (). И установите время задержки для перечисления их о ходе загрузки с включенной анимацией загрузки. Я выбираю код и пытаюсь реструктурировать код и улучшать его в соответствии с моей ситуацией и условиями. Я получаю исходный код по этой ссылке здесь; http://blogs.sitepointstatic.com/examples/tech/animation-api/index.html.


=== МОИ ДОСТИЖЕНИЯ ДОСТИГЛИ, ЧТОБЫ УСТАНОВИТЬ ЗАГРУЗКУ - ПЕРЕМЕЩЕНИЕ ВРАЩАТЬ ===

.button {
  font-size: 1em;
  padding: 10px;
  color: #fff;
  border: 2px solid #06D85F;
  border-radius: 20px/50px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease-out;
  font-family: 'Montserrat', sans-serif;
  transform: translateY(-50%);
  text-align: center;
  position: fixed;
  margin-left: 30%;
  width: 30%;
  color: #222;
  top: 50%;
}

.overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 500ms;
  visibility: hidden;
  opacity: 0;
}
.overlay:target {
  visibility: visible;
  opacity: 1;
}

.popup {
  margin: 5px auto;
  padding: 20px;
  background: #fff;
  border-radius: 5px;
  width: 30%;
	height: 30%;
  position: relative;
  transition: all 5s ease-in-out;
	font-family: monospace;
	font-size: 1em;
	color: #0f0;
	background-color: #111;
	border: 1px solid #030;
	border-radius: 4px;
	overflow: auto;
}

.popup .close {
  position: absolute;
  padding: 1% 5% 15% 20%;
  top: 0px;
  right: 0px;
  transition: all 200ms;
  font-size: 30px;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}
.popup .close:hover {
  color: #06D85F;
}

.rotate {
    -webkit-animation: loading;
	  -moz-animation: loading;
	  -ms-animation: loading;
	  -o-animation: loading;
    animation-duration: 5s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-fill-mode: both;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    position: relative;
    left: 11px;
    margin-top: -7%;
}

@keyframes loading {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}

@media screen and (max-width: 2040px){
  .box{
    width: 90%;
    height: 90%;
  }
  .popup{
    width: 90%;
    height: 90%;
  }
}
Let me List

	
		×

Event information log
====================== |


= МОИ ДОСТИЖЕНИЯ ДОСТИГЛИ, ЧТОБЫ НАПИСАТЬ СПИСОК МОДЕЛЕЙ В POPUP, НО ЗАГРУЗКА НЕ ВРАЩАЕТСЯ =

var	anim = document.getElementsByClassName("rotate")[0],
		log = document.getElementById("log"),
		pfx = ["webkit", "moz", "MS", "o", ""],
		arr = ["(1) Webkit", "(2) \`12345", "(3) Zxcvb", "(4) Asdfg", "(5) Qwerty", "(6) Hdrysa", "(7) Gtdtd", "(8) Fgsru", "(9) Ghfdts", "(10) Rysdn", "(11) Kyixb", "(12) Iyhkj", "(13) Qrsdc"];

PrefixedEvent(anim, "AnimationStart", AnimationListener);

function PrefixedEvent(element, type, callback) {
	for (var p = 0; p < pfx.length; p++) {
		if (!pfx[p]) type = type.toLowerCase();
		element.addEventListener(pfx[p]+type, callback, false);
	}
}

function AnimationListener(e) {
	for (var i=0; i<arr.length; i++) {
  	LogEvent("Check Name '"+arr[i]+"' at "+e.elapsedTime.toFixed(2)+" seconds");
  }
}

function LogEvent(msg) {
	log.textContent += msg + "\n";
	var ot = log.scrollHeight - log.clientHeight;
	if (ot > 0) log.scrollTop = ot;
}
.button {
  font-size: 1em;
  padding: 10px;
  color: #fff;
  border: 2px solid #06D85F;
  border-radius: 20px/50px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease-out;
  font-family: 'Montserrat', sans-serif;
  transform: translateY(-50%);
  text-align: center;
  position: fixed;
  margin-left: 30%;
  width: 30%;
  color: #222;
  top: 50%;
}

.overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 500ms;
  visibility: hidden;
  opacity: 0;
}
.overlay:target {
  visibility: visible;
  opacity: 1;
}

.popup {
  margin: 5px auto;
  padding: 20px;
  background: #fff;
  border-radius: 5px;
  width: 30%;
	height: 30%;
  position: relative;
  transition: all 5s ease-in-out;
	font-family: monospace;
	font-size: 1em;
	color: #0f0;
	background-color: #111;
	border: 1px solid #030;
	border-radius: 4px;
	overflow: auto;
}

.popup .close {
  position: absolute;
  padding: 1% 5% 15% 20%;
  top: 0px;
  right: 0px;
  transition: all 200ms;
  font-size: 30px;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}
.popup .close:hover {
  color: #06D85F;
}

.rotate {
    -webkit-animation: loading;
	  -moz-animation: loading;
	  -ms-animation: loading;
	  -o-animation: loading;
    animation-duration: 5s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-fill-mode: both;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    position: relative;
    left: 11px;
    margin-top: -7%;
}

@keyframes loading {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}

@media screen and (max-width: 2040px){
  .box{
    width: 90%;
    height: 90%;
  }
  .popup{
    width: 90%;
    height: 90%;
  }
}
Let me List

	
		×

Event information log
====================== |


=========== =========== МОЕ ОЖИДАНИЕ, КАК ЭТО НИЖЕ, ===================
Образец Пикт здесь как GIF-файл с анимацией, чтобы описать более определенно.

...