fix: bugs
This commit is contained in:
parent
2f9872dc8e
commit
2590fa9e64
4 changed files with 18 additions and 8 deletions
10
package-lock.json
generated
10
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "coryd.dev",
|
||||
"version": "17.0.1",
|
||||
"version": "17.0.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "coryd.dev",
|
||||
"version": "17.0.1",
|
||||
"version": "17.0.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@cdransf/api-text": "^1.2.2",
|
||||
|
@ -4904,9 +4904,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/minipass": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz",
|
||||
"integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==",
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
|
||||
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "coryd.dev",
|
||||
"version": "17.0.1",
|
||||
"version": "17.0.2",
|
||||
"description": "The source for my personal site. Built using 11ty.",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
window.onload = () => {
|
||||
const button = document.querySelector('[data-toggle-button]')
|
||||
const content = document.querySelector('[data-toggle-content]')
|
||||
const text = document.querySelectorAll('[data-toggle-content] p')
|
||||
const minHeight = 500 // this needs to match the height set on [data-toggle-content].text-toggle-hidden in text-toggle.css
|
||||
let interiorHeight = 0
|
||||
|
||||
text.forEach(node => interiorHeight += node.scrollHeight)
|
||||
|
||||
if (interiorHeight < minHeight) {
|
||||
content.classList.remove('text-toggle-hidden')
|
||||
button.style.display = 'none'
|
||||
}
|
||||
|
||||
button.addEventListener('click', () => {
|
||||
if (content.classList.contains('text-toggle-hidden')) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[data-toggle-content].text-toggle-hidden {
|
||||
position: relative;
|
||||
height: calc(var(--sizing-3xl) * 5);
|
||||
height: 500px;
|
||||
overflow: hidden;
|
||||
margin-bottom: var(--sizing-base);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
|||
content: '';
|
||||
top: 0;
|
||||
left: 0;
|
||||
box-shadow: inset 0 -100px 50px -60px var(--background-color);
|
||||
box-shadow: inset 0 -120px 50px -60px var(--background-color);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
|
Reference in a new issue