-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathindex.html
More file actions
182 lines (167 loc) · 7.99 KB
/
Copy pathindex.html
File metadata and controls
182 lines (167 loc) · 7.99 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
{% extends "templates/layout.html" %}
{% block body %}
<!-- Design not loaded, show help and examples -->
<template x-if="!design">
<div class="hero-body is-not-design-loaded">
<div class="container">
<p class="title">Drag and drop your design's SVG or open one of the examples below</p>
<p class="subtitle">First time? Checkout the <a href="help.html">docs</a>.</p>
<div class="example-designs">
<template x-for="example in ['example-weasel', 'example-speak', 'example-gear']">
<div class="card">
<div class="card-image">
<figure class="image is-square">
<img x-bind:src="'./images/' + example + '.png'">
</figure>
</div>
<footer class="card-footer">
<a class="card-footer-item" x-on:click="load_example_design('images/' + example + '.svg')">Open</a>
<a class="card-footer-item" x-bind:href="'./images/' + example + '.svg'" target="_blank">.svg</a>
<a class="card-footer-item" x-bind:href="'./images/' + example + '.afdesign'" target="_blank">.afdesign</a>
</footer>
</div>
</template>
</div>
</div>
</div>
</template>
<!-- Design loaded, show interface controls -->
<div class="hero-body is-main is-design-loaded" x-show="design">
<div class="gb-preview">
<div class="gb-preview-canvas">
<canvas id="preview-canvas"></canvas>
</div>
<div class="gb-preview-controls">
<div class="buttons has-addons">
<button class="button is-dark" :class="{'is-active': design.preview_layout == 'back-spread'}" x-on:click="design.preview_layout = 'back-spread'" title="Back spread">
<span class="material-symbols-outlined">more_horiz</span>
</button>
<button class="button is-dark" :class="{'is-active': design.preview_layout == 'back'}" x-on:click="design.preview_layout = 'back'" title="Back">
<span class="material-symbols-outlined">join_left</span>
</button>
<button class="button is-dark" :class="{'is-active': design.preview_layout == 'both'}" x-on:click="design.preview_layout = 'both'" title="Both">
<span class="material-symbols-outlined">join_full</span>
</button>
<button class="button is-dark" :class="{'is-active': design.preview_layout == 'front'}" x-on:click="design.preview_layout = 'front'" title="Front">
<span class="material-symbols-outlined">join_right</span>
</button>
<button class="button is-dark" :class="{'is-active': design.preview_layout == 'front-spread'}" x-on:click="design.preview_layout = 'front-spread'" title="Front spread">
<span class="material-symbols-outlined">more_horiz</span>
</button>
</div>
</div>
</div> <!-- gb-preview -->
<div class="gb-side-panel">
<div class="gb-side-panel-scroll">
<label class="label">DPI</label>
<div class="field has-addons">
<div class="control is-expanded">
<input class="input" type="number" x-model.number="design.dpi" min="1" step="0.1">
</div>
<div class="control">
<button class="button" x-on:click="design.dpi = 72" :class="design.dpi == 72 && 'is-active is-primary'">72</button>
</div>
<div class="control">
<button class="button" x-on:click="design.dpi = 96" :class="design.dpi == 96 && 'is-active is-primary'">96</button>
</div>
<div class="control">
<button class="button" x-on:click="design.dpi = 2540" :class="design.dpi == 2540 && 'is-active is-primary'">2540</button>
</div>
</div>
<label class="label">Size</label>
<div class="field has-addons">
<div class="control">
<input class="input" type="number" x-model.number="design.width_mm" min="1" step="0.01">
</div>
<div class="control">
<a class="button is-static">
x
</a>
</div>
<div class="control">
<input class="input" type="number" x-model.number="design.height_mm" min="1" step="0.01">
</div>
<div class="control">
<a class="button is-static">
mm
</a>
</div>
</div>
<label class="label">Mask color</label>
<div class="field">
<div class="control">
<template x-for="(color, color_name) in mask_colors">
<button class="color-button" x-on:click="design.mask_color = color" :class="design.mask_color == color && 'is-active'" x-bind:style="{'background-color': color}"
x-bind:title="color_name"></button>
</template>
</div>
</div>
<label class="label">Mask opacity</label>
<div class="field">
<div class="control">
<template x-for="(color, color_name) in {'20%': 0.2, '50%': 0.5, '90%': 0.9}">
<button class="color-button" x-on:click="design.mask_opacity = color" :class="design.mask_opacity == color && 'is-active'"
x-bind:style="{'background-color': design.mask_color, 'opacity': color}" x-bind:title="color_name"></button>
</template>
</div>
</div>
<label class="label">Silk color</label>
<div class="field">
<div class="control">
<template x-for="color in silk_colors">
<button class="color-button" x-on:click="design.silk_color = color" :class="design.silk_color == color && 'is-active'" x-bind:style="{'background-color': color}"
x-bind:title="color"></button>
</template>
</div>
</div>
<label class="label">Layers</label>
<div class="field">
<label class="checkbox">
<input type="checkbox" x-model="design.mirror_back_layers">
Mirror back layers
</label>
</div>
<ul class="layer-list">
<template x-for="layer in layers">
<li>
<span class="name" x-text="layer.name"></span>
<a class="toggle" x-on:click="toggle_layer_visibility(layer);">
<span class="material-symbols-outlined" x-text="layer.visible ? 'visibility' : 'visibility_off'"></span>
</a>
</li>
</template>
</ul>
</div>
<div class="gb-side-panel-actions">
<template x-if="!exporting">
<div class="buttons has-addons is-fullwidth">
<button class="button is-primary" x-on:click="export_design('download');" x-bind:disabled="exporting !== false">
<span class="material-symbols-outlined">
download
</span>
</button>
<button class="button is-alt" x-on:click="export_design('clipboard');" x-bind:disabled="exporting !== false">
<span class="material-symbols-outlined">
content_paste
</span>
</button>
</div>
</template>
<template x-if="exporting === true">
<button class="button is-fullwidth is-success is-loading" disabled>
</button>
</template>
<template x-if="exporting === 'done'">
<button class="button is-fullwidth is-success" disabled>
<span>Done!</span>
</button>
</template>
</div>
</div> <!-- gb-side-panel -->
</div> <!-- hero-body -->
{% endblock %}
{% block scripts %}
<script src="scripts/path-data-polyfill.js"></script>
<script type="module" src="scripts/main.js"></script>
<script defer src="scripts/alpine-3.10.4.js"></script>
{% endblock %}