Add countdowns to /design

This commit is contained in:
Michael Weimann 2022-10-18 21:16:05 +02:00
parent b860b37ba9
commit a81992ca04
No known key found for this signature in database
GPG Key ID: 34F0524D4DA694A1
2 changed files with 36 additions and 4 deletions

View File

@ -299,6 +299,25 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="col">
<h4>Countdowns</h4>
<ul>
<li data-countdown-ts="{{ timestamp30s }}">30s: %c</li>
<li data-countdown-ts="{{ timestamp30m }}">30m: %c</li>
<li data-countdown-ts="{{ timestamp59m }}">59m: %c</li>
<li data-countdown-ts="{{ timestamp1h }}">1h: %c</li>
<li data-countdown-ts="{{ timestamp1h30m }}">1h 30m: %c</li>
<li data-countdown-ts="{{ timestamp1h31m }}">1h 31m: %c</li>
<li data-countdown-ts="{{ timestamp2h }}">2h: %c</li>
<li data-countdown-ts="{{ timestamp2d }}">2d: %c</li>
<li data-countdown-ts="{{ timestamp3m }}">3m: %c</li>
<li data-countdown-ts="{{ timestamp22y }}">22y: %c</li>
</ul>
<ul>
<li data-countdown-ts="{{ timestamp30mago }}">30m ago: %c</li>
<li data-countdown-ts="{{ timestamp45mago }}">45m ago: %c</li>
</ul>
</div>
</div> </div>
<h2>Macros</h2> <h2>Macros</h2>

View File

@ -60,6 +60,19 @@ class DesignController extends BaseController
'demo_user_2' => $demoUser2, 'demo_user_2' => $demoUser2,
'themes' => $themes, 'themes' => $themes,
'bar_chart' => BarChart::render(...BarChart::generateChartDemoData(23)), '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( return $this->response->withView(