Skip to content

Commit 66fa6fa

Browse files
Added scrolling and shape selection with labels
1 parent 21f0875 commit 66fa6fa

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

pages/equations.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ input[name=select]:checked ~ label::after {
5555
bottom: 50%;
5656
}
5757

58+
label a {
59+
position: absolute;
60+
inset: 0;
61+
border-radius: inherit;
62+
}
63+
5864
input[name=select] {
5965
display: none;
6066
}
@@ -64,7 +70,7 @@ input[name=select] {
6470
background-color: white;
6571
border-radius: 1em;
6672
width: 100px;
67-
overflow: hidden;
73+
overflow: scroll;
6874
max-height: calc(100vh - 129px - 1em);
6975
}
7076

pages/equations.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ function setup() {
2727
let label = document.createElement('label');
2828
label.setAttribute('for', id);
2929
label.innerText = profiles.rows[i].obj["Name"];
30+
let link = document.createElement('a');
31+
link.href = "#" + database[profiles.rows[i].obj["Name"]].title.replace(" ", "");
32+
link.setAttribute('onclick', 'checkMe(' + (i + 1) + ')');
33+
label.append(link);
3034
div.append(btn, label, document.createElement('br'));
3135
list.append(div);
3236
}
@@ -38,6 +42,7 @@ function setup() {
3842
document.getElementById('board').append(math);
3943
let title = document.createElement('h4');
4044
title.innerHTML = database[elt.obj["Name"]].title;
45+
title.id = title.innerHTML.replace(" ", "");
4146
let main = document.createElement('div');
4247
math.append(title, main);
4348
let pic = document.createElement('img');
@@ -70,4 +75,8 @@ function setup() {
7075
mathjax.src = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js";
7176
mathjax.defer = true;
7277
document.head.appendChild(mathjax);
78+
}
79+
80+
function checkMe(index) {
81+
document.getElementById('radio' + index).checked = true;
7382
}

0 commit comments

Comments
 (0)