diff --git a/internal/http/html/static/css/output.css b/internal/http/html/static/css/output.css index b75a47856..3ed6ff3d3 100644 --- a/internal/http/html/static/css/output.css +++ b/internal/http/html/static/css/output.css @@ -936,10 +936,6 @@ th, td { width: 100%; } -.w-20 { - width: 5rem; -} - .max-w-2xl { max-width: 42rem; } @@ -1361,6 +1357,11 @@ th, td { --tw-shadow: var(--tw-shadow-colored); } +.blur { + --tw-blur: blur(8px); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + .even\:bg-gray-100:nth-child(even) { --tw-bg-opacity: 1; background-color: rgb(243 244 246 / var(--tw-bg-opacity)); @@ -1376,6 +1377,11 @@ th, td { background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } +.hover\:bg-gray-100:hover { + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); +} + .hover\:text-blue-800:hover { --tw-text-opacity: 1; color: rgb(30 64 175 / var(--tw-text-opacity)); diff --git a/internal/http/html/static/js/main.js b/internal/http/html/static/js/main.js index 713c524ec..2740f11c3 100644 --- a/internal/http/html/static/js/main.js +++ b/internal/http/html/static/js/main.js @@ -1,16 +1,35 @@ +// https://daverupert.com/2017/11/happier-html5-forms/ window.addEventListener('load', (e) => { - // https://daverupert.com/2017/11/happier-html5-forms/ - const inputs = document.querySelectorAll("input, select, textarea"); - inputs.forEach(input => { - input.addEventListener( - "invalid", - event => { - input.classList.add("error"); - }, - false - ); - input.addEventListener("blur", function() { - input.checkValidity(); - }); + const inputs = document.querySelectorAll("input, select, textarea"); + inputs.forEach(input => { + input.addEventListener( + "invalid", + event => { + input.classList.add("error"); + }, + false + ); + input.addEventListener("blur", function() { + input.checkValidity(); }); + }); }); + +// https://css-tricks.com/block-links-the-search-for-a-perfect-solution/#method-4-sprinkle-javascript-on-the-second-method +document.addEventListener('alpine:init', () => { + Alpine.data('block_link', (block, link) => ({ + init() { + block.classList.add("cursor-pointer", "hover:bg-gray-100"); + block.addEventListener("click", (e) => { + isTextSelected = window.getSelection().toString(); + if (!isTextSelected) { + location = link; + } + }); + links = block.querySelectorAll("a"); + links.forEach(link => { + link.addEventListener("click", (e) => e.stopPropagation()); + }); + } + })) +}) diff --git a/internal/http/html/static/templates/content/module_list.tmpl b/internal/http/html/static/templates/content/module_list.tmpl index cff55f603..ee90d1056 100644 --- a/internal/http/html/static/templates/content/module_list.tmpl +++ b/internal/http/html/static/templates/content/module_list.tmpl @@ -22,7 +22,7 @@ {{ end }} {{ define "content-list-item" }} -