- A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
- lengths are in any unit (ex: pixels)
- code snippets are in JavaScript
angleRad = angleDeg * Math.PI / 180;
Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...
(For more info and other projects, visit http://xem.github.io)
(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
<body style=margin:0> | |
<canvas id=a> | |
<script> | |
// initialize 2D canvas (c) | |
// initialize game state (s) | |
// initialize keys states (u,r,d,l for directions, k for all the keyboard) | |
c=a.getContext`2d`,k=[u=r=d=l=s=0] | |
// (initialize your global variables here) |
<div class="content smallSizeLayout"> | |
<div class="intro" data-stretch-parent-if-n-lines="2" data-stretch-parent=".content" data-bind="css:{ 'bulletHidden': !isVisited()}" id="id_186"> | |
<p data-bind="html:text"><div class="richText"><p>Intro: Lorem ipsum dolor sit, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa</p></div></p> | |
</div> | |
<table class="bulletpoint bulletHidden first"> | |
<tbody> | |
<tr> | |
<td class="bullet-icon"> |
<body oninput='f.srcdoc=t2[v="value"]+"<script>"+t0[v]+"</script><style>"+t1[v]'onload='for(i=3;i--;)e.innerHTML+="<textarea id=t"+i+" rows=9>"'id=e><iframe id=f> |
<body contenteditable oninput=eval(S.textContent)> | |
<h1>Hi! (edit me)</h1> | |
<script style="display:block;border:1px solid;;white-space:pre-wrap" id=S> | |
// JS (edit me) | |
console.log("test"); | |
</script> | |
<style style="display:block;border:1px solid;white-space:pre-wrap"> | |
/* CSS (edit me) */ | |
* { background: #def } | |
</style> |
<pre id=p><script id="s" style="display:block">setInterval(z=` | |
/* =<,m#F^ A W###q. */ ; | |
/* #K q##H######Am */ ; | |
/* dP cpq#q##########b, */ ; | |
/* p##@###YG=[#######y */ ; | |
/* d#qg '*PWo##q#######D */ ; | |
/* aem1k.com Q###KWR#### W[ */ ; | |
/* .Q#########Md#.###OP A@ , */ ; | |
/* , (W#####Xx######.P^ T % */ ; | |
/* #y '^TqW####P###BP */ ; |
content: "..."
, font-family: '...'
)/* ... */
)+ > ~ ; : , ( ) { } /
)
:
in selectors (ex: * :before
!= *:before
)+
and -
in calc(...)
(but not in nth-child and nth-of-type);
(ex: a{color:red;}
)*
in CSS selectors (ex: *:before
=> :before
)0.1%, 1.0%, 0.0px
)0px 0rem 0% 0turn 0vmax 0dpi
)<!-- solution 1, 117b, inspired by http://www.p01.org/releases/140bytes_music_softSynth/ --> | |
<button onclick="new Audio('data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU'+Array(1e3).join(123)).play()">Beep</button> | |
<!-- Solution 2, 107b, inspired by http://xem.github.io/chip8/c8.html --> | |
<button onclick="o=(A=new AudioContext()).createOscillator();o.connect(A.destination);o.start(0);setTimeout('o.stop(0)',500)">Boop</button> |