You've already forked ProfessionalWebsite
New Colour Scheme
Changed from Teal & Green to Purple & Orange
This commit is contained in:
@@ -21,9 +21,10 @@
|
||||
|
||||
<script src="https://kit.fontawesome.com/8970d94f9b.js" crossorigin="anonymous"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||
<title>Project Page - ADCM Networks</title>
|
||||
<title>Showreel</title>
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:image" content="https://www.mrdaviscsit.uk/assets/img/brand/headshot.webp">
|
||||
<meta property="og:image" content="https://www.mrdaviscsit.uk/assets/img/photo-1489599849927-2ee91cede3ba.jpg">
|
||||
<meta name="description" content="A wide range of production projects">
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
@@ -105,13 +106,13 @@
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/logo.png">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/ADCM%20Logo%202025.png">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/logo-white.png" media="(prefers-color-scheme: dark)">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/logo.png">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/ADCM%20Logo%202025.png">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/logo-white.png" media="(prefers-color-scheme: dark)">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/logo.png">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/logo.png">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/logo.png">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/ADCM%20Logo%202025.png">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/ADCM%20Logo%202025.png">
|
||||
<link rel="icon" type="image/png" sizes="4860x4860" href="../assets/img/brand/ADCM%20Logo%202025.png">
|
||||
<link rel="stylesheet" href="../assets/bootstrap/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../assets/css/Lato.css">
|
||||
<link rel="stylesheet" href="../assets/css/bss-overrides.css">
|
||||
@@ -126,16 +127,16 @@
|
||||
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-md fixed-top portfolio-navbar gradient navbar-dark" style="padding-top: 5px;padding-bottom: 5px;">
|
||||
<div class="container-fluid"><a class="navbar-brand logo" href="#" style="margin-right: 0;padding: 0;"><img src="../assets/img/brand/logo-white.png" style="width: 100px;height: 100px;" width="50" height="50"></a><button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navbarNav"><span class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="container-fluid"><a class="navbar-brand logo" href="../../index.html" style="margin-right: 0;padding: 0;"><img src="../assets/img/brand/logo-white.png" style="width: 100px;height: 100px;" width="50" height="50"></a><button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navbarNav"><span class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item"><a class="nav-link" href="/index.html">Home</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/about.html">About</a></li>
|
||||
<li class="nav-item dropdown nav-item"><a class="dropdown-toggle nav-link nav-link" aria-expanded="false" data-bs-toggle="dropdown" href="projects.html">My Work</a>
|
||||
<li class="nav-item dropdown nav-item" href="projects.html"><a class="dropdown-toggle nav-link nav-link" aria-expanded="false" data-bs-toggle="dropdown" data-bs-auto-close="false" href="projects.html">My Work</a>
|
||||
<div class="dropdown-menu"><a class="dropdown-item" href="projects.html?tag=web-design">Web Design</a><a class="dropdown-item" href="projects.html?tag=projects-for-education">Projects for Education</a><a class="dropdown-item" href="projects.html?tag=extracurricular-projects">Extracurricular Projects</a><a class="dropdown-item" href="my-work/showreel.html">Showreel</a></div>
|
||||
</li>
|
||||
<li class="nav-item"><a class="nav-link" href="../../blog.html">Blog</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../../contact.html">Contact</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../blog.html">Blog</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../contact.html">Contact</a></li>
|
||||
<li class="nav-item d-flex align-items-center mode-select"><a class="nav-link" id="light-mode" data-bs-theme-value="dark"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-sun-fill mb-1">
|
||||
<path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8M8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0m0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13m8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5M3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8m10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0m-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707M4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"></path>
|
||||
</svg></a><a class="nav-link" id="dark-mode" data-bs-theme-value="light"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-moon-stars-fill mb-1">
|
||||
@@ -147,44 +148,80 @@
|
||||
</div>
|
||||
</nav>
|
||||
<main class="page">
|
||||
<section class="portfolio-block project">
|
||||
<div class="container">
|
||||
<div class="heading">
|
||||
<h2>project name</h2>
|
||||
<section class="portfolio-block block-intro" style="padding-bottom: 10px;">
|
||||
<div class="container center-everything">
|
||||
<div class="align-content-center heading blog-heading" style="height: 25em;background: linear-gradient(rgba(var(--bs-primary-rgb),0.75), rgba(var(--bs-secondary-rgb),0.75)), url("../assets/img/photo-1489599849927-2ee91cede3ba.jpg") center / cover;color: white;">
|
||||
<h2 class="text-capitalize">Showreel</h2>
|
||||
<p>A wide range of production projects</p>
|
||||
</div>
|
||||
<div class="image" style="background-image:url("../assets/img/tech/image4.jpg");"></div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="portfolio-block project" style="padding-top: 0;">
|
||||
<div class="container center-everything">
|
||||
<div class="ratio ratio-16x9" style="margin-bottom: 25px;"><iframe src="https://www.youtube-nocookie.com/embed/videoseries?si=RIK2nSwdtEB4Kadz&amp;list=PLhZGMkgkarmkgB18-1Dwpecs8rgm7mUTk" allowfullscreen=""></iframe></div>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 offset-md-1 info">
|
||||
<h3>Description</h3>
|
||||
<p>Nam a ultrices mauris. Nam efficitur, lorem a vehicula interdum, ligula velit euismod lorem, vitae vehicula ligula tortor eu leo. Maecenas porttitor massa ut vestibulum euismod. Aliquam eget mi aliquam.</p>
|
||||
<p>Lorem ipsum dapibus dolor non, malesuada mauris. Aliquam eleifend mauris non odio mattis auctor. Aenean sit amet elementum tellus, a facilisis ligula. Pellentesque ac vehicula mauris.</p>
|
||||
<p>Above is the playlist containing all of my work. feel free to view as much as you like to see the wide rage of production projects I have participated in.</p>
|
||||
</div>
|
||||
<div class="col-12 col-md-3 offset-md-1 meta">
|
||||
<div class="tags"><span class="meta-heading">Tags</span><a href="#">Resource</a><a href="#">Project</a><span class="meta-heading">Date</span><span>25-04-2017</span></div>
|
||||
<div class="col-12 col-md-3 offset-md-1 meta" style="padding-left: 12px;">
|
||||
<div class="tags"></div><a class="btn btn-primary" role="button" href="https://www.youtube.com/playlist?list=PLhZGMkgkarmkgB18-1Dwpecs8rgm7mUTk" target="_blank" style="margin-top: 25px;margin-right: auto;margin-left: auto;display: flex;justify-content: center;">Watch on YouTube</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="more-projects">
|
||||
<h3 class="text-center">More Projects</h3>
|
||||
<div class="row gallery">
|
||||
<div class="col-md-4 col-lg-3">
|
||||
<div class="item"><a href="#"><img class="img-fluid scale-on-hover" src="../assets/img/nature/image2.jpg"></a></div>
|
||||
</div>
|
||||
<div class="col-md-4 col-lg-3">
|
||||
<div class="item"><a href="#"><img class="img-fluid scale-on-hover" src="../assets/img/nature/image3.jpg"></a></div>
|
||||
</div>
|
||||
<div class="col-md-4 col-lg-3">
|
||||
<div class="item"><a href="#"><img class="img-fluid scale-on-hover" src="../assets/img/tech/image4.jpg"></a></div>
|
||||
</div>
|
||||
<div class="col-md-4 col-lg-3">
|
||||
<div class="item"><a href="#"><img class="img-fluid scale-on-hover" src="../assets/img/nature/image5.jpg"></a></div>
|
||||
<h3 class="text-center" style="margin-bottom: 10px;">More Projects</h3>
|
||||
<div data-bss-type="blog-loop" data-bss-perpage="12">
|
||||
<div class="row gy-4 row-cols-1 row-cols-sm-2 row-cols-md-2 row-cols-lg-3 mt-0" data-bss-type="blog-loop-base">
|
||||
<div class="post-tag-extracurricular-projects col" data-bss-type="blog-loop-item">
|
||||
<div class="card"><a href="extracurricular-projects/the-computers-identity.html"><img width="940" height="500" class="card-img-top rainbow-border" src="../assets/img/projects/the_computers_identity/identitypreview.png"></a>
|
||||
<div class="card-body"><a href="extracurricular-projects/the-computers-identity.html">
|
||||
<h4 class="text-body">The Computer's Identity</h4>
|
||||
</a>
|
||||
<p class="card-text">An interactive poem entry for the BCU Christian Union "Where Is Identity Found" Art Competition.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-tag-projects-for-education col" data-bss-type="blog-loop-item">
|
||||
<div class="card"><a href="projects-for-education/cs_box.html"><img width="500" height="500" class="card-img-top rainbow-border" src="../assets/img/projects/cs_box/csbox_logo.png"></a>
|
||||
<div class="card-body"><a href="projects-for-education/cs_box.html">
|
||||
<h4 class="text-body">CS:Box</h4>
|
||||
</a>
|
||||
<p class="card-text">An evolution of Bit:Box to incorporate different elements of the UK Computing Curriculum</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-tag-web-design col" data-bss-type="blog-loop-item">
|
||||
<div class="card"><a href="web-design/peter-bell-music.html"><img width="1910" height="880" class="card-img-top rainbow-border" src="../assets/img/projects/peter_bell%20music/peter_bell_music.png"></a>
|
||||
<div class="card-body"><a href="web-design/peter-bell-music.html">
|
||||
<h4 class="text-body">Peter Bell Music</h4>
|
||||
</a>
|
||||
<p class="card-text">A modern responsive website with the ability to display, broadcast and sell created pieces of work</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-tag-web-design col" data-bss-type="blog-loop-item">
|
||||
<div class="card"><a href="web-design/st-thomas-church-keresley.html"><img width="1910" height="880" class="card-img-top rainbow-border" src="../assets/img/projects/keresley_church/keresleychurch.png"></a>
|
||||
<div class="card-body"><a href="web-design/st-thomas-church-keresley.html">
|
||||
<h4 class="text-body">St Thomas' Church Keresley</h4>
|
||||
</a>
|
||||
<p class="card-text">A responsive and dynamic website including historical archives for public access.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="d-flex justify-content-center mt-3" data-bss-type="blog-loop-pagination">
|
||||
<ul class="pagination">
|
||||
<li class="page-item disabled" data-type="prev" data-page="1"><a class="page-link" aria-label="Previous" href="#"><span aria-hidden="true">«</span></a></li>
|
||||
<li class="page-item active" data-type="regular" data-page="1"><a class="page-link" href="#">1</a></li>
|
||||
<li class="page-item disabled" data-type="next" data-page="1"><a class="page-link" aria-label="Next" href="#"><span aria-hidden="true">»</span></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
<footer class="text-body bg-body" id="Light-Footer" data-bs-theme="light">
|
||||
<div class="container py-4 py-lg-5">
|
||||
<div class="container py-4 py-lg-5 center-everything">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-4 col-md-3 text-center text-lg-start d-flex flex-column">
|
||||
<h3 class="fs-6 text-center text-body" style="font-weight: bold;">Accreditations</h3>
|
||||
@@ -211,7 +248,7 @@
|
||||
<div class="swiper-slide"><a href="https://www.credly.com/badges/f0f27d87-424b-49e8-a444-95086d640e66/public_url" target="_blank"><img class="img-fluid w-100 accreditation" width="352" height="352" src="../assets/img/accreditations/mta_windows_operating_system_fundamentals_certified_2016.png" alt="Slide Image"></a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-nav-standalone d-flex justify-content-center" data-bss-swiper-target="#light-swiper">
|
||||
<div class="swiper-nav-standalone d-flex justify-content-center" data-bss-swiper-target="#light-swiper" style="margin-top: 0.5em;">
|
||||
<div class="swiper-button-prev"><button class="btn btn-primary btn-sm" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-arrow-left">
|
||||
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8"></path>
|
||||
</svg></button></div>
|
||||
@@ -223,13 +260,13 @@
|
||||
<div class="col-sm-4 col-md-3 text-center text-lg-start d-flex flex-column"></div>
|
||||
<div class="col-sm-4 col-md-3 text-center text-lg-start d-flex flex-column"></div>
|
||||
<div class="col-lg-3 text-center text-lg-start d-flex flex-column align-items-center order-first align-items-lg-start order-lg-last">
|
||||
<div class="fw-bold d-flex align-items-center mb-2"><img src="../assets/img/brand/logo.png" style="width: 100px;height: 100px;" width="50" height="50" class="footer-logo-white"><span>Mr A Davis</span></div>
|
||||
<div class="fw-bold d-flex align-items-center mb-2"><img src="../assets/img/brand/ADCM%20Logo%202025.png" style="width: 100px;height: 100px;" width="50" height="50" class="footer-logo-white"><span>Mr A Davis</span></div>
|
||||
<p>IT professional and Head of Computing in the West Midlands</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="d-flex justify-content-between align-items-center pt-3">
|
||||
<p class="mb-0">Copyright © 2025 ADCM Networks</p>
|
||||
<p class="mb-0" style="margin-left: 2em;">Copyright © 2025 ADCM Networks</p>
|
||||
<ul class="list-inline mb-0">
|
||||
<li class="list-inline-item"><a href="https://mstdn.social/@MrDavisCSIT"><svg xmlns="http://www.w3.org/2000/svg" viewBox="-32 0 512 512" width="1em" height="1em" fill="currentColor" class="text-body">
|
||||
<!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. -->
|
||||
@@ -254,7 +291,7 @@
|
||||
</div>
|
||||
</footer>
|
||||
<footer class="text-body bg-body" id="Dark-Footer" data-bs-theme="dark">
|
||||
<div class="container py-4 py-lg-5">
|
||||
<div class="container py-4 py-lg-5 center-everything">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-4 col-md-3 text-center text-lg-start d-flex flex-column">
|
||||
<h3 class="fs-6 text-center text-body">Accreditations</h3>
|
||||
@@ -281,7 +318,7 @@
|
||||
<div class="swiper-slide"><a href="https://www.credly.com/badges/f0f27d87-424b-49e8-a444-95086d640e66/public_url" target="_blank"><img class="img-fluid w-100 accreditation" width="352" height="352" src="../assets/img/accreditations/mta_windows_operating_system_fundamentals_certified_2016.png" alt="Slide Image"></a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-nav-standalone d-flex justify-content-center" data-bss-swiper-target="#dark-swiper">
|
||||
<div class="swiper-nav-standalone d-flex justify-content-center" data-bss-swiper-target="#dark-swiper" style="margin-top: 0.5em;">
|
||||
<div class="swiper-button-prev"><button class="btn btn-primary btn-sm" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-arrow-left">
|
||||
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8"></path>
|
||||
</svg></button></div>
|
||||
@@ -300,7 +337,7 @@
|
||||
</div>
|
||||
<hr>
|
||||
<div class="d-flex justify-content-between align-items-center pt-3">
|
||||
<p class="mb-0">Copyright © 2025 ADCM Networks</p>
|
||||
<p class="mb-0" style="margin-left: 2em;">Copyright © 2025 ADCM Networks</p>
|
||||
<ul class="list-inline mb-0">
|
||||
<li class="list-inline-item"><a href="https://mstdn.social/@MrDavisCSIT"><svg xmlns="http://www.w3.org/2000/svg" viewBox="-32 0 512 512" width="1em" height="1em" fill="currentColor" class="text-body">
|
||||
<!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. -->
|
||||
@@ -324,6 +361,406 @@
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<script>
|
||||
(function() {
|
||||
let collections = document.querySelectorAll('[data-bss-type="blog-loop"]');
|
||||
let tagNavs = document.querySelectorAll('[data-bss-type="tag-nav"]');
|
||||
let tagLoops = document.querySelectorAll('[data-bss-type="tag-loop"]');
|
||||
let authorLoops = document.querySelectorAll('[data-bss-type="author-loop"]');
|
||||
let authorNavs = document.querySelectorAll('[data-bss-type="author-nav"]');
|
||||
|
||||
window.addEventListener("popstate", (e) => {
|
||||
for (let collection of collections) {
|
||||
updateCollection(collection);
|
||||
}
|
||||
|
||||
for (let tagNav of tagNavs) {
|
||||
updateTagNav(tagNav);
|
||||
}
|
||||
|
||||
for (let authorNav of authorNavs) {
|
||||
updateAuthorNav(authorNav);
|
||||
}
|
||||
});
|
||||
|
||||
for (let collection of collections) {
|
||||
|
||||
updateCollection(collection);
|
||||
|
||||
if (!canPaginateCollection(collection)) continue;
|
||||
|
||||
let pagination = collection.querySelector('[data-bss-type="blog-loop-pagination"]');
|
||||
|
||||
pagination.addEventListener('click', function(e) {
|
||||
let paginationItem = e.target.closest('.page-item');
|
||||
if (!paginationItem) return;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if (paginationItem.classList.contains('disabled') || paginationItem.classList.contains('active')) return;
|
||||
|
||||
let collection = paginationItem.closest('[data-bss-type="blog-loop"]');
|
||||
if (!collection) return;
|
||||
|
||||
let page = parseInt(paginationItem.dataset.page);
|
||||
if (!page) return;
|
||||
|
||||
let pageParam = getPageParameter(collection);
|
||||
|
||||
if (pageParam) {
|
||||
const url = new URL(window.location);
|
||||
url.searchParams.set(pageParam, page);
|
||||
history.pushState({
|
||||
[pageParam]: page
|
||||
}, document.title, url);
|
||||
|
||||
for (let c of collections) {
|
||||
let param = getPageParameter(c);
|
||||
if (param !== pageParam) continue;
|
||||
updateCollection(c);
|
||||
}
|
||||
} else {
|
||||
updateCollection(collection, page);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (let tagNav of tagNavs) {
|
||||
updateTagNav(tagNav);
|
||||
tagNav.addEventListener('click', onTagClick);
|
||||
}
|
||||
|
||||
for (let tagLoop of tagLoops) {
|
||||
tagLoop.addEventListener('click', onTagClick);
|
||||
}
|
||||
|
||||
for (let authorLoop of authorLoops) {
|
||||
authorLoop.addEventListener('click', onAuthorClick);
|
||||
}
|
||||
|
||||
for (let authorNav of authorNavs) {
|
||||
updateAuthorNav(authorNav);
|
||||
}
|
||||
|
||||
function onTagClick(e) {
|
||||
onBlogFilterClick(e);
|
||||
|
||||
for (let nav of tagNavs) {
|
||||
updateTagNav(nav);
|
||||
}
|
||||
}
|
||||
|
||||
function onAuthorClick(e) {
|
||||
onBlogFilterClick(e);
|
||||
|
||||
for (let authorNav of authorNavs) {
|
||||
updateAuthorNav(authorNav);
|
||||
}
|
||||
}
|
||||
|
||||
function onBlogFilterClick(e) {
|
||||
const item = e.target.closest('[data-bss-filter="blog"]');
|
||||
if (!item || !item.dataset.hasOwnProperty('bssHref') || !item.dataset.hasOwnProperty('bssFilterParam')) return;
|
||||
|
||||
const stateNode = item.dataset.hasOwnProperty('bssStateNode') ? item : item.querySelector('[data-bss-state-node]');
|
||||
|
||||
if (stateNode && (stateNode.classList.contains('disabled') || stateNode.classList.contains('active'))) {
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
const link = item.dataset.bssHref;
|
||||
if (!linksToCurrentPage(link)) return;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
const url = new URL(window.location);
|
||||
const filterParam = item.dataset.bssFilterParam;
|
||||
const filterValue = item.dataset.bssFilterValue || '';
|
||||
|
||||
const collectionsToUpdate = [];
|
||||
const newQueryParams = {
|
||||
[filterParam]: filterValue
|
||||
};
|
||||
|
||||
for (let c of collections) {
|
||||
if (!canFilterCollection(c)) continue;
|
||||
collectionsToUpdate.push(c);
|
||||
|
||||
let pageParam = getPageParameter(c);
|
||||
let page = url.searchParams.get(pageParam);
|
||||
if (page === null || page == 1) continue;
|
||||
|
||||
newQueryParams[pageParam] = 1;
|
||||
}
|
||||
|
||||
for (let param in newQueryParams) {
|
||||
if (newQueryParams[param]) {
|
||||
url.searchParams.set(param, newQueryParams[param]);
|
||||
} else {
|
||||
url.searchParams.delete(param);
|
||||
}
|
||||
}
|
||||
|
||||
history.pushState(newQueryParams, document.title, url);
|
||||
|
||||
for (let c of collectionsToUpdate) {
|
||||
updateCollection(c);
|
||||
}
|
||||
}
|
||||
|
||||
function getCollectionFilters(collection) {
|
||||
let filters = [];
|
||||
|
||||
try {
|
||||
const parsed = JSON.parse(collection.dataset.bssFilters);
|
||||
|
||||
if (Array.isArray(parsed)) {
|
||||
filters = parsed;
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
return filters;
|
||||
}
|
||||
|
||||
function getCollectionEmptyFilterAction(collection, filter = '') {
|
||||
let emptyFilterActions = [];
|
||||
|
||||
try {
|
||||
const parsed = JSON.parse(collection.dataset.bssEmptyFilterActions);
|
||||
|
||||
if (Array.isArray(parsed)) {
|
||||
emptyFilterActions = parsed;
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
const action = emptyFilterActions.find(action => action.filter === filter);
|
||||
|
||||
return action ? action.value : '';
|
||||
}
|
||||
|
||||
function canFilterCollection(collection) {
|
||||
return !!getCollectionFilters(collection).length;
|
||||
}
|
||||
|
||||
function canFilterCollectionByTag(collection) {
|
||||
return getCollectionFilters(collection).includes('tag');
|
||||
}
|
||||
|
||||
function canFilterCollectionByAuthor(collection) {
|
||||
return getCollectionFilters(collection).includes('author');
|
||||
}
|
||||
|
||||
function shouldShowAllItemsForEmptyFilter(collection, filter = '') {
|
||||
return getCollectionEmptyFilterAction(collection, filter) === 'show-all';
|
||||
}
|
||||
|
||||
function canPaginateCollection(collection) {
|
||||
return !!getCollectionPagination(collection);
|
||||
}
|
||||
|
||||
function getCollectionPagination(collection) {
|
||||
return collection.querySelector('[data-bss-type="blog-loop-pagination"]');
|
||||
}
|
||||
|
||||
function getPageParameter(collection) {
|
||||
return collection.dataset.bssPageParam;
|
||||
}
|
||||
|
||||
function linksToCurrentPage(path = '') {
|
||||
let currentURL, url;
|
||||
|
||||
try {
|
||||
currentURL = new URL(window.location);
|
||||
url = new URL(path, window.location.href);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
return currentURL.origin === url.origin && currentURL.pathname === url.pathname;
|
||||
}
|
||||
|
||||
function updateCollection(collection, page, activeTag = '', activeAuthor = '') {
|
||||
|
||||
const url = new URL(window.location.href);
|
||||
|
||||
if (canPaginateCollection(collection)) {
|
||||
if (!page) {
|
||||
let pageParam = getPageParameter(collection);
|
||||
page = (pageParam ? url.searchParams.get(pageParam) : 1) || 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (canFilterCollectionByTag(collection) && !activeTag) {
|
||||
let tagParam = 'tag';
|
||||
activeTag = url.searchParams.get(tagParam) || '';
|
||||
}
|
||||
|
||||
if (canFilterCollectionByAuthor(collection) && !activeAuthor) {
|
||||
let authorParam = 'author';
|
||||
activeAuthor = url.searchParams.get(authorParam) || '';
|
||||
}
|
||||
|
||||
renderCollectionPage(collection, page, activeTag, activeAuthor);
|
||||
}
|
||||
|
||||
function renderCollectionPage(collection, page = 1, activeTag = '', activeAuthor = '') {
|
||||
|
||||
page = Math.max(parseInt(page, 10), 1);
|
||||
|
||||
collection.style.removeProperty('display');
|
||||
|
||||
let loopBase = collection.querySelector('[data-bss-type="blog-loop-base"]');
|
||||
loopBase && loopBase.style.removeProperty('display');
|
||||
|
||||
let emptyState = collection.querySelector('[data-bss-type="empty-state"]');
|
||||
emptyState && emptyState.style.setProperty('display', 'none', 'important');
|
||||
|
||||
let listItems = [].slice.call(collection.querySelectorAll('[data-bss-type="blog-loop-item"]'));
|
||||
listItems.forEach(item => item.style.setProperty('display', 'none', 'important'));
|
||||
|
||||
if (canFilterCollectionByTag(collection)) {
|
||||
listItems = listItems.filter(item => activeTag ? item.classList.contains('post-tag-' + activeTag) : shouldShowAllItemsForEmptyFilter(collection, 'tag'));
|
||||
}
|
||||
|
||||
if (canFilterCollectionByAuthor(collection)) {
|
||||
listItems = listItems.filter(item => activeAuthor ? item.classList.contains('post-author-' + activeAuthor) : shouldShowAllItemsForEmptyFilter(collection, 'author'));
|
||||
}
|
||||
|
||||
let perPage = collection.dataset.bssPerpage || listItems.length;
|
||||
let visibleListItems = listItems.slice((page - 1) * perPage, page * perPage);
|
||||
visibleListItems.forEach(item => item.style.removeProperty('display'));
|
||||
|
||||
let isEmpty = !visibleListItems.length;
|
||||
|
||||
if (isEmpty) {
|
||||
loopBase && loopBase.style.setProperty('display', 'none', 'important');
|
||||
emptyState && emptyState.style.removeProperty('display');
|
||||
}
|
||||
|
||||
let itemCount = listItems.length;
|
||||
let pageCount = Math.max(Math.ceil(itemCount / perPage), 1);
|
||||
|
||||
updateCollectionPagination(collection, page, pageCount, isEmpty);
|
||||
|
||||
if (collection.dataset.bssScrollOnChange) {
|
||||
scrollToCollectionTop(collection);
|
||||
}
|
||||
}
|
||||
|
||||
function updateCollectionPagination(collection, page, pageCount, isEmpty) {
|
||||
let pagination = getCollectionPagination(collection);
|
||||
if (!pagination) return;
|
||||
|
||||
let paginationItems = [].slice.call(pagination.querySelectorAll('.page-item'));
|
||||
|
||||
if (pageCount === 1 || isEmpty) {
|
||||
pagination.style.setProperty('display', 'none', 'important');
|
||||
} else {
|
||||
pagination.style.removeProperty('display');
|
||||
}
|
||||
|
||||
let previousBtnDisabled = page - 1 <= 0;
|
||||
let previousPage = previousBtnDisabled ? 1 : page - 1;
|
||||
|
||||
let nextBtnDisabled = page + 1 > pageCount;
|
||||
let nextPage = nextBtnDisabled ? pageCount : page + 1;
|
||||
|
||||
for (let i = 0; i < paginationItems.length; i++) {
|
||||
let paginationItem = paginationItems[i];
|
||||
|
||||
paginationItem.classList.remove('active', 'disabled');
|
||||
|
||||
if (paginationItem.dataset.type === 'prev') {
|
||||
paginationItem.dataset.page = previousPage;
|
||||
|
||||
if (previousBtnDisabled) {
|
||||
paginationItem.classList.add('disabled');
|
||||
}
|
||||
} else if (paginationItem.dataset.type === 'next') {
|
||||
paginationItem.dataset.page = nextPage;
|
||||
|
||||
if (nextBtnDisabled) {
|
||||
paginationItem.classList.add('disabled');
|
||||
}
|
||||
} else {
|
||||
if (paginationItem.dataset.page > pageCount) {
|
||||
paginationItem.style.setProperty('display', 'none', 'important');
|
||||
} else {
|
||||
paginationItem.style.removeProperty('display');
|
||||
}
|
||||
|
||||
if (paginationItem.dataset.page == page) {
|
||||
paginationItem.classList.add('active');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function scrollToCollectionTop(collection) {
|
||||
const rect = collection.getBoundingClientRect();
|
||||
const viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);
|
||||
const threshold = 100;
|
||||
|
||||
if (rect.top >= 0 && viewHeight - rect.top > threshold) return;
|
||||
|
||||
setTimeout(() => {
|
||||
collection.scrollIntoView({
|
||||
behavior: "smooth",
|
||||
block: "start",
|
||||
inline: "start"
|
||||
});
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function updateTagNav(tagNav) {
|
||||
const url = new URL(window.location.href);
|
||||
|
||||
let tagParam = 'tag';
|
||||
let tag = url.searchParams.get(tagParam) || '';
|
||||
|
||||
renderTagNav(tagNav, tag);
|
||||
}
|
||||
|
||||
function renderTagNav(tagNav, activeTag = '') {
|
||||
if (!tagNav.dataset.bssSyncUrl) return;
|
||||
|
||||
let navItems = [].slice.call(tagNav.querySelectorAll('[data-bss-type="tag-loop-item"]'));
|
||||
|
||||
navItems.forEach(item => {
|
||||
const activeClassNode = item.dataset.hasOwnProperty('bssStateNode') ? item : item.querySelector('[data-bss-state-node]');
|
||||
if (!activeClassNode) return;
|
||||
|
||||
activeClassNode.classList.remove('active');
|
||||
|
||||
const link = item.dataset.bssHref;
|
||||
if (!linksToCurrentPage(link) || activeClassNode.classList.contains('disabled')) return;
|
||||
|
||||
if (item.dataset.bssTag === activeTag) {
|
||||
activeClassNode.classList.add('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateAuthorNav(authorNav) {
|
||||
const url = new URL(window.location.href);
|
||||
|
||||
let authorParam = 'author';
|
||||
let author = url.searchParams.get(authorParam) || '';
|
||||
|
||||
renderAuthorNav(authorNav, author);
|
||||
}
|
||||
|
||||
function renderAuthorNav(authorNav, activeAuthor = '') {
|
||||
if (!canFilterCollectionByAuthor(authorNav)) return;
|
||||
|
||||
authorNav.style.removeProperty('display');
|
||||
|
||||
let items = [].slice.call(authorNav.querySelectorAll('[data-bss-type="author-loop-item"]'));
|
||||
items.forEach(item => item.classList.contains('author-' + activeAuthor) ? item.style.removeProperty('display') : item.style.setProperty('display', 'none', 'important'));
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user