Editando Usuario:Ziggy
Aviso: No has iniciado sesión con una cuenta de usuario.
Tu dirección IP se almacenará en el historial de ediciones de la página.La edición puede deshacerse. Antes de deshacer la edición, comprueba la siguiente comparación para verificar que realmente es lo que quieres hacer, y entonces guarda los cambios para así deshacer la edición.
Revisión actual | Tu texto | ||
Línea 4: | Línea 4: | ||
Skills=software development (programming), wiki (MediaWiki) admin, inspirational writing, RBE10K coordination | Skills=software development (programming), wiki (MediaWiki) admin, inspirational writing, RBE10K coordination | ||
Interests=RBE, earthship (housing), teams support, wiki structure, solar updraft tower (energy), nutrition (food) | Interests=RBE, earthship (housing), teams support, wiki structure, solar updraft tower (energy), nutrition (food) | ||
− | Settler=yes | + | Settler=yes! |
</data> | </data> | ||
Línea 135: | Línea 135: | ||
== Test == | == Test == | ||
− | + | <html> | |
− | <html> | + | <head> |
− | <head> | + | <style> |
− | <style> | + | html { |
− | html { | + | background: url(World-map.jpg) no-repeat center center fixed; |
− | + | -webkit-background-size: cover; | |
− | + | -moz-background-size: cover; | |
− | + | -o-background-size: cover; | |
− | + | background-size: cover; | |
− | + | } | |
− | } | + | </style> |
− | </style> | + | |
− | + | </head> | |
− | </head> | + | <body> |
− | <body> | + | <h2 id=coords>coords</h2><br> |
− | <h2 id=coords>coords</h2><br> | + | <h2 id=imgdata>imgdata</h2> |
− | <h2 id=imgdata>imgdata</h2> | + | <canvas id="canvas" style="display: none;"> |
− | <canvas id="canvas" style="display: none;"> | + | <img style="position: absolute; top: 30%; left:30%; margin-top: -32px; margin-left: -32px;" src="dot.gif"/> |
− | <img style="position: absolute; top: 30%; left:30%; margin-top: -32px; margin-left: -32px;" src="dot.gif"/> | + | |
− | + | <script> | |
− | <script> | + | var img = new Image(); |
− | var img = new Image(); | + | img.src = 'World-map.jpg'; |
− | img.src = 'World-map.jpg'; | + | img.src = img.src + '?' + new Date().getTime(); |
− | img.src = img.src + '?' + new Date().getTime(); | + | img.setAttribute('crossOrigin', ''); |
− | img.setAttribute('crossOrigin', ''); | + | var ctx = canvas.getContext('2d'); |
− | var ctx = canvas.getContext('2d'); | + | //var canvas = document.createElement('canvas'); |
− | //var canvas = document.createElement('canvas'); | + | img.onload = function() { |
− | img.onload = function() { | + | //alert(this.width + 'x' + this.height); |
− | + | canvas.width = this.width; | |
− | + | canvas.height = this.height; | |
− | + | ctx = canvas.getContext('2d'); | |
− | + | //canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height); | |
− | + | ctx.drawImage(img, 0, 0); | |
− | + | ||
− | + | imgdata.innerHTML = "X: " + this.width + ", Y: " + this.height + | |
− | + | ", DX: " + document.body.clientWidth + ", DY: " + document.body.clientHeight; | |
− | + | } | |
− | } | + | |
− | + | function printMousePos(event) { | |
− | function printMousePos(event) { | + | var X = event.clientX; |
− | + | var Y = event.clientY; | |
− | + | var pixelData = ctx.getImageData(X, Y, 1, 1).data; | |
− | + | coords.innerHTML = | |
− | + | "X: " + X + ", Y: " + Y; /* + | |
− | + | ", R: " + pixelData[0] + ", G: " + pixelData[1] + ", B: " + pixelData[2] + ", A: " + pixelData[3]; */ | |
− | + | } | |
− | } | + | document.addEventListener("click", printMousePos); |
− | document.addEventListener("click", printMousePos); | + | |
− | + | </script></body> | |
− | </script></body> | + | </html> |
− | </html> | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
== See also == | == See also == |