-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
140 lines (125 loc) · 3.14 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
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
<html>
<head>
<title>MyFont-Development</title>
<link rel="stylesheet" type="text/css" href="fonts/fonts.css" />
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
<style>
body {
padding: 30px;
}
#preview{
width: 100%;
}
input[type=range] {
/*removes default webkit styles*/
-webkit-appearance: none;
/*fix for FF unable to apply focus style bug */
border: 1px solid white;
/*requi#c11717 for proper track sizing in FF*/
width: 100%;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #c11717;
margin-top: -4px;
}
input[type=range]:focus {
outline: none;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #ccc;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-moz-range-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #c11717;
}
/*hide the outline behind the border*/
input[type=range]:-moz-focusring{
outline: 1px solid white;
outline-offset: -1px;
}
input[type=range]::-ms-track {
width: 100%;
height: 5px;
/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
background: transparent;
/*leave room for the larger thumb to overflow with a transparent border */
border-color: transparent;
border-width: 6px 0;
/*remove default tick marks*/
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #777;
border-radius: 10px;
}
input[type=range]::-ms-fill-upper {
background: #ddd;
border-radius: 10px;
}
input[type=range]::-ms-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #c11717;
}
input[type=range]:focus::-ms-fill-lower {
background: #888;
}
input[type=range]:focus::-ms-fill-upper {
background: #ccc;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class=" col-md-12">
<h1>MyFont</h1>
<input id="preview" style="font-family:MyFont;font-size:78px; padding:40px;" type="text" id="text" name="text" value="A">
</div>
</div>
<div class="row">
<div class=" col-md-12">
<br><br>
<input style="font-family:MyFont;font-size:78px; padding:40px;" type="range" id="fonts" name="fonts" min="0" max="4" value="0">
</div>
</div>
</div>
<script>
$(function () {
$("#fonts").change(function () {
//alert($(this).val());
console.log($("#preview").css("font-family"));
$("#preview").css("font-family", "MyFont-"+$(this).val());
});
$("#text").keypress(function () {
$("#preview").html($(this).val());
});
});
</script>
</body>
</html>