I generally can’t figure out how to import “.otf” via html, js into obsidian.
I want the clock font to be custom, and everything else in a regular font.
Code:
const container = this.container;
const wrapper = document.createElement("div");
wrapper.style.display = "flex";
wrapper.style.justifyContent = "flex-start";
wrapper.style.marginTop = "-400px";
const timeElement = document.createElement("div");
timeElement.setAttribute("class", "title");
timeElement.setAttribute("style", `
color: #b991f2;
font-size: 36px;
font-weight: bold;
`);
wrapper.appendChild(timeElement);
container.appendChild(wrapper);
function updateClock() {
const now = new Date();
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
const seconds = now.getSeconds().toString().padStart(2, '0');
timeElement.innerText = `${hours}:${minutes}:${seconds}`;
}
updateClock();
setInterval(updateClock, 1000);