body{
overflow-x: hidden;
margin: 0;
}
.element {
height: 70px;
width: 270px;
border-radius: 15px;
margin-top: 10px;
background-color: red;
transform: translateX(-100%);
animation: nudge 5s linear;
}
.element:nth-child(2){
-webkit-animation-delay: 5s;
-moz-animation-delay: 5s;
-o-animation-delay: 5s;
animation-delay: 5s;
}
.element:nth-child(3){
-webkit-animation-delay: 10s;
-moz-animation-delay: 10s;
-o-animation-delay: 10s;
animation-delay: 10s;
}
@keyframes nudge {
100% { transform: translateX(100vw); }
}
<style>
в head или body, а то у Вас где-то между// ваша строка
const string = "_=1234513423442&sessionId=dsaa85d1231231234166f3c2fsda&viewType=panels&entryType=product&periodStart=1231578121";
// делаем из неё валидный url
let url_string = "http://test?"+string;
// вытаскиваем значение get переменной sessionId
let url = new URL(url_string);
let param_value = url.searchParams.get("sessionId");
console.log(param_value);
const arr1 = ['x','y'];
const arr2 = ['y','z'];
const arr3 = ['x', 'z'];
const arr4 =['x','y','z','c'];
const newarr = [].concat(arr1, arr2, arr3, arr4);
let result = {};
for (let elem of newarr) {
if (result[elem] === undefined) {
result[elem] = 1;
} else {
result[elem]++;
}
}
console.log(result);
let i = 100;
let l = 0;
let par = document.getElementsByTagName('p');
const my_interval = setInterval(() => {
while(l < i) {
l++;
let createPar = document.createElement('p');
let random = Math.floor(Math.random() * 9999);
document.body.appendChild(createPar);
createPar.innerHTML = random;
}clearInterval(my_interval);
}, 100);