generated from fastn-stack/fastn-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
typo-exporter.ftd
68 lines (51 loc) · 1.32 KB
/
typo-exporter.ftd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
-- import: fastn-stack.github.io/fastn-js/assets as js-assets
-- string $result: None
-- string $formatted-string: None
-- string $current-json: None
-- void typo-to-ftd(json,store_at,formatted_string):
string json:
string $store_at:
string $formatted_string:
js: [ $js-assets.files.typo.js ]
value = typo_to_ftd(json);
store_at = value[0];
formatted_string = value[1];
-- component json-exporter:
-- ftd.column:
background.solid: black
width: fill-container
height: fill-container
spacing.fixed.px: 20
padding.px: 20
-- ftd.row:
spacing.fixed.px: 15
align-content: center
-- ftd.text-input:
placeholder: Enter typography json
multiline: true
padding-right.px: 10
width.fixed.px: 500
height.fixed.px: 200
$on-input$: $ftd.set-string($a = $current-json, v = $VALUE)
-- ftd.text: Generate FTD code
role: $inherited.types.heading-small
color: $inherited.colors.text-strong
width.fixed.px: 200
$on-click$: $typo-to-ftd(json = $current-json, $store_at = $result, $formatted_string = $formatted-string)
-- end: ftd.row
-- ds.code: Typography FTD code
if: { result != "None" }
lang: ftd
body: $formatted-string
text: $result
download: types.ftd
max-height.fixed.px: 400
-- end: ftd.column
-- end: json-exporter
-- json-exporter:
-- ftd.color code-bg-light:
light: #2b303b
dark: #18181b
-- ftd.color code-bg-dark:
light: #18181b
dark: #2b303b