Skip to content

Instantly share code, notes, and snippets.

@mdkq
mdkq / main.js
Created December 2, 2017 01:22
Curl noise ribbons with three.js
var THREE = require('three')
var SimplexNoise = require('simplex-noise')
document.documentElement.style.width = '100%'
document.documentElement.style.height = '100%'
document.body.style.width = '100%'
document.body.style.height = '100%'
document.body.style.margin = '0'
document.body.style.overflow = 'hidden'
var canvas = document.createElement('canvas')
@mdkq
mdkq / scafx
Created November 13, 2017 04:49
bash script for scaffolding web experiments
#!/bin/bash
full=0
while getopts ":n:fm:" opt; do
case ${opt} in
n ) name=$OPTARG
;;
f ) echo "Creating full scaffold"
full=1
;;
m ) modules="$OPTARG "
@mdkq
mdkq / galaxy.js
Created June 30, 2017 00:36
Rotating parallax star galaxy (svg). Tips to clean up code appreciated
window.onload = function() {
var svgNS = "http://www.w3.org/2000/svg"
var svgGroup = document.getElementById("stars");
var galaxy = document.getElementById("galaxy").getBoundingClientRect();
var center = { x: galaxy.width / 2, y: galaxy.height / 2 };
var stars = []
window.onresize = function() {
galaxy = document.getElementById("galaxy").getBoundingClientRect();
center = { x: galaxy.width / 2, y: galaxy.height / 2 };