const historyTimeline = new SwiperCore(".history__timeline-slider", {
loop: false,
speed: 500,
//spaceBetween: 10,
slidesPerView: '3',
//centeredSlides: true,
freeMode: true,
virtual: {
slides: slideCollection,
cache: true,
renderSlide: function (slide, index) {
console.log(bikesYears)
let currenStamp = bikesYears[index];
let nextStamp = bikesYears[index + 1];
console.log(nextStamp);
let stampRange = [];
for (let i = +currenStamp + +1; i < nextStamp; i++) {
let template = `
<span class="history__stamp-year">
${i}
</span>
`;
stampRange.push(template);
}
let output = stampRange.join('');
slide = `<li class="history__stamp swiper-slide">
<span class="history__stamp-data">
${bikesYears[index]}
</span>
${output}
</li>`;
return slide;
}
},
});
let hondaLineage = {
1946: "Model A",
1949: "Model D",
1951: "Dream E",
1953: "Benly J",
1958: "Super Cub",
1964: "3RC164",
1969: "CB750",
1972: "CR250 Elsinore",
1974: "Gold Wing GL1000",
1978: "NR500",
1986: "VFR750F Interceptor",
1993: "CBR900RR",
1995: "EXP-2",
2002: "RC211V",
2010: "Fury",
2013: "CBR500R",
2018: "Africa Twin",
2021: "Shadow Phantom",
}
let bikesYears = [];
for (let key in hondaLineage) {
bikesYears.push(key);
}