From a81992ca04582225e6e4b576bfb8fcf46a7d3344 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Tue, 18 Oct 2022 21:16:05 +0200 Subject: [PATCH] Add countdowns to /design --- resources/views/pages/design.twig | 19 +++++++++++++++++++ src/Controllers/DesignController.php | 21 +++++++++++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/resources/views/pages/design.twig b/resources/views/pages/design.twig index 9b91f1b3..ff3aa181 100644 --- a/resources/views/pages/design.twig +++ b/resources/views/pages/design.twig @@ -299,6 +299,25 @@ +
+

Countdowns

+ + +

Macros

diff --git a/src/Controllers/DesignController.php b/src/Controllers/DesignController.php index bbb8600c..a0490d46 100644 --- a/src/Controllers/DesignController.php +++ b/src/Controllers/DesignController.php @@ -56,10 +56,23 @@ class DesignController extends BaseController $themes = $this->config->get('themes'); $data = [ - 'demo_user' => $demoUser, - 'demo_user_2' => $demoUser2, - 'themes' => $themes, - 'bar_chart' => BarChart::render(...BarChart::generateChartDemoData(23)), + 'demo_user' => $demoUser, + 'demo_user_2' => $demoUser2, + 'themes' => $themes, + 'bar_chart' => BarChart::render(...BarChart::generateChartDemoData(23)), + 'timestamp30m' => time() + 30 * 60, + 'timestamp59m' => time() + 59 * 60, + 'timestamp1h' => time() + 1 * 60 * 60, + 'timestamp1h30m' => time() + 90 * 60, + 'timestamp1h31m' => time() + 91 * 60, + 'timestamp2h' => time() + 2 * 60 * 60, + 'timestamp2d' => time() + 2 * 24 * 60 * 60, + 'timestamp3m' => time() + 3 * 30 * 24 * 60 * 60, + 'timestamp22y' => time() + 22 * 365 * 24 * 60 * 60, + 'timestamp30s' => time() + 30, + + 'timestamp30mago' => time() - 30 * 60, + 'timestamp45mago' => time() - 45 * 60, ]; return $this->response->withView(