mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-02 15:39:57 +00:00
Implemented functioning full game link https://chatgpt.com/share/692894bc-5a58-800f-b803-eb906c3cec65
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
features:
|
||||
matomo: true
|
||||
css: true
|
||||
desktop: true
|
||||
logout: false
|
||||
css: true
|
||||
matomo: true
|
||||
desktop: true
|
||||
logout: false
|
||||
|
||||
server:
|
||||
csp:
|
||||
|
||||
30
roles/web-app-littlejs/filter_plugins/littlejs.py
Normal file
30
roles/web-app-littlejs/filter_plugins/littlejs.py
Normal file
@@ -0,0 +1,30 @@
|
||||
def littlejs_href(example, protocol, domain):
|
||||
"""
|
||||
Build correct LittleJS example URL based on whether it is a full project
|
||||
or a single-file example.
|
||||
|
||||
:param example: dict with keys 'is_project' and 'file'
|
||||
:param protocol: http or https
|
||||
:param domain: the domain to use (e.g. littlejs.example.com)
|
||||
:return: string URL
|
||||
"""
|
||||
|
||||
file = example.get("file")
|
||||
is_project = example.get("is_project", False)
|
||||
|
||||
if not file:
|
||||
return "#"
|
||||
|
||||
# Full examples: always absolute URL
|
||||
if is_project:
|
||||
return f"{protocol}://{domain}/examples/{file}/"
|
||||
|
||||
# Short examples: internal wrapper
|
||||
return f"{protocol}://{domain}/examples/shorts/base.html?file={file}"
|
||||
|
||||
|
||||
class FilterModule(object):
|
||||
def filters(self):
|
||||
return {
|
||||
"littlejs_href": littlejs_href
|
||||
}
|
||||
@@ -11,12 +11,7 @@
|
||||
|
||||
{% for key, cat in littlejs_examples|dictsort %}
|
||||
{% for ex in cat['items'] %}
|
||||
{% if ex.is_project %}
|
||||
{% set href = "/examples/" ~ ex.file ~ "/" %}
|
||||
{% else %}
|
||||
{% set href = "/examples/shorts/base.html?file=" ~ ex.file %}
|
||||
{% endif %}
|
||||
|
||||
{% set href = ex | littlejs_href(WEB_PROTOCOL, domain) %}
|
||||
<div class="col-12 col-md-6 col-lg-4 col-xl-3">
|
||||
<div class="card app-card h-100">
|
||||
<div class="card-body d-flex flex-column">
|
||||
|
||||
@@ -31,14 +31,8 @@
|
||||
|
||||
<ul class="dropdown-menu dropdown-menu-dark">
|
||||
|
||||
{# FIXED: cat['items'] #}
|
||||
{% for ex in cat['items'] %}
|
||||
{% if ex.is_project %}
|
||||
{% set href = "/examples/" ~ ex.file ~ "/" %}
|
||||
{% else %}
|
||||
{% set href = "/examples/shorts/base.html?file=" ~ ex.file %}
|
||||
{% endif %}
|
||||
|
||||
{% set href = ex | littlejs_href(WEB_PROTOCOL, domain) %}
|
||||
<li>
|
||||
<a class="dropdown-item d-flex align-items-center" href="{{ href }}">
|
||||
<i class="{{ ex.icon }} me-2"></i>{{ ex.name }}
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
# General
|
||||
application_id: "web-app-littlejs"
|
||||
entity_name: "{{ application_id | get_entity_name }}"
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
|
||||
# Features
|
||||
features:
|
||||
css: true
|
||||
matomo: true
|
||||
desktop: true
|
||||
LITTLEJS_HEADLINE: "LittleJS Playground"
|
||||
|
||||
LITTLEJS_HEADLINE: ""
|
||||
|
||||
LITTLEJS_TITLE: "LittleJS Playground – {{ PRIMARY_DOMAIN | upper }}"
|
||||
LITTLEJS_TITLE: "{{ LITTLEJS_HEADLINE }} – {{ PRIMARY_DOMAIN | upper }}"
|
||||
|
||||
# Base repository URL for LittleJS
|
||||
LITTLEJS_REPOSITORY_BASE: "https://github.com/KilledByAPixel/LittleJS"
|
||||
|
||||
Reference in New Issue
Block a user