105 lines
4.9 KiB
HTML
105 lines
4.9 KiB
HTML
<!DOCTYPE html>
|
||
<!--suppress XmlUnboundNsPrefix -->
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<title>Sheet Divider</title>
|
||
<link rel="stylesheet" href="style.css">
|
||
<script type="text/javascript" src="lib/vue.min.js"></script>
|
||
<script type="text/javascript" src="main.js"></script>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<!-- card related -->
|
||
<!--
|
||
<meta name="twitter:card" content="summary_large_image">
|
||
<meta property="og:title" content="">
|
||
<meta property="twitter:title" content="">
|
||
<meta property="og:description" content="">
|
||
<meta property="twitter:description" content="">
|
||
<meta property="og:image" content="https://.../preview_640x320.jpg">
|
||
<meta property="twitter:image" content="">
|
||
<meta property="org:url" content="https://...">
|
||
-->
|
||
</head>
|
||
<body>
|
||
<main id="app" style="display:none">
|
||
<h1>Sheet Divider</h1>
|
||
<br>
|
||
<div id="table-container">
|
||
<table id="inputs">
|
||
<tr></tr>
|
||
<tr v-bind:class="{focused: focused=='sw'||focused=='sh'||focused=='sheet'}">
|
||
<td>Sheet Size:</td>
|
||
<td><input @focus="setFocus('sw')" v-model="sw" v-bind:disabled="sheet>0" type="number" min="1" step="0.1"></td>
|
||
<td>×</td>
|
||
<td><input @focus="setFocus('sh')" v-model="sh" v-bind:disabled="sheet>0" type="number" min="1" step="0.1"></td>
|
||
<td><small>cm</small></td>
|
||
<td>
|
||
<select v-model="sheet" @focus="setFocus('sheet')">
|
||
<option v-bind:value="i" v-for="s,i in sheets">{{s.title}}</option>
|
||
</select>
|
||
</td>
|
||
</tr>
|
||
<tr v-bind:class="{focused: focused=='m'||focused=='n'}">
|
||
<td>Boxes:</td>
|
||
<td><input @focus="setFocus('m')" v-model="m" type="number" min="1"></td>
|
||
<td>×</td>
|
||
<td><input @focus="setFocus('n')" v-model="n" type="number" min="1"></td>
|
||
<td></td>
|
||
<td></td>
|
||
</tr>
|
||
<tr v-bind:class="{focused: focused=='bw'||focused=='bh'}" v-if="!incomplete">
|
||
<td>Box size:</td>
|
||
<td><input @focus="setFocus('bw')" id="bw" v-model="bw" v-bind:disabled="(finishedH && !bw) || fbw"
|
||
type="number" min="0.1"></td>
|
||
<td>×</td>
|
||
<td><input @focus="setFocus('bh')" id="bh" v-model="bh" v-bind:disabled="(finishedV && !bh) || fbh"
|
||
type="number" min="0.1"></td>
|
||
<td><small>cm</small></td>
|
||
<td><span><input v-model="ratio" type="checkbox">Use ratio</span></td>
|
||
</tr>
|
||
<tr v-bind:class="{focused: focused=='rw'||focused=='rh'}" v-if="ratio && !incomplete">
|
||
<td>Box ratio:</td>
|
||
<td><input @focus="setFocus('rw')" v-model="rw" type="number" min="0.1" step="0.1"></td>
|
||
<td>/</td>
|
||
<td><input @focus="setFocus('rh')" v-model="rh" type="number" min="0.1" step="0.1"></td>
|
||
<td></td>
|
||
<td></td>
|
||
</tr>
|
||
<tr v-bind:class="{focused: focused=='mh'||focused=='mv'}" v-if="!incomplete">
|
||
<td>Box margin:</td>
|
||
<td><input @focus="setFocus('mh')" id="mh" v-model="mh" v-bind:disabled="finishedH && !mh" type="number"
|
||
min="0.1" step="0.1"></td>
|
||
<td><small>cm</small></td>
|
||
<td><input @focus="setFocus('mv')" id="mv" v-model="mv" v-bind:disabled="finishedV && !mv" type="number"
|
||
min="0.1" step="0.1"></td>
|
||
<td><small>cm</small></td>
|
||
<td><span><input v-model="padding" type="checkbox">Sheet padding</span></td>
|
||
</tr>
|
||
<tr v-bind:class="{focused: focused=='ph'||focused=='pv'}" v-if="padding && !incomplete">
|
||
<td>Sheet padding:</td>
|
||
<td><input @focus="setFocus('ph')" id="ph" v-model="ph" v-bind:disabled="finishedH && !ph" type="number"
|
||
min="0.1"></td>
|
||
<td><small>cm</small></td>
|
||
<td><input @focus="setFocus('pv')" id="pv" v-model="pv" v-bind:disabled="finishedV && !pv" type="number"
|
||
min="0.1"></td>
|
||
<td><small>cm</small></td>
|
||
<td></td>
|
||
<td></td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan="5" style="text-align: center"><small>(All sizes in centimeters)</small></td>
|
||
<td>
|
||
<button v-on:click="reset">Reset</button>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
<br>
|
||
<canvas id="preview"></canvas>
|
||
<br>
|
||
<small><a href="https://twitter.com/_klemek" target="_blank">@Klemek</a> - <a href="" target="_blank">Github
|
||
Repository</a> - 2019</small>
|
||
</main>
|
||
</body>
|
||
</html>
|