$('.background').mousemove(function(e) {
var x = (e.pageX * -1 / 5), y = (e.pageY * -1 / 5);
$(this).css('background-position', x + 'px ' + y + 'px');
});
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function getRandomArray(len, min, max, mid) {
const res = [];
let rand;
for (let i = 0; i < len; i++) {
if (Math.random() < 0.5) {
rand = getRandomInt(min, (max - min) / 2 + min - mid);
}
else {
rand = getRandomInt((max - min) / 2 + min + mid, max);
}
res.push(rand);
}
return res;
}
getRandomArray(10, 100, 1750, 30);
const notUniqueRevitids = data
.reduce((acc, obj) => {
if (acc[0].size === acc[0].add(obj.revitid).size) {
acc[1].add(obj.revitid);
}
return acc;
}, [new Set(), new Set()])[1];
const uniqueObj = data.filter(obj => !notUniqueRevitids.has(obj.revitid));
document.documentElement.addEventListener('mouseenter', (e) => {
console.log('ENTER')
});
brightness()
A CSS<percentage>
. Applies a linear multiplier to the drawing, making it appear brighter or darker. A value under 100% darkens the image, while a value over 100% brightens it. A value of 0% will create an image that is completely black, while a value of 100% leaves the input unchanged.
<body>
<section class="video-block">
<div class="information">
<select id="select">
<option disabled selected>Выберите язык</option>
<option>Английский язык</option>
</select>
<a data-text="Video information:">Информация о видео:</a>
<a data-text="Title: All For The Sake Of Hype">Название: Всё Ради Хайпа</a>
<a data-text="№1 in YouTube trends">№1 в трендах YouTube</a>
<a data-text="Number of views: 1.5 million">Количество просмотров: 1.5млн</a>
<a data-text="Number of likes: 10 chiliad">Количество лайков: 10тыч</a>
</div>
<figure>
<video id="mesto" class="vidos nety" controls="controls" copreload="auto" autoplay="true" loop="true" muted="muted">
<source src="src/video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
</video>
</figure>
</section>
<section class="button-block">
<div id="button" class="button">
<a id="buttonText" data-text="Watch video" href="#">Смотреть видео</a>
</div>
</section>
<script src="js/script.js"></script>
</body>
window.onload = function() {
let a = document.getElementById('button');
let vidos = document.getElementById('mesto');
let b = document.getElementById('select').options.selectedIndex;
let texts = document.querySelectorAll('[data-text]');
let textButton = document.getElementById('buttonText');
let video = function() {
vidos.classList.remove("nety");
if (b == 0) {
texts.forEach(el => el.textContent = el.dataset.text);
textButton.textContent = textButton.dataset.text;
};
};
a.onclick = video;
}