-
Notifications
You must be signed in to change notification settings - Fork 12
/
example.html
57 lines (41 loc) · 2.09 KB
/
example.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.7.11/fabric.js"></script>
<script type="text/javascript" src="curvedText.js"></script>
<style type="text/css">
canvas { border:1px solid #000; }
.controles { margin:50px 0; }
</style>
<script>
var Example;
$(document).ready(function(){
canvas = new fabric.Canvas('c');
Example = new CurvedText( canvas, {top:70, left:150} );
$('.radiusX, .radiusY, .spacing, .rotate, .align, .fontSize').change(function(){
Example.set( $(this).attr('class'), $(this).val() , true ) ;
});
$('.reverse').change(function(){
Example.set( 'reverse', ( $(this).val() == 'true' ) ) ;
});
$('.text').keyup(function(){
Example.setText( $(this).val() ) ;
});
});
</script>
</head>
<body>
<canvas id="c" width="400" height="200"></canvas>
<br>
<input type="text" class="text" value="Curved text"><br>
Rayon x :<input type="range" min="0" max="100" value="50" class="radiusX" /><br>
Rayon y :<input type="range" min="0" max="100" value="50" class="radiusY" /><br>
Espacement : <input type="range" min="5" max="40" value="20" class="spacing" /><br>
Rotation : <input type="range" min="-180" max="180" value="0" class="rotate" /><br>
inverser le texte : <label><input type="radio" name="reverse" class="reverse" value="true" /> Oui</label> <label><input type="radio" name="reverse" class="reverse" value="false" checked="checked" /> Non</label><br />
Alignement : <label><input type="radio" name="align" class="align" value="left" /> Gauche</label> <label><input type="radio" name="align" class="align" value="center" checked="checked" /> Centré</label> <label><input type="radio" name="align" class="align" value="right" /> Droite</label><br >
Taille du texte : <input type="range" min="3" max="100" value="20" class="fontSize" /><br>
</body>
</html>