File: index-es.html

package info (click to toggle)
schoolkit 0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 328 kB
  • sloc: javascript: 404; sh: 16; makefile: 2
file content (113 lines) | stat: -rw-r--r-- 3,818 bytes parent folder | download
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
<html>  
  <head>  
    <title>Herramientas gráficas mobiles</title>
    <meta charset="utf-8" />
    <script type="text/javascript" src="/javascript/schoolkit/schoolkit.js"></script>
    <style type="text/css"> 
      .svg_container {
          border: 1px solid #aaa;
	  z-index: 10;
	  display: inline-block;
	  vertical-align: top;
      }   
    </style>
  </head>  
  <body>
    <fieldset>
      <legend>Traducciones</legend>
      <div style="display: inline-flex;">
	<a href="index-es.html">
	  <svg viewbox="0 0 45 30" style="width: 45px; height: 30px;">
	    <rect x="0" y="0" width="45" height="30" fill="#ad1519"/>
	    <rect x="0" y="8" width="45" height="14" fill="#fabd00"/>
	  </svg>
	  <br/>
	  Español
	</a>
      </div>
      <div style="display: inline-flex;">
	<a href="index.html">
	  <svg viewbox="0 0 25 15" style="width: 45px; height: 30px;">
	    <rect width="25" height="15" fill="#00247d"/>
	    <path d="M 0,0 L 25,15 M 25,0 L 0,15" stroke="#fff"
		  stroke-width="3"/>
	    <path d="M 12.5,0 V 15 M 0,7.5 H 25" stroke="#fff"
		  stroke-width="5"/>
	    <path d="M 12.5,0 V 15 M 0,7.5 H 25" stroke="#cf142b"
		  stroke-width="3"/>	  </svg>
	  <br/>
	  Inglés
	</a>
      </div>
      <div style="display: inline-flex;">
	<a href="index-fr.html">
	  <svg viewbox="0 0 45 30" style="width: 45px; height: 30px;">
	    <rect x="0" y="0" width="15" height="30" style="fill: #0055ff;"/>
	    <rect x="15" y="0" width="15" height="30" style="fill: #ffffff;"/>
	    <rect x="30" y="0" width="15" height="30" style="fill: #ff4444;"/>
	  </svg>
	  <br/>
	  Francés
	</a>
      </div>
    </fieldset>
    <h1 style="color: orange;">Herramientas gráficas mobiles</h1>
    <h2>Como añadir una herramienta más</h2>
    <p>
      La clase JavaScript GeomToolFromFile permite ajustar objectos
      procediendo de ficheros SVG. Por ejemplo:
    </p>
    <pre>
	let p = new GeomPaper("canvas_container1", 1000, 600);
	let o3 = new GeomToolFromFile(
	  p, "equerre01",
	  "/usr/share/javascript/schoolkit/equerre01.svg",
	  new DOMPoint(300,150),
	  1);
    </pre>
    <p>
      El contenido del fichero SVG será
      <ul>
	<li>Un grupo &lt;g&gt; con el atributo id="layer1";
	  este grupo debe contener respectivamente:</li>
	<li>Un círculo &lt;circle&gt; y su centro, definido por los atributos
	  cx y cy: es el punto de rotación para la herramienta geómetrica;
	  este circulo debe tener el atrributo id="centre";
	</li>
	<li>Cualquier element gráfico, con el atributo
	  id="rotation_handle"; preferiblemente este elemento no invade
	  el centro del círculo, porque controlará arrastrando el ratón,
	  la rotación de la herramienta;
	</li>
	<li>Cualquier element gráfico, con el atributo
	  id="translation_handle" que controlará arrastrando el ratón,
	  la traslación de la herramienta;
	</li>
	<li>
	  Se puede añadir otros elementos  a voluntad.
	</li>
      </ul>
    </p>
    <h2>Demo</h2>
    <div class="svg_container" id="canvas_container1"></div>
    <script>
      let p = new GeomPaper("canvas_container1", 1000, 600);
      p.quadrillage();
      
      let o1 = new GeomToolFromFile(p, "rapporteur01", "/javascript/schoolkit/rapporteur01.svg",
				    new DOMPoint(500,300), 1);
      
      // let o2 = new DoubleDecimetre(p, 105, 100, "dd01")
      // p.addTool(o2, new DOMPoint(100,100), 3);
      let o2 = new GeomToolFromFile(p, "dd01", "/javascript/schoolkit/double_decimetre01.svg",
				    new DOMPoint(100,100), 1);

      let o3 = new GeomToolFromFile(p, "equerre01", "/javascript/schoolkit/equerre01.svg",
				   new DOMPoint(300,150), 1);
    </script>
    <div style="display: inline-block; vertical-align: top;">
      <button onclick="p.rescale(0.8)">-20%</button><br/>
      <button onclick="p.rescale(1.2)">+20%</button>
    </div>
  </body>
</html>