Improve look of app, ive broken accordion content so will need to fix
This commit is contained in:
@@ -97,12 +97,19 @@ export const StepAccordion = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// You must provide a markdownToHTML() function or use a library like marked.js
|
// Use marked.js for robust Markdown to HTML conversion
|
||||||
|
const renderer = new marked.Renderer();
|
||||||
|
renderer.image = (href, title, text) => {
|
||||||
|
// Add Tailwind classes for styling images
|
||||||
|
return `<img src="${href}" alt="${text}" title="${
|
||||||
|
title || ""
|
||||||
|
}" class="my-2 rounded shadow max-w-full h-auto mx-auto">`;
|
||||||
|
};
|
||||||
|
|
||||||
|
marked.setOptions({ renderer });
|
||||||
|
|
||||||
function markdownToHTML(text) {
|
function markdownToHTML(text) {
|
||||||
return text
|
// Replace escaped newlines from template literals with actual newlines for marked
|
||||||
.replace(/\n/g, "<br>")
|
const processedText = text.replace(/\\n/g, "\n");
|
||||||
.replace(
|
return marked.parse(processedText);
|
||||||
/!\[(.*?)\]\((.*?)\)/g,
|
|
||||||
'<img alt="$1" src="$2" class="my-2 rounded shadow max-w-full">'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -17,6 +17,7 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export async function generateSinogram(
|
|||||||
const theta = (angle * Math.PI) / angles;
|
const theta = (angle * Math.PI) / angles;
|
||||||
|
|
||||||
if (drawAngleCallback) drawAngleCallback(theta);
|
if (drawAngleCallback) drawAngleCallback(theta);
|
||||||
await new Promise((r) => setTimeout(r, 0.01));
|
// await new Promise((r) => setTimeout(r, 0.01)); // Removed for performance
|
||||||
|
|
||||||
ctx.clearRect(0, 0, size, size);
|
ctx.clearRect(0, 0, size, size);
|
||||||
ctx.save();
|
ctx.save();
|
||||||
@@ -167,7 +167,7 @@ export async function reconstructImageFromSinogram(
|
|||||||
}
|
}
|
||||||
|
|
||||||
outputCtx.putImageData(imageData, 0, 0);
|
outputCtx.putImageData(imageData, 0, 0);
|
||||||
await new Promise((r) => setTimeout(r, 1));
|
// await new Promise((r) => setTimeout(r, 1)); // Removed for performance
|
||||||
onFrame(angle, outputCanvas.toDataURL());
|
onFrame(angle, outputCanvas.toDataURL());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user