methods: {
playVid: function() {
this.playing = !0,
this.$refs.vid.play()
},
initializeMorph: function() {
var t = this
, e = 0;
this.morphInterval = setInterval((function() {
var a = t.$refs.morph;
!function(t, e, a) {
var r = ["a", "b", "c", "d", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "{", "}", "%", "$", "?", "!"]
, n = 15
, i = e.split("")
, s = a.split("")
, o = i.length
, l = s.length
, c = new Date
, d = c.getTime()
, u = 0
, h = 0
, p = 105 / Math.max(o, l);
!function e() {
c = new Date,
h += c.getTime() - d;
for (var a = u; a < Math.max(o, l); a++) {
var f = Math.floor(Math.random() * (r.length - 1));
i[a] = r[f]
}
if (h >= p) {
u += Math.floor(h / p);
for (var g = 0; g < u; g++)
i[g] = s[g] || null;
h = 0
}
t.textContent = i.join(""),
d = c.getTime(),
u < Math.max(o, l) && setTimeout((function() {
window.requestAnimationFrame(e)
}
), 1e3 / n)
}()
}(a, a.textContent, t.words[e]),
e < t.words.length - 1 ? e++ : e = 0
}
), 3e3)
}
},
beforeDestroy: function() {
clearInterval(this.morphInterval),
clearInterval(this.safariCheck)
}
.card {
position: relative;
}
.card .card__link::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: '';
}
event
и сбрасываем его.menuToggle.addEventListener('click', function (event) {
event.preventDefault();
...
});
this
меняем на menuToggle
.<button class="menu-toggle" id="menu-toggle">
<span class="menu-toggle__span"></span>
</button>
.menu-toggle {
width: 60px;
height: 60px;
padding: 0;
border: none;
display: flex;
justify-content: center;
align-items: center;
background: none;
z-index: 15;
}
.menu-toggle.active .menu-toggle__span {
background-color: transparent;
}
.menu-toggle.active .menu-toggle__span:before {
transform: rotate(45deg);
top: 0;
}
.menu-toggle.active .menu-toggle__span:after {
transform: rotate(-45deg);
top: 0;
}
checkbox
'а внутри «кнопки». array.reduce((accumulator, value, index) => {
if (!(accumulator[index % 2] instanceof Array)) {
accumulator[index % 2] = [];
}
accumulator[index % 2].push(value);
return accumulator;
}, []);
array.reduce((accumulator, value, index) => {
accumulator[index % 2].push(value);
return accumulator;
}, [[], []]);
array.reduce((accumulator, value, index) => (accumulator[index % 2].push(value), accumulator), [[], []]);
array.reduce((a, v, i) => (a[i % 2].push(v), a), [[], []]);
const countOff = (array, count) => array.reduce((accumulator, value, index) => {
accumulator[index % count].push(value);
return accumulator;
}, Array.from({ length: count }, () => []));
countOff([1, 2, 3, 4, 5, 6], 2); // [[1, 3, 5], [2, 4, 6]]
countOff([1, 2, 3, 4, 5, 6], 3); // [[1, 4], [2, 5], [3, 6]]
Math.pow
уже не работает?const pow = (number, power) => {
if (number === 1 || power === 0) {
return 1;
}
const count = Math.round(Math.abs(power));
let result = number;
for (let index = 0; index < count - 1; index++) {
result *= number;
}
if (power < 0) {
return 1 / result;
} else {
return result;
}
};
console.log(Math.pow(2, 2) === pow(2, 2)); // true
console.log(Math.pow(2, -2) === pow(2, -2)); // true
console.log(Math.pow(2, -3) === pow(2, -3)); // true
console.log(Math.pow(3, -4) === pow(3, -4)); // true
function mynumber(a, b) {
var c = 1;
if (b < 0) {
for (var i = b; i < 0; i++) {
c /= a;
}
} else {
for (var i = 1; i <= b; i++) {
c *= a;
}
}
return c;
}
{
"rewrap.wholeComment": false
}
и разрыв между комментариями делаете, либо выделяете то, что надо отформатировать. href
у ссылок выглядит так: #some?
, а знака вопроса не должно быть после хэша. const total = array.reduce((acc, entry) => {
acc += entry.price;
return acc;
}, 0);