font styling, initial model-index implementation

This commit is contained in:
2026-05-28 08:44:23 +08:00
parent c73da9d2ed
commit bd56bd93dc
6 changed files with 41 additions and 10 deletions
Binary file not shown.
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -21,8 +21,8 @@
<h1>Mabulig Web</h1>
</div>
<div id="info">
<h2 id="recordnumbertext">Record Number</h2>
<h1 id="nametext"> Scientific Name</h1>
<h4 id="recordnumbertext">Record Number</h4>
<h2 id="nametext">Scientific Name</h2>
</div>
<script type="module" src="main.js"></script>
</body>
+26 -7
View File
@@ -1,9 +1,26 @@
@font-face {
font-family: "Blender Pro Book";
src: url("fonts/BlenderPro-Bold.woff2") format("woff2"),
url("fonts/BlenderPro-Bold.woff") format("woff");
font-family: "SF Pro Medium";
src: url("fonts/SF-Pro.ttf") format("truetype");
font-weight: normal;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "SF Pro Medium";
src: url("fonts/SF-Pro-Italic.ttf") format("truetype");
font-weight: normal;
font-style: italic;
font-display: swap;
}
@font-face {
font-family: "Blender Pro Bold";
src: url("fonts/BlenderPro-Bold.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}
#info {
position: absolute;
@@ -18,7 +35,7 @@
user-select: none;
pointer-events: none;
z-index: 1; /* TODO Solve this in HTML */
font-family: 'Blender Pro Book';
font-family: 'SF Pro Medium';
font-weight: normal;
font-style: normal;
@@ -37,7 +54,7 @@
user-select: none;
pointer-events: none;
z-index: 1; /* TODO Solve this in HTML */
font-family: 'Blender Pro Book';
font-family: 'Blender Pro Bold';
font-weight: normal;
font-style: normal;
@@ -45,10 +62,12 @@
h1 {
margin: 5px;
/* font-weight: normal !important; */
}
h2 {
margin: 0px;
font-weight: normal !important;
}
h3 {
h4 {
margin: 0px;
}
}
+3 -1
View File
@@ -81,6 +81,7 @@ const params = {
selectedModel: modelPaths['[MBS-2351] Ansonia muelleri'] // default selected option
};
// UPDATE NAME FUNCTION
function updateNameText(name) {
const recordtitleElement = document.getElementById('recordnumbertext');
const titleElement = document.getElementById('nametext');
@@ -94,10 +95,11 @@ function updateNameText(name) {
const trimmedstart = name.slice(16);
const trimmedsciname = trimmedstart.slice(0, -4);
titleElement.textContent = trimmedsciname;
titleElement.style.fontStyle = "italic"; //italicize scientific name
}
// LOADING FUNCTION
// LOAD MODEL FUNCTION
function loadNewModel(url) {
if (currentModel) {
scene.remove(currentModel);
+10
View File
@@ -0,0 +1,10 @@
[
{
"name": "[MBS-2351] Ansonia muelleri",
"variants": {
"posed": "models/MBS-2351 Ansonia muelleri.glb",
"expanded dorsal": "models/MBS-2351 Ansonia muelleri.glb",
"expanded ventral": "models/MBS-2351 Ansonia muelleri.glb"
}
}
]