diff --git a/output/css/instructions.css b/output/css/instructions.css new file mode 100644 index 0000000..e31f6b2 --- /dev/null +++ b/output/css/instructions.css @@ -0,0 +1,20 @@ +header { + text-align: center; +} + +#instructions { + padding: 1em; +} + +.instructions { + display: none; + /* Inconsistent with rest of content */ + font-family: sans-serif; + font-weight: bold; + font-size: 1.25em; + line-height: 1.5; + padding: 2em; + background-color: silver; + border: 2px solid black; + border-radius: 1em; +} diff --git a/output/js/constants.js b/output/js/constants.js index 82b89c4..f313728 100644 --- a/output/js/constants.js +++ b/output/js/constants.js @@ -4,10 +4,10 @@ export const dom = { tbl_communities: () => document.getElementById("tbl_communities"), - td_last_checked: () => document.getElementById("td_last_checked"), + last_checked: () => document.getElementById("last_checked_value"), qr_modal: (communityID) => document.getElementById(`modal_${communityID}`), join_urls: () => document.getElementsByClassName("td_join_url"), - td_summary: () => document.getElementById("td_summary"), + servers_hidden: () => document.getElementById("servers_hidden"), snackbar: () => document.getElementById("copy-snackbar") } diff --git a/output/main.js b/output/main.js index 38a7a46..5580094 100644 --- a/output/main.js +++ b/output/main.js @@ -92,9 +92,8 @@ function hideBadCommunities() { .reduce((a, b) => a + b); } - // Not ideal. Separate element should be allocated for content. - const summary = dom.td_summary(); - summary.innerText += ` (${numberOfHiddenCommunities} hidden)`; + const summary = dom.servers_hidden(); + summary.innerText = `(${numberOfHiddenCommunities} hidden)`; } /** @@ -131,9 +130,8 @@ function setLastChecked(last_checked) { const time_passed_in_seconds = seconds_now - last_checked; const time_passed_in_minutes = Math.floor(time_passed_in_seconds / 60); // time in minutes, rounded down - const timestamp_element = dom.td_last_checked(); - timestamp_element.innerText = - `Last checked ${time_passed_in_minutes} minutes ago.`; + const timestamp_element = dom.last_checked(); + timestamp_element.innerText = `${time_passed_in_minutes} minutes`; } /** diff --git a/output/styles2.css b/output/styles2.css index e66d4a1..26a1c3d 100644 --- a/output/styles2.css +++ b/output/styles2.css @@ -1,4 +1,14 @@ -#headline { text-align: center; } +header { + display: flex; + direction: row; + /* Push items as far apart as possible */ + justify-content: space-between; +} + +#headline { + text-align: center; + flex-grow: 1; +} #tbl_communities { width:100%; } @@ -19,11 +29,23 @@ .copy_button { } -#tbl_footer { width:100%; } +footer { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + text-align: center; +} -#td_summary { text-align: center; } -#td_last_checked { text-align: center; } +footer p { + width: 75%; + margin: .5em; + text-align: center; +} +footer nav a { + margin: 0 .5ch; +} /* */ :root { diff --git a/php/generate-html.php b/php/generate-html.php index d6bfb73..7df70db 100644 --- a/php/generate-html.php +++ b/php/generate-html.php @@ -26,7 +26,9 @@ // This works? Yes, yes it does. // We do this to isolate the environment and include-once triggers, // otherwise we could include the documents in an ob_* wrapper. - $document = `php $phppath`; // should be identical to shell_exec("php $phppath") + + // Same as shell_exec, except we don't have to escape quotes. + $document = `cd "$TEMPLATES_ROOT"; php $phppath`; file_put_contents($docpath, $document); } diff --git a/sites/+components/page-head.php b/sites/+components/page-head.php new file mode 100644 index 0000000..d5bde1f --- /dev/null +++ b/sites/+components/page-head.php @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/sites/+instructions/English.txt b/sites/+instructions/English.txt new file mode 100644 index 0000000..384f2bb --- /dev/null +++ b/sites/+instructions/English.txt @@ -0,0 +1,13 @@ +On mobile: + + +- Click the Copy button to copy the Join URL. +- Open Session, tap the plus button and choose "Join Community". +- Tap the "Enter Community URL" field, paste your URL and tap "Join". + + +On mobile, with this site open on your PC: + +- Click the QR Code button for your chosen community on your PC. +- Open Session, tap the plus button and choose "Join Community". +- Choose "Scan QR Code" at the top and point your phone camera at the QR code. \ No newline at end of file diff --git a/sites/+instructions/Esperanto.txt b/sites/+instructions/Esperanto.txt new file mode 100644 index 0000000..f4d8f48 --- /dev/null +++ b/sites/+instructions/Esperanto.txt @@ -0,0 +1,5 @@ +Ĉe poŝtelefono: + +- Klaki sur la butono "Copy" por kopii la kuniĝa ligilo. +- Malfermi Session-on, frapeti sur la plus-a butono kaj elekti "Kuniĝi komunumon". +- Frapeti sur "Entajpi komunuma liĝilo", elpoŝigi via ligilo kaj frapeti sur "Kuniĝi". \ No newline at end of file diff --git a/sites/index.php b/sites/index.php index f0d7092..2555bb8 100644 --- a/sites/index.php +++ b/sites/index.php @@ -2,7 +2,7 @@ // prerequisite include for sites and components require_once "+getenv.php"; require_once "$PROJECT_ROOT/php/utils/server-utils.php"; - + $rooms_raw = file_get_contents($ROOMS_FILE); $rooms = json_decode($rooms_raw); $rooms_assoc = json_decode($rooms_raw, true); @@ -11,29 +11,84 @@ - - + + Self-updating list of active Session communities -

Session Communities

+
+
+ +
+

Session Communities

- - - - - - - - +
+ +
Copied URL to clipboard. Paste into Session app to join diff --git a/sites/instructions.php b/sites/instructions.php new file mode 100644 index 0000000..a89723e --- /dev/null +++ b/sites/instructions.php @@ -0,0 +1,63 @@ + + + + + + + + + + +
+

Instructions for joining Session Communities

+
+
+ Choose your language: + $file): ?> +
+ + + + + +
+ $file): ?> +

", $content); + $content = str_replace("\n\n", "
", $content); + echo $content; + ?> +
+ +
+
+ + \ No newline at end of file