Skip to content

Instantly share code, notes, and snippets.

View nucliweb's full-sized avatar
⚡
Debugging…

Joan León nucliweb

⚡
Debugging…
View GitHub Profile
@nucliweb
nucliweb / getAverageColourAsRGB.js
Created January 21, 2018 13:46 — forked from olvado/getAverageColourAsRGB.js
Get the average colour of an image in javascript using getImageData in CANVAS
function getAverageColourAsRGB (img) {
var canvas = document.createElement('canvas'),
context = canvas.getContext && canvas.getContext('2d'),
rgb = {r:102,g:102,b:102}, // Set a base colour as a fallback for non-compliant browsers
pixelInterval = 5, // Rather than inspect every single pixel in the image inspect every 5th pixel
count = 0,
i = -4,
data, length;
// return the base colour for non-compliant browsers
@nucliweb
nucliweb / Spirit-feedback.md
Last active November 11, 2017 11:24
Spirit Feedback

Spirit Version

spirit

Bugs list

  • Limit from 0 to 255 when edit values like rgb(255, 0, 255) with drag & drop
  • When I select a key and move the "Current Time" (red line), I can't add a new key until I click on timeline add-key
  • If right click a row to remove property at right of property value, the action is removed timeline 😱
@nucliweb
nucliweb / canvas.md
Last active November 17, 2017 12:20
Notes about resources, references, libraries and people for Canvas talk by Carmen Ansio at Bilbostack 2018
@nucliweb
nucliweb / panorama.html
Last active October 28, 2017 15:10
Frontanería SmashingConf 2017
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@3.2.3/dist/photo-sphere-viewer.min.css">
<style>
html { height: 100%; }
@nucliweb
nucliweb / panorama.html
Last active October 21, 2017 13:30
Frontanería SmashingConf 2017
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@3.2.3/dist/photo-sphere-viewer.min.css">
<style>
html { height: 100%; }
@nucliweb
nucliweb / easings.js
Created October 5, 2017 23:12 — forked from rezoner/easings.js
One argument easing equations
/*
A full list of simple easing equations inspired by GIST from greweb - https://gist.github.com/gre/1650294
Equations source - http://gsgd.co.uk/sandbox/jquery/easing/
*/
{
linear: function(t) {
return t
},
inQuad: function(t) {
@nucliweb
nucliweb / package.json
Last active September 3, 2017 09:59
PostCSS Config
"scripts": {
"postcss": "postcss src/css/index.css -o src/css/styles.css -w",
"build:css": "postcss -e production src/css/index.css -o dist/css/styles.css",
...
}
@nucliweb
nucliweb / graphing.js
Created August 14, 2017 11:03
graphing
// https://grafpaper.glitch.me/
var pixel = {
size: 15,
color: 'rgba(0,0,0,.2)',
stroke: 'rgba(0,0,255,.1)',
};
var isDrawing = false;