From d7c36b28ca8f823b16cd8cdec5679ceca4d0871b Mon Sep 17 00:00:00 2001 From: Russell Martin Date: Fri, 11 Oct 2024 13:16:41 -0400 Subject: [PATCH 1/6] Pin PyScript - PyScript deprecated latest and requires pinning for newer versions --- cookiecutter.json | 3 ++- {{ cookiecutter.format }}/www/index.html | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 5a61c26..24a9c92 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -20,5 +20,6 @@ ], "_extensions": [ "briefcase.integrations.cookiecutter.PythonVersionExtension" - ] + ], + "_jinja2_env_vars": {"lstrip_blocks": true, "trim_blocks": true} } diff --git a/{{ cookiecutter.format }}/www/index.html b/{{ cookiecutter.format }}/www/index.html index 7b5048b..0f67ad5 100644 --- a/{{ cookiecutter.format }}/www/index.html +++ b/{{ cookiecutter.format }}/www/index.html @@ -7,8 +7,8 @@ - - + + {% if cookiecutter.style_framework == "Bootstrap v4.6" %} {% endif %} - - + From 3826339fd230d2dc35f0fc056823ebd8b30d0132 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 12 Oct 2024 16:07:35 +0800 Subject: [PATCH 2/6] Hide error content, and add Briefcase splash screen. --- {{ cookiecutter.format }}/www/index.html | 12 ++++++ .../www/static/css/briefcase.css | 38 ++++++++++++++----- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/{{ cookiecutter.format }}/www/index.html b/{{ cookiecutter.format }}/www/index.html index 0f67ad5..065cced 100644 --- a/{{ cookiecutter.format }}/www/index.html +++ b/{{ cookiecutter.format }}/www/index.html @@ -7,6 +7,14 @@ + + @@ -24,6 +32,10 @@ +
+ Splash screen logo +

Loading...

+
{% if cookiecutter.style_framework == "Bootstrap v4.6" %} - - + + {% if cookiecutter.style_framework == "Bootstrap v4.6" %} import runpy - result = runpy.run_module("{{ cookiecutter.module_name }}", run_name="__main__", alter_sys=True) + result = runpy.run_module( + "{{ cookiecutter.module_name }}", run_name="__main__", alter_sys=True + ) diff --git a/{{ cookiecutter.format }}/www/static/css/briefcase.css b/{{ cookiecutter.format }}/www/static/css/briefcase.css index 72f2d02..0e370f2 100644 --- a/{{ cookiecutter.format }}/www/static/css/briefcase.css +++ b/{{ cookiecutter.format }}/www/static/css/briefcase.css @@ -1,5 +1,5 @@ -/* Make error content invisible */ +/* Prevent stderr appearing on the page. It will still be visible in the console. */ div.py-error { display: none; } From b0e8a7eb66494f9a5e510ac464820f92acfb8353 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 10 Dec 2024 07:47:29 +0800 Subject: [PATCH 4/6] Make the splash image throb. --- .../www/static/css/briefcase.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/{{ cookiecutter.format }}/www/static/css/briefcase.css b/{{ cookiecutter.format }}/www/static/css/briefcase.css index 0e370f2..79eb7c9 100644 --- a/{{ cookiecutter.format }}/www/static/css/briefcase.css +++ b/{{ cookiecutter.format }}/www/static/css/briefcase.css @@ -29,6 +29,20 @@ div#briefcase-splash.hidden { opacity: 0; transition: visibility 0s 0.2s, opacity 0.2s linear; } +div#briefcase-splash img { + animation: throbber 1.5s infinite; +} +@keyframes throbber { + 0% { + transform: scale(1.2); + } + 70% { + transform: scale(1.0); + } + 100% { + transform: scale(1.2); + } +} /******************************************************************* * WARNING: Do not remove or modify this comment block, or add any From 79bee070a3bba971a2d45b5832a2922b4ac49a76 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 10 Dec 2024 07:47:45 +0800 Subject: [PATCH 5/6] Add a templated pyscript.toml. --- {{ cookiecutter.format }}/www/pyscript.toml | 1 + 1 file changed, 1 insertion(+) create mode 100644 {{ cookiecutter.format }}/www/pyscript.toml diff --git a/{{ cookiecutter.format }}/www/pyscript.toml b/{{ cookiecutter.format }}/www/pyscript.toml new file mode 100644 index 0000000..4e7f1f7 --- /dev/null +++ b/{{ cookiecutter.format }}/www/pyscript.toml @@ -0,0 +1 @@ +plugins = ["!error"] From 5021abb379d6404c5ec519270988b3c6ccad8b9f Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Tue, 10 Dec 2024 21:59:02 +0000 Subject: [PATCH 6/6] Remove stderr CSS --- {{ cookiecutter.format }}/www/static/css/briefcase.css | 6 ------ 1 file changed, 6 deletions(-) diff --git a/{{ cookiecutter.format }}/www/static/css/briefcase.css b/{{ cookiecutter.format }}/www/static/css/briefcase.css index 79eb7c9..0438a82 100644 --- a/{{ cookiecutter.format }}/www/static/css/briefcase.css +++ b/{{ cookiecutter.format }}/www/static/css/briefcase.css @@ -1,9 +1,3 @@ - -/* Prevent stderr appearing on the page. It will still be visible in the console. */ -div.py-error { - display: none; -} - /* Splash screen */ div#briefcase-splash { background-color:#999;