.grid {
display: grid;
gap: 15px;
grid-template-columns: 475px 180px 475px;
justify-content: center;
}
.grid__item {
background-color: #000;
height: 320px;
}
.grid__item:nth-child(odd) {
grid-column-end: span 2;
}
.grid__item:nth-last-child(-n + 2) {
grid-column: 1 / span 1;
}
.grid__item:nth-last-child(-n + 1) {
grid-column: 2 / span 2;
}
- return aDist < bDist;
+ return aDist - bDist;
aDist < bDist
всегда будет либо true, либо false, что в данном контексте будет трактоваться как 1 и 0, т.е. aDist всегда больше или равен bDist и никогда не меньше него. Из-за разных используемых алгоритмов сортировки, разные движки сходят с ума по разному. function setArrayAtPath(obj, path) {
return path.reduce((acc, val, i) => {
acc[val] ??= (i === path.length - 1) ? [] : {};
return acc[val];
}, obj);
}
const result = links.reduce((acc, val) => {
const fullPath = val.url.split('/');
const path = fullPath.slice(0, -1);
const dir = setArrayAtPath(acc, path);
let insertIdx = dir.findIndex(o => o.timestamp > val.timestamp);
insertIdx = insertIdx === -1 ? dir.length : Math.max(0, insertIdx - 1);
dir.splice(insertIdx, 0, { ...val });
return acc;
}, {});
console.log(result);
index.html
- <link rel="stylesheet" href="/color.css">
+ <link rel="stylesheet" href="/resume/color.css">
.swiper {
width: 100%;
height: 100%;
position: initial; / * <-- убрать */
}
header{
display: block;
padding: 10px;
position: fixed;
/* ........... */
z-index: 1; / * <-- сделать больше */
<template>
<swiper
:navigation="{
prevEl: prev,
nextEl: next,
}"
:modules="modules"
class="mySwiper"
>
<swiper-slide>Slide 1</swiper-slide>
<swiper-slide>Slide 2</swiper-slide>
<swiper-slide>Slide 3</swiper-slide>
</swiper>
<div ref="prev" class="swiper-button-prev">prev</div>
<div ref="next" class="swiper-button-next">next</div>
</template>
<script>
import { ref } from 'vue';
import { Swiper, SwiperSlide } from 'swiper/vue';
import 'swiper/css';
import 'swiper/css/navigation';
import { Navigation } from 'swiper';
export default {
components: {
Swiper,
SwiperSlide,
},
setup() {
const prev = ref(null);
const next = ref(null);
return {
modules: [Navigation],
prev,
next,
};
},
};
</script>