-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
98 lines (72 loc) · 2.04 KB
/
index.html
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
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title>Spine Calculator</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html {
background: #999;
}
body {
margin: 1em;
border: 1px solid black;
padding: 1em;
background: #ddd;
font-family: Avenir, "PT Sans", sans-serif;
}
h1 {
margin-top: 0;
}
input[type="number"] {
line-height: 2;
font-size: 100%;
padding-left: 0.5em;
width: 5em;
}
button {
font-size: 100%;
padding: 0.6em;
border: 1px solid green;
border-radius: 0.5em;
/* Rectangle: */
background-color: #A4EEBA;
box-shadow: 0px 0px 1em rgba(0,0,0,0.5) inset;
cursor: pointer;
}
button:hover {
background-color: #61CD81;
}
#result {
margin-top: 1em
}
</style>
<script type="text/javascript"></script>
</head>
<body>
<h1>CreateSpace Spine Calculator</h1>
<p>Enter the page count and obtain the spine width!</p>
<p>Page count: <input id="number" type="number" name=""></p>
<button>→ Calculate</button>
<div id="result"></div>
</body>
<script type="text/javascript" src="jquery.js"></script>
<script>
( function( $ ) {
$( "button" ).on( "click", function() {
var pages = $( "#number" ).val();
var spine = pages * 0.0025;
var output = "Spine width: "+spine+" inch<br>";
var cover = 8.5 + spine;
// Cover width
var output = output + "Cover width: "+cover+" inch<br>";
// With bleed
var output = output + "With bleed: "+(cover + 0.25)+" inch<br>";
// start of right page
var output = output + "Start of right page: "+(4.25 + spine)+" inch<br>";
$( "#result" ).html( output );
});
} )( jQuery );
</script>
</html>