fixes and polish on shortcodes

This commit is contained in:
Nuno Coração 2024-03-06 22:12:58 +00:00
parent 317245e67d
commit 7c0eacf44f
6 changed files with 30 additions and 465 deletions

View file

@ -9,7 +9,6 @@ function _getDefaultPackeryOptions() {
(function init() { (function init() {
$(window).on("load", function () { $(window).on("load", function () {
console.groupCollapsed('[DEBUG] Gallery feature enable');
let packeries = []; let packeries = [];
let nodeGalleries = document.querySelectorAll('.gallery'); let nodeGalleries = document.querySelectorAll('.gallery');
@ -18,8 +17,6 @@ function _getDefaultPackeryOptions() {
let packery = new Packery(nodeGallery, _getDefaultPackeryOptions()); let packery = new Packery(nodeGallery, _getDefaultPackeryOptions());
packeries.push(packery); packeries.push(packery);
}); });
console.log("Galleries founded and initialized with packery", packeries);
console.groupEnd(); console.groupEnd();
}); });
})(); })();

View file

@ -48,23 +48,10 @@ function _registerZendModeButtonClick(zendModeButton) {
(function init() { (function init() {
window.addEventListener("DOMContentLoaded", (event) => { window.addEventListener("DOMContentLoaded", (event) => {
console.debug('[DEBUG] Zen-mode feature enable');
// Register click on 'zen-mode-button' node element // Register click on 'zen-mode-button' node element
const zendModeButton = document.getElementById('zen-mode-button'); const zendModeButton = document.getElementById('zen-mode-button');
if(zendModeButton !== null && zendModeButton !== undefined) { if(zendModeButton !== null && zendModeButton !== undefined) {
_registerZendModeButtonClick(zendModeButton); _registerZendModeButtonClick(zendModeButton);
console.log('[DEBUG] Zen-mode button found');
}else{
console.log('[DEBUG] Zen-mode button not found');
} }
// Initialize localstorage option 'blowfish-zen-mode-enabled' to false, if it does not exist, otherwise enable it.
//if (localStorage.getItem('blowfish-zen-mode-enabled') === null) {
// localStorage.setItem('blowfish-zen-mode-enabled', 'false');
//} else if (localStorage.getItem('blowfish-zen-mode-enabled') === 'true') {
// _toogleZenMode(zendModeButton)
//}
}); });
})(); })();

File diff suppressed because one or more lines are too long

View file

@ -16,14 +16,14 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
<div id="{{ $id }}" class="relative" data-te-carousel-init data-te-ride="carousel"> <div id="{{ $id }}" class="relative" data-twe-carousel-init data-twe-ride="carousel">
<div class="absolute right-0 bottom-0 left-0 z-[2] mx-[15%] mb-10 flex list-none justify-center p-0" <div class="absolute right-0 bottom-0 left-0 z-[2] mx-[15%] mb-10 flex list-none justify-center p-0"
data-te-carousel-indicators> data-twe-carousel-indicators>
{{ $num := 0 }} {{ $num := 0 }}
{{ range $images }} {{ range $images }}
<button type="button" data-te-target="#{{ $id }}" data-te-slide-to="{{ $num }}" {{ if eq $num 0 }} data-te-carousel-active aria-current="true" {{ end }} <button type="button" data-twe-target="#{{ $id }}" data-twe-slide-to="{{ $num }}" {{ if eq $num 0 }} data-twe-carousel-active aria-current="true" {{ end }}
class="mx-[3px] box-content h-[3px] w-[30px] flex-initial cursor-pointer border-0 border-y-[10px] border-solid border-transparent bg-neutral bg-clip-padding p-0 -indent-[999px] opacity-50 transition-opacity duration-[600ms] ease-[cubic-bezier(0.25,0.1,0.25,1.0)] motion-reduce:transition-none" class="mx-[3px] box-content h-[3px] w-[30px] flex-initial cursor-pointer border-0 border-y-[10px] border-solid border-transparent bg-neutral bg-clip-padding p-0 -indent-[999px] opacity-50 transition-opacity duration-[600ms] ease-[cubic-bezier(0.25,0.1,0.25,1.0)] motion-reduce:transition-none"
aria-label="Slide {{ $num }}"></button> aria-label="Slide {{ $num }}"></button>
@ -37,7 +37,7 @@
{{ range $images }} {{ range $images }}
<div class="relative float-left -mr-[100%] {{ if not (eq $num 0) }} hidden {{ end }} w-full transition-transform duration-[{{ $interval }}ms] ease-in-out motion-reduce:transition-none" <div class="relative float-left -mr-[100%] {{ if not (eq $num 0) }} hidden {{ end }} w-full transition-transform duration-[{{ $interval }}ms] ease-in-out motion-reduce:transition-none"
data-te-carousel-item {{ if eq $num 0 }} data-te-carousel-active {{ end }}> data-twe-carousel-item {{ if eq $num 0 }} data-twe-carousel-active {{ end }}>
<div class="ratio-{{ $aspect }} single_hero_background"> <div class="ratio-{{ $aspect }} single_hero_background">
<img src="{{ .RelPermalink }}" class="block absolute top-0 object-cover w-full h-full nozoom" alt="carousel image {{$num}}"/> <img src="{{ .RelPermalink }}" class="block absolute top-0 object-cover w-full h-full nozoom" alt="carousel image {{$num}}"/>
</div> </div>
@ -49,7 +49,7 @@
</div> </div>
<button <button
class="absolute top-0 bottom-0 left-0 z-[2] flex w-[15%] items-center justify-center border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150 ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90 hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none motion-reduce:transition-none" class="absolute top-0 bottom-0 left-0 z-[2] flex w-[15%] items-center justify-center border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150 ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90 hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none motion-reduce:transition-none"
type="button" data-te-target="#{{ $id }}" data-te-slide="prev"> type="button" data-twe-target="#{{ $id }}" data-twe-slide="prev">
<span class="inline-block h-8 w-8"> <span class="inline-block h-8 w-8">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4.5" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4.5"
stroke="currentColor" class="h-6 w-6"> stroke="currentColor" class="h-6 w-6">
@ -61,7 +61,7 @@
</button> </button>
<button <button
class="absolute top-0 bottom-0 right-0 z-[1] flex w-[15%] items-center justify-center border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150 ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90 hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none motion-reduce:transition-none" class="absolute top-0 bottom-0 right-0 z-[1] flex w-[15%] items-center justify-center border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150 ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90 hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none motion-reduce:transition-none"
type="button" data-te-target="#{{ $id }}" data-te-slide="next"> type="button" data-twe-target="#{{ $id }}" data-twe-slide="next">
<span class="inline-block h-8 w-8"> <span class="inline-block h-8 w-8">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4.5" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4.5"
stroke="currentColor" class="h-6 w-6"> stroke="currentColor" class="h-6 w-6">

View file

@ -39,7 +39,6 @@
</div> </div>
<script> <script>
console.log({{ $gitlabURL }})
fetch({{ $gitlabURL }}, { fetch({{ $gitlabURL }}, {
headers: new Headers({ headers: new Headers({
'User-agent': 'Mozilla/4.0 Custom User Agent' 'User-agent': 'Mozilla/4.0 Custom User Agent'
@ -47,7 +46,6 @@
}) })
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
console.log(data)
document.getElementById('{{ $id }}-name_with_namespace').innerHTML = data.name_with_namespace; document.getElementById('{{ $id }}-name_with_namespace').innerHTML = data.name_with_namespace;
document.getElementById('{{ $id }}-description').innerHTML = data.description; document.getElementById('{{ $id }}-description').innerHTML = data.description;
document.getElementById('{{ $id }}-star_count').innerHTML = data.star_count; document.getElementById('{{ $id }}-star_count').innerHTML = data.star_count;

View file

@ -89,7 +89,7 @@
"to": "assets/lib/packery/packery.pkgd.min.js" "to": "assets/lib/packery/packery.pkgd.min.js"
}, },
{ {
"from": "node_modules/tw-elements/dist/js/tw-elements.umd.min.js", "from": "node_modules/tw-elements/js/tw-elements.umd.min.js",
"to": "assets/lib/tw-elements/index.min.js" "to": "assets/lib/tw-elements/index.min.js"
} }
], ],