Anpassat till den nya designen där Flask skapar websidor m.h.a. mallar. Webfiler (html, css, js) har flyttats till egna kataloger.

This commit is contained in:
2024-07-25 00:41:50 +02:00
parent f179e8e19b
commit ccc8e73f48
5 changed files with 42 additions and 11 deletions
+18 -5
View File
@@ -1,15 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<title>Frontend</title>
<!-- <title>Frontend</title> -->
</head>
<body>
<script>
<!-- This iframe will hold the content from client.html -->
<iframe id="client-frame" style="width: 100%; height: 100vh;" srcdoc="{{ client_content }}"></iframe>
<!-- Responsive scaling and some padding -->
<script>
const clientFrame = document.getElementById('client-frame');
function resizeIframe() {
clientFrame.style.height = window.innerHeight - 50 + 'px'; // Adjust the subtraction for padding/margins if needed
}
window.addEventListener('resize', resizeIframe);
resizeIframe(); // Call it once on page load
</script>
<script>
const apiEndpoint = '<%= api_endpoint %>'; // Templating syntax (Jinja2)
console.log("API Endpoint:", apiEndpoint);
// Use apiEndpoint in your frontend code...
</script>
</script>
</body>
</html>