Skip to content

Instantly share code, notes, and snippets.

View notoriousb1t's full-sized avatar

B1t notoriousb1t

View GitHub Profile
@notoriousb1t
notoriousb1t / index.pug
Created July 15, 2018 13:20
Megaman READY!
.ready
- var t = -1
- var n = -1
.letter.R
while n++ < 10
.block(style={ "--index": ++t, "--angle": (147 * t) % 360, "--sign": t % 2 ? 1 : -1, "grid-area": "a" + (n+1) })
.face.face-1
.face.face-2
.face.face-3
@notoriousb1t
notoriousb1t / index.html
Last active July 18, 2019 12:11
Request Idle Callback Example
<div id="app">
<div>
<button @click="task.start()">Start</button>
<button @click="task.stop()">Stop</button>
</div>
<textarea class="log">{{log}}</textarea>
</div>
@notoriousb1t
notoriousb1t / index.html
Created February 26, 2018 20:06
Split Rainbow
<div class="rainbow">RAINBOW</div>
@notoriousb1t
notoriousb1t / 1. simple.js
Last active March 15, 2018 13:40
Just Animate 3 (API ideas)
/**
* This shortcut function returns a timeline that you could build upon.
* a single value is assumed to be the end value
* this autoplays as it is intended to be fire and forget
*/
JA.to('.target', 800, { opacity: 0 })
@notoriousb1t
notoriousb1t / example.js
Last active January 16, 2018 21:58
Thoughts on Just Animate 3
// declare timeline with references
const t1 = just.timeline({
// false to ignore global definitions for references and props
globals: false,
references: {
entrance: "ease-out"
},
props: {
x: {...} // property definitions
}
@notoriousb1t
notoriousb1t / 1-usage.ts
Last active December 12, 2017 20:19
Proposal for a state machine with devtools tooling
const machine = LIBRARY.StateMachine({
/* ... json data ... */
})
// move to the state
machine.transition('initial')
// move to both states simultaneously
machine.transition(['initial', 'secondary'])
@notoriousb1t
notoriousb1t / index.html
Created September 24, 2016 02:18
Sequencing with Just Animate
<!-- DO NOT REMOVE: imports current just-animate version -->
[[[http://codepen.io/notoriousb1t/pen/bwqqoB]]]
<!-- DO NOT REMOVE: imports current just-animate version -->
<div class="text-center">
<div class="well">
<span id="one" class="step">Step 1</span>
<strong id="two" class="step">Step 2</strong>
<em id="three" class="step">Step 3</em>
<span id="four" class="step">Step 4</span>
# define mapper function
map <- function(list, fn) {
i <- 0;
len <- length(list);
result <- vector(length = len);
while (i < len) {
i <- i + 1;
result[i] <- fn(list[i]);
}