Files: f9d6722111546ffee8db81eaf805211d19e68f64 / example / index-classic-cal.js
1603 bytesRaw
1 | // run this from the terminal using : |
2 | // npx electro example/index-classic-cal.js |
3 | |
4 | const { h } = require('mutant') |
5 | const compile = require('micro-css') |
6 | |
7 | const Marama = require('../') |
8 | require('../lib/styles-inject')() |
9 | |
10 | const marama = Marama({ |
11 | today: new Date(2018, 6, 12), |
12 | events: [ |
13 | { date: new Date(2018, 3, 4), data: { attending: true } }, |
14 | { date: new Date(2018, 6, 5), data: { attending: true } }, |
15 | { date: new Date(2018, 6, 7), data: { attending: false } }, |
16 | { date: new Date(2018, 6, 17), data: { attending: true } }, |
17 | { date: new Date(2018, 6, 21), data: { attending: false } }, |
18 | { date: new Date(2018, 6, 27), data: { attending: true } } |
19 | ], |
20 | // range: { |
21 | // gte: new Date(2018, 6, 9), |
22 | // lt: new Date(2018, 6, 23) |
23 | // }, |
24 | styles: { |
25 | weekFormat: 'rows', |
26 | showNumbers: true, |
27 | tileRadius: 16, |
28 | tileGap: 8 |
29 | } |
30 | }) |
31 | |
32 | const page = h('div', |
33 | { |
34 | style: { margin: '3rem' } |
35 | }, |
36 | marama |
37 | ) |
38 | |
39 | document.body.appendChild(page) |
40 | |
41 | // |
42 | const mcss = ` |
43 | MaramaDayTile { |
44 | border-radius: 4rem |
45 | |
46 | -past { |
47 | background: none |
48 | color: hsl(0, 0%, 60%) |
49 | |
50 | -events { |
51 | border: 1px solid hsl(0, 0%, 40%) |
52 | |
53 | -attending { |
54 | background: hsl(0, 0%, 40%) |
55 | color: #fff |
56 | } |
57 | } |
58 | } |
59 | |
60 | -future { |
61 | background: none |
62 | |
63 | -events { |
64 | border: 1px solid deepskyblue |
65 | color: deepskyblue |
66 | |
67 | -attending { |
68 | background: deepskyblue |
69 | color: #fff |
70 | } |
71 | } |
72 | } |
73 | |
74 | -range { |
75 | background: deeppink |
76 | |
77 | -future { |
78 | background: deepskyblue |
79 | } |
80 | } |
81 | } |
82 | |
83 | ` |
84 | document.head.appendChild( |
85 | h('style', { innerHTML: compile(mcss) }) |
86 | ) |
87 |
Built with git-ssb-web