upload 28/5
This commit is contained in:
@@ -25,80 +25,84 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main class="flex overflow-hidden flex-col items-center bg-white">
|
||||
|
||||
{% include shared/header %}
|
||||
{{global|show_var}}
|
||||
|
||||
{{ page_content }}
|
||||
<main>
|
||||
|
||||
{% include shared/footer %}
|
||||
{% include shared/header %}
|
||||
|
||||
</main>
|
||||
{{ page_content }}
|
||||
|
||||
{% include javascript/index %}
|
||||
{% include shared/footer %}
|
||||
|
||||
</main>
|
||||
|
||||
{% include javascript/index %}
|
||||
|
||||
|
||||
<script>
|
||||
var swiper = new Swiper("#js-banner-slider", {
|
||||
slidesPerView: 1,
|
||||
navigation: {
|
||||
nextEl: "#js-banner-slider .swiper-button-next",
|
||||
prevEl: "#js-banner-slider .swiper-button-prev",
|
||||
},
|
||||
});
|
||||
|
||||
var swiper_product = new Swiper("#js-product-best", {
|
||||
slidesPerView: 5,
|
||||
spaceBetween: 15,
|
||||
loop: false,
|
||||
rewind: false,
|
||||
lazy: true,
|
||||
navigation: {
|
||||
nextEl: "#js-product-best-btn .swiper-button-next",
|
||||
prevEl: "#js-product-best-btn .swiper-button-prev",
|
||||
},
|
||||
});
|
||||
|
||||
var swiper_businesses = new Swiper("#list-businesses", {
|
||||
slidesPerView: 7,
|
||||
spaceBetween: 20,
|
||||
loop: false,
|
||||
rewind: false,
|
||||
lazy: true,
|
||||
});
|
||||
|
||||
runVideo("#js-video");
|
||||
|
||||
|
||||
function runVideo(holder) {
|
||||
$(holder).on("click", function () {
|
||||
$(this).addClass("active");
|
||||
let url = $(holder).attr("data-url");
|
||||
let width = $(holder).width();
|
||||
let height = $(holder).height();
|
||||
const videoUrl = getEmbedVideoUrl(url);
|
||||
if (videoUrl) {
|
||||
$(holder).html(`<iframe width="${width}" height="${height}" src="${videoUrl}?mute=1&autoplay=1" frameborder="0" allowfullscreen></iframe>`);
|
||||
}
|
||||
<script>
|
||||
var swiper = new Swiper("#js-banner-slider", {
|
||||
slidesPerView: 1,
|
||||
navigation: {
|
||||
nextEl: "#js-banner-slider .swiper-button-next",
|
||||
prevEl: "#js-banner-slider .swiper-button-prev",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
var swiper_product = new Swiper("#js-product-best", {
|
||||
slidesPerView: 5,
|
||||
spaceBetween: 15,
|
||||
loop: false,
|
||||
rewind: false,
|
||||
lazy: true,
|
||||
navigation: {
|
||||
nextEl: "#js-product-best-btn .swiper-button-next",
|
||||
prevEl: "#js-product-best-btn .swiper-button-prev",
|
||||
},
|
||||
});
|
||||
|
||||
var swiper_businesses = new Swiper("#list-businesses", {
|
||||
slidesPerView: 7,
|
||||
spaceBetween: 20,
|
||||
loop: false,
|
||||
rewind: false,
|
||||
lazy: true,
|
||||
});
|
||||
|
||||
runVideo("#js-video");
|
||||
|
||||
|
||||
function getEmbedVideoUrl(url) {
|
||||
const youtubeRegex = /(?:youtube\.com\/(?:shorts\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/(?:shorts\/)?)([a-zA-Z0-9_-]{11})/;
|
||||
const tiktokRegex = /(?:tiktok\.com\/@[^\/]+\/video\/)(\d+)/;
|
||||
function runVideo(holder) {
|
||||
$(holder).on("click", function () {
|
||||
$(this).addClass("active");
|
||||
let url = $(holder).attr("data-url");
|
||||
let width = $(holder).width();
|
||||
let height = $(holder).height();
|
||||
const videoUrl = getEmbedVideoUrl(url);
|
||||
if (videoUrl) {
|
||||
$(holder).html(`<iframe width="${width}" height="${height}" src="${videoUrl}?mute=1&autoplay=1" frameborder="0" allowfullscreen></iframe>`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const youtubeMatch = url.match(youtubeRegex);
|
||||
if (youtubeMatch) return 'https://www.youtube.com/embed/' + youtubeMatch[1];
|
||||
|
||||
const tiktokMatch = url.match(tiktokRegex);
|
||||
if (tiktokMatch) return 'https://www.tiktok.com/player/v1/' + tiktokMatch[1];
|
||||
function getEmbedVideoUrl(url) {
|
||||
const youtubeRegex = /(?:youtube\.com\/(?:shorts\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/(?:shorts\/)?)([a-zA-Z0-9_-]{11})/;
|
||||
const tiktokRegex = /(?:tiktok\.com\/@[^\/]+\/video\/)(\d+)/;
|
||||
|
||||
return null;
|
||||
}
|
||||
const youtubeMatch = url.match(youtubeRegex);
|
||||
if (youtubeMatch) return 'https://www.youtube.com/embed/' + youtubeMatch[1];
|
||||
|
||||
</script>
|
||||
const tiktokMatch = url.match(tiktokRegex);
|
||||
if (tiktokMatch) return 'https://www.tiktok.com/player/v1/' + tiktokMatch[1];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
Reference in New Issue
Block a user