Additions for responsive sidebar pull request (#131)

* - Made the sidebar responsive
- Edited the hero-gradient svg to fix an issue where it would never scale to the full width of the sidebar
- Fixed a bug on Chrome where you'd need to click twice on a category element in the sidebar to see its tools

* - Added hover effect for category button
- Disabled transition built into the n-menu element to display the hover effect for tools items directly instead of after a slight delay

* - Added a tooltip which shows when the title of the tool is truncated

* - Increased sidebar width from 10% to 12.5%
- Changed check truncation calculation for container width to a more accurate variant to fix a bug where a tooltip was shown without the text being truncated

* fixed merge conflicts

* Fixed merge conflict in pnpm lock file

* Another fix for merge conflixt pnpm lock file

---------

Co-authored-by: sharevb <sharevb@gmail.com>
This commit is contained in:
Dark_Phoenix_andsharevb authored and ShareVB committed 2025-07-20 21:01:17 +02:00
1 parent be9d659763
commit aabbfca763
2 files changed
+7 -3

No files matched your search

+5 -1
View File
@@ -23,7 +23,11 @@ async function checkTruncation() {
context.font = `${computedStyle.fontWeight} ${computedStyle.fontSize} ${computedStyle.fontFamily}`; context.font = `${computedStyle.fontWeight} ${computedStyle.fontSize} ${computedStyle.fontFamily}`;
const textWidth = context.measureText(text).width; const textWidth = context.measureText(text).width;
const containerWidth = textRef.value.clientWidth;
// Calculate precise container width by accounting for padding
const containerWidth = textRef.value.clientWidth
- Number.parseFloat(computedStyle.paddingLeft)
- Number.parseFloat(computedStyle.paddingRight);
showTooltip.value = textWidth > containerWidth; showTooltip.value = textWidth > containerWidth;
} }
+2 -2
View File
@@ -29,8 +29,8 @@ const siderWidth = computed(() => {
return 0; return 0;
} }
// Get 10% of window width, but ensure it's at least 240px // Use 12.5% of window width, but ensure it's at least 240px
const tenPercent = windowWidth.value * 0.1; const tenPercent = windowWidth.value * 0.125;
return Math.max(240, tenPercent); return Math.max(240, tenPercent);
}); });
</script> </script>