diff options
author | MDN <actions@users.noreply.github.com> | 2021-06-06 00:57:45 +0000 |
---|---|---|
committer | MDN <actions@users.noreply.github.com> | 2021-06-06 00:57:45 +0000 |
commit | 6781d84b8a98f4c28efebaf7ed15d0666083ef11 (patch) | |
tree | b41358d544b1e542eb075488ec3b95333b11aa1d /files/es/orphaned | |
parent | 32530cee2c4594f72494b9d6862c493aaabc0bac (diff) | |
download | translated-content-6781d84b8a98f4c28efebaf7ed15d0666083ef11.tar.gz translated-content-6781d84b8a98f4c28efebaf7ed15d0666083ef11.tar.bz2 translated-content-6781d84b8a98f4c28efebaf7ed15d0666083ef11.zip |
[CRON] sync translated content
Diffstat (limited to 'files/es/orphaned')
-rw-r--r-- | files/es/orphaned/web/api/element/runtimestyle/index.html | 83 | ||||
-rw-r--r-- | files/es/orphaned/web/css/tools/cubic_bezier_generator/index.html | 321 |
2 files changed, 404 insertions, 0 deletions
diff --git a/files/es/orphaned/web/api/element/runtimestyle/index.html b/files/es/orphaned/web/api/element/runtimestyle/index.html new file mode 100644 index 0000000000..71ff184062 --- /dev/null +++ b/files/es/orphaned/web/api/element/runtimestyle/index.html @@ -0,0 +1,83 @@ +--- +title: Element.runtimeStyle +slug: orphaned/Web/API/Element/runtimeStyle +tags: + - API + - Necesidad de compatibilidad de los navegadores + - Necesidad de compatibilidad de los navegadores móviles + - Necesidad de ejemplo + - Propiedad +translation_of: Web/API/Element/runtimeStyle +original_slug: Web/API/Element/runtimeStyle +--- +<div>{{APIRef("DOM")}}</div> + +<p>{{ Non-standard_header() }}</p> + +<h2 id="Sumario">Sumario</h2> + +<p><span id="result_box" lang="es"><strong><span>Element.runtimeStyle</span></strong> <span>es una</span> <span>propiedad exclusiva</span> <span>similar a</span> <span>{</span><span>{</span><span>domxref</span> <span>(</span><span>"</span><span>HTMLElement.style</span><span>"</span><span>)</span><span>}</span><span>}</span><span>, excepto</span> <span>sus</span> <span>estilos,</span> <span>que tienen</span> <span>mayor precedencia</span> <span>y</span> <span>modificaciön.It</span> <span>no modifica</span> <span>el contenido del atributo</span> </span><code><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style">style</a></code> <span lang="es"><span>.</span> <span>Está disponible en</span> <span>las versiones anteriores de</span> <span>Microsoft</span> <span>Internet Explorer</span><span>.</span></span></p> + +<h2 id="especificación">especificación</h2> + +<p>No forma parte de ninguna especificación.</p> + +<p>Microsoft <a href="https://msdn.microsoft.com/en-us/library/ms535889(v=vs.85).aspx">tiene una descripción en MSDN</a>.</p> + +<h2 id="Browser_Compatibility" name="Browser_Compatibility">Compatibilidad de los Navegadores</h2> + +<p>{{ CompatibilityTable() }}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Función</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Microsoft Edge</th> + <th>Opera</th> + <th>Safari (WebKit)</th> + </tr> + <tr> + <td>Soporte Básico</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + <td>6</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Función</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Phone</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Soporte Básico</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatNo() }}</td> + </tr> + </tbody> +</table> +</div> + +<h2 id="Ver_también">Ver también</h2> + +<ul> + <li>{{domxref("Element.currentStyle")}} </li> +</ul> diff --git a/files/es/orphaned/web/css/tools/cubic_bezier_generator/index.html b/files/es/orphaned/web/css/tools/cubic_bezier_generator/index.html new file mode 100644 index 0000000000..0cb95888b6 --- /dev/null +++ b/files/es/orphaned/web/css/tools/cubic_bezier_generator/index.html @@ -0,0 +1,321 @@ +--- +title: Generador de curvas de bézier +slug: orphaned/Web/CSS/Tools/Cubic_Bezier_Generator +translation_of: Web/CSS/Tools/Cubic_Bezier_Generator +original_slug: Web/CSS/Tools/Cubic_Bezier_Generator +--- +<div id="Tool"> +<div class="hidden"> +<pre class="brush:html"><html> + <canvas id="bezier" width="336" height="336"> + </canvas> + <form> + <label for="x1">x1 = </label><input onchange="updateCanvas();" type="text" maxlength=6 id="x1" value="0.79" class='field'> + <label for="y1">y1 = </label><input onchange="updateCanvas();return true;" type="text" maxlength=6 id="y1" value="0.33" class='field'> + <label for="x2">x2 = </label><input onchange="updateCanvas();return true;" type="text" maxlength=6 id="x2" value="0.14" class='field'> + <label for="y2">y2 = </label><input onchange="updateCanvas();return true;" type="text" maxlength=6 id="y2" value="0.53" class='field'> + <br> + <output id="output">Log</output> + </form> +</html> + </pre> + +<pre class="brush:css">.field { + width: 40px; +} + </pre> + +<pre class="brush:js">function updateCanvas() { + + var x1 = document.getElementById('x1').value; + var y1 = document.getElementById('y1').value; + var x2 = document.getElementById('x2').value; + var y2 = document.getElementById('y2').value; + + drawBezierCurve(x1, y1, x2, y2); +} + +const radius = 4; +// Place needed to draw the rulers +const rulers = 30.5; +const margin = 10.5; +const basic_scale_size = 5; // Size of 0.1 tick on the rulers +var scaling; //LIMITATION: scaling is computed once: if canvas.height/canvas.width change it won't be recalculated +var dragSM = 0; // Drag state machine: 0 = nodrag, others = object being dragged + +function initCanvas() { + // get the canvas element using the DOM + var canvas = document.getElementById('bezier'); + + // Make sure we don't execute when canvas isn't supported + if (canvas.getContext) { + // use getContext to use the canvas for drawing + var ctx = canvas.getContext('2d'); + + scaling = Math.min(canvas.height - rulers - margin, canvas.width - rulers - margin); + + canvas.onmousedown = mouseDown; + canvas.onmouseup = mouseUp; + } else { + alert('You need Safari or Firefox 1.5+ to see this demo.'); + } +} + +function cX(x) { + return x * scaling + rulers; +} + +function reverseX(x) { + return (x - rulers) / scaling; +} + +function lX(x) { + //Used when drawing vertical lines to prevent subpixel blur + var result = cX(x); + return Math.round(result) == result ? result + 0.5 : result; +} + +function cY(y) { + + return (1 - y) * scaling + margin; +} + +function reverseY(y) { + return (margin - y) / scaling + 1; +} + +function lY(y) { + // Used when drawing horizontal lines to prevent subpixel blur + var result = cY(y); + return Math.round(result) == result ? result + 0.5 : result; +} + +function drawBezierCurve(x1, y1, x2, y2) { + + // get the canvas element using the DOM + var canvas = document.getElementById('bezier'); + + // Make sure we don't execute when canvas isn't supported + if (canvas.getContext) { + + // use getContext to use the canvas for drawing + var ctx = canvas.getContext('2d'); + + + + // Clear canvas + ctx.clearRect(0, 0, canvas.width, canvas.height); + + // Draw the rulers + ctx.beginPath(); + ctx.strokeStyle = "black"; + + // Draw the Y axis + ctx.moveTo(cX(0), cY(0)); + ctx.lineTo(cX(1), cY(0)); + ctx.textAlign = "right"; + + for (var i = 0.1; i <= 1; i = i + 0.1) { + ctx.moveTo(-basic_scale_size + cX(0), lY(i)); + if ((i == 0.5) || (i > 0.9)) { + ctx.moveTo(-2 * basic_scale_size + cX(0), lY(i)); + ctx.fillText(Math.round(i * 10) / 10, -3 * basic_scale_size + cX(0), cY(i) + 4); + // Limitation the constant 4 should be font size dependant + } + ctx.lineTo(cX(0), lY(i)); + } + ctx.stroke(); + ctx.closePath(); + ctx.beginPath(); + + // Draw the Y axis label + ctx.save(); + ctx.rotate(-Math.PI / 2); + ctx.textAlign = "left"; + ctx.fillText("Output (Value Ratio)", -cY(0), -3 * basic_scale_size + cX(0)); + ctx.restore(); + + // Draw the X axis + ctx.moveTo(cX(0), cY(0)); + ctx.lineTo(cX(0), cY(1)); + ctx.textAlign = "center"; + for (i = 0.1; i <= 1; i = i + 0.1) { + ctx.moveTo(lX(i), basic_scale_size + cY(0)); + if ((i == 0.5) || (i > 0.9)) { + ctx.moveTo(lX(i), 2 * basic_scale_size + cY(0)); + ctx.fillText(Math.round(i * 10) / 10, cX(i), 4 * basic_scale_size + cY(0)); + // Limitation the constant 4 should be dependant of the font size + } + ctx.lineTo(lX(i), cY(0)); + } + + // Draw the X axis label + ctx.textAlign = "left"; + ctx.fillText("Input (Time Duration Ratio)", cX(0), 4 * basic_scale_size + cY(0)); + // Limitation the constant 4 should be dependant of the font size + ctx.stroke(); + ctx.closePath(); + + // Draw the Bézier Curve + ctx.beginPath(); + ctx.moveTo(cX(0), cY(0)); + ctx.strokeStyle = 'blue'; + ctx.bezierCurveTo(cX(x1), cY(y1), cX(x2), cY(y2), cX(1), cY(1)); + ctx.stroke(); + ctx.closePath(); + + + + // Draw the P2 point (with a line to P0) + ctx.beginPath(); + ctx.strokeStyle = 'red'; + ctx.moveTo(cX(x1), cY(y1)); + ctx.lineTo(cX(0), cY(0)); + ctx.stroke(); + ctx.closePath(); + ctx.beginPath(); + ctx.moveTo(cX(x1), cY(y1)); + ctx.arc(cX(x1), cY(y1), radius, 0, 2 * Math.PI); + ctx.stroke(); + ctx.fillStyle = 'white'; + ctx.fill(); + ctx.closePath(); + + + + // Draw the P3 point (with a line to P1) + ctx.beginPath(); + ctx.strokeStyle = 'red'; + ctx.moveTo(cX(x2), cY(y2)); + ctx.lineTo(cX(1), cY(1)); + ctx.stroke(); + ctx.closePath(); + + ctx.beginPath(); + ctx.moveTo(cX(x2), cY(y2)); + ctx.arc(cX(x2), cY(y2), radius, 0, 2 * Math.PI); + ctx.stroke(); + ctx.fill(); + ctx.closePath(); + + // Draw the P1(1,1) point (with dashed hints) + ctx.beginPath(); + ctx.moveTo(cX(1), cY(1)); + ctx.strokeStyle = 'lightgrey'; + ctx.lineTo(cX(0), cY(1)); + ctx.moveTo(cX(1), cY(1)); + ctx.lineTo(cX(1), cY(0)); + ctx.stroke(); + ctx.closePath(); + + ctx.beginPath(); + ctx.strokeStyle = "black"; + ctx.fillStyle = "black"; + ctx.arc(cX(1), cY(1), radius, 0, 2 * Math.PI); + ctx.fill(); + ctx.stroke(); + ctx.closePath(); + + + // Draw the P0(0,0) point + ctx.beginPath(); + ctx.arc(cX(0), cY(0), radius, 0, 2 * Math.PI); + ctx.fill(); + ctx.stroke(); + ctx.closePath(); + + + } else { + alert('You need Safari or Firefox 1.5+ to see this demo.'); + } +} + +function mouseDown(e) { + + var canvas = document.getElementById('bezier'); + + var x1 = cX(document.getElementById('x1').value); + var y1 = cY(document.getElementById('y1').value); + + var x = e.pageX - canvas.offsetLeft; + var y = e.pageY - canvas.offsetTop; + + var output = document.getElementById('output'); + output.value = "(" + x + "," + y + ") should be (" + x1 + "," + y1 + ")"; + + + if ((x1 + radius >= x) && (x1 - radius <= x) && (y1 + radius >= y) && (y1 - radius <= y)) { + var output = document.getElementById('output'); + output.value = "P1!"; + dragSM = 1; + } + + var x2 = cX(document.getElementById('x2').value); + var y2 = cY(document.getElementById('y2').value); + + if ((x2 + radius >= x) && (x2 - radius <= x) && (y2 + radius >= y) && (y2 - radius <= y)) { + var output = document.getElementById('output'); + output.value = "P2!"; + dragSM = 2; + } + + // If we are starting a drag + if (dragSM != 0) { + canvas.onmousemove = mouseMove; + } +} + +function mouseUp(e) { + + var output = document.getElementById('output'); + output.value = "Mouse up!"; + dragSM = 0; + canvas.onmousemove = null; +} + +function mouseMove(e) { + if (dragSM != 0) { + var canvas = document.getElementById('bezier'); + + var x = e.pageX - canvas.offsetLeft; + var y = e.pageY - canvas.offsetTop; + + var output = document.getElementById('output'); + output.value = "Drag!"; + + if (dragSM == 1) { + var x1 = document.getElementById('x1'); + var y1 = document.getElementById('y1'); + x1.value = reverseX(x); + x1.value = Math.round(x1.value * 10000) / 10000; + y1.value = reverseY(y); + y1.value = Math.round(y1.value * 10000) / 10000; + if (x1.value < 0) { x1.value = 0; } + if (x1.value > 1) { x1.value = 1; } + } else if (dragSM == 2) { + var x2 = document.getElementById('x2'); + var y2 = document.getElementById('y2'); + x2.value = reverseX(x); + x2.value = Math.round(x2.value * 10000) / 10000; + y2.value = reverseY(y); + y2.value = Math.round(y2.value * 10000) / 10000; + if (x2.value < 0) { x2.value = 0; } + if (x2.value > 1) { x2.value = 1; } + } + updateCanvas(); + } +} + +initCanvas(); +updateCanvas(); + </pre> +</div> + +<p>{{draft}}</p> + +<p>Esta es una herramienta de ejemplo que te permitirá editar y ver de manera gráfica una curva de Bézier. Esta no es una herramienta realmente útil, pero ¡lo será!</p> + +<p>{{EmbedLiveSample("Tool", 1000, 2000)}}</p> +</div> + +<p> </p> |