Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 17 additions & 30 deletions {{ cookiecutter.format }}/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,39 @@
<meta property="og:type" content="website">
<meta property="og:image" content="/static/social.png">

<!-- PyScript -->
<!-- Python Backend -->
Comment thread
freakboy3742 marked this conversation as resolved.
Outdated

<script type="module">
// Hide the splash screen when the page is ready.
import { hooks } from "https://pyscript.net/releases/2024.11.1/core.js";
hooks.main.onReady.add(() => {
document.getElementById("briefcase-splash").classList.add("hidden");
});
</script>
<!--@@ python:start @@-->
<!--@@ python:end @@-->

<link rel="stylesheet" href="https://pyscript.net/releases/2024.11.1/core.css">
<script type="module" src="https://pyscript.net/releases/2024.11.1/core.js"></script>
<!-- Toolkit Head Insert (any valid <head> content)-->

<!-- App Style -->
<!--@@ head:start @@-->
<!--@@ head:end @@-->

{% if cookiecutter.style_framework == "Bootstrap v4.6" %}
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"
integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N"
crossorigin="anonymous">
{% elif cookiecutter.style_framework == "Shoelace v2.3" %}
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.3.0/dist/themes/light.css" />
<script type="module"
src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.3.0/dist/shoelace.js"></script>
{% endif %}
<link rel="stylesheet" href="/static/css/briefcase.css">
</head>
<body id="app-placeholder">
<div id="briefcase-splash">
<img src="static/logo-32.png" alt="Splash screen logo">
<p>Loading...</p>
</div>
{% if cookiecutter.style_framework == "Bootstrap v4.6" %}
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct"
crossorigin="anonymous"></script>
{% endif %}

Comment thread
freakboy3742 marked this conversation as resolved.
<!--@@ body-start:start @@-->
<!--@@ body-start:end @@-->


<script type="py" async="false" config="pyscript.toml">
import runpy
result = runpy.run_module(
"{{ cookiecutter.module_name }}", run_name="__main__", alter_sys=True
)
</script>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is (obviously) a PyScript specific insertion - possibly not the actual Python code, but at the very least the <script> tag. It might be worth putting this into Briefcase as one of the insertions, on a body-python inclusion (and maybe rename the python inclusion as head-python)


<!-- Toolkit Body Insert (any valid <script> tags)-->

<!--@@ body-end:start @@-->
<!--@@ body-end:end @@-->

</body>
</html>
12 changes: 7 additions & 5 deletions {{ cookiecutter.format }}/www/static/css/briefcase.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ div#briefcase-splash img {
}
}

/*******************************************************************
* WARNING: Do not remove or modify this comment block, or add any
* content below this block. Briefcase will add content here during
* the build step.
******************* Wheel contributed styles **********************/
/************************* Toolkit styles *************************/

/* WARNING: Do not modify content between the @@ css:start @@ and
@@ css:end @@ markers. */

/*@@ css:start @@*/
/*@@ css:end @@*/