Skip to content

Instantly share code, notes, and snippets.

View lehni's full-sized avatar

Jürg Lehni lehni

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<!--
Copyright (c) 2014-2017, Jan Bösenberg & Jürg Lehni
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@lehni
lehni / index.html
Last active December 25, 2023 10:49
Paper.js Bézier Offsetting
<!DOCTYPE html>
<html>
<head>
<!--
Copyright (c) 2014-2017, Jan Bösenberg & Jürg Lehni
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
'use strict';
/*function show(a,b) {
var i,nums;
nums = [];
for(i=0; i<a.length; i++) {
nums.push('('+a[i]+'+'+b[i]+'i)');
}
return '['+nums.join(', ')+']';
}
@lehni
lehni / README.md
Last active January 7, 2016 20:26
Paper.js #823: Rendering errors with large coordinates
@lehni
lehni / keybase.md
Last active August 29, 2015 14:06
keybase.md

Keybase proof

I hereby claim:

  • I am lehni on github.
  • I am lehni (https://keybase.io/lehni) on keybase.
  • I have a public key whose fingerprint is 7512 3A4F C59B 5326 8C06 B105 3B67 3665 68D7 29E9

To claim this, I am signing this object:

@lehni
lehni / index.html
Created August 11, 2011 14:01
Paper.js Non-Flocking Tadpoles
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Tadpoles</title>
<script type="text/javascript" src="http://paperjs.org/static/js/paper.js"></script>
<script type="text/javascript" canvas="canvas">
paper.install(window);
window.onload = function() {
paper.setup('canvas');
@lehni
lehni / index.html
Created August 5, 2011 02:02
Paper.js Rounded Rectangles
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Rounded Rectangles</title>
<script type="text/javascript" src="http://paperjs.org/static/js/paper.js"></script>
<script type="text/paperscript" canvas="canvas">
var mousePoint = view.center;
var amount = 25;
var colors = ['red', 'white', 'blue', 'white'];
@lehni
lehni / animframe.js
Created March 13, 2011 21:37
Paul Irish's requestAnimFrame shim improved with suport for element visibility and window blur detection
// requestAnimFrame shim layer by Paul Irish
// Support for element visibility and window blur detection by Juerg Lehni
(function() {
// Chrome shipped without the time arg in m10
var webkitRequest = window.webkitRequestAnimationFrame;
if (webkitRequest) {
webkitRequest(function(time) {
if (time == undefined)
webkitRequest = null;