10 years later #1
3 changed files with 44 additions and 0 deletions
34
source/screens/demo/examples/clock.liquid
Normal file
34
source/screens/demo/examples/clock.liquid
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
title: Clock
|
||||||
|
tags:
|
||||||
|
- demoExample
|
||||||
|
---
|
||||||
|
{% assign pageBase = "../../" -%}
|
||||||
|
{% assign bodyClass = "body_clock" -%}
|
||||||
|
{% layout "hippie/full.liquid" %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<main>
|
||||||
|
<canvas id="clock" width="512" height="512"></canvas>
|
||||||
|
</main>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block script %}
|
||||||
|
{{ block.super -}}
|
||||||
|
<script>
|
||||||
|
// Page script
|
||||||
|
const canvas = document.getElementById('clock');
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
|
function drawRing(x, y, outerRadius, innerRadius, color) {
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(x, y, outerRadius, 0, Math.PI * 2);
|
||||||
|
ctx.arc(x, y, innerRadius, 0, Math.PI * 2, true);
|
||||||
|
ctx.closePath();
|
||||||
|
ctx.fillStyle = color;
|
||||||
|
ctx.fill();
|
||||||
|
}
|
||||||
|
|
||||||
|
drawRing(256, 256, 128, 96, 'black');
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|
@ -14,4 +14,5 @@
|
||||||
@use "modules/songbook/songbook_module";
|
@use "modules/songbook/songbook_module";
|
||||||
@use "modules/demo/demo_module";
|
@use "modules/demo/demo_module";
|
||||||
@use "modules/start";
|
@use "modules/start";
|
||||||
|
@use "modules/clock";
|
||||||
// @use "modules/YOUR-MODULE/YOUR-FILES";
|
// @use "modules/YOUR-MODULE/YOUR-FILES";
|
||||||
|
|
|
||||||
9
source/style/modules/_clock.scss
Normal file
9
source/style/modules/_clock.scss
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
@use "../../hippie-style/hippie";
|
||||||
|
|
||||||
|
.body_clock {
|
||||||
|
main {
|
||||||
|
@extend .sec_main_center;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue