Skip to content

Instantly share code, notes, and snippets.

View xavxyz's full-sized avatar
🎋
growing flex

Xavier Cazalot xavxyz

🎋
growing flex
View GitHub Profile
@xavxyz
xavxyz / vscode.json
Last active February 12, 2020 13:12
{
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/cersei/commons": true,
"**/john/commons": true,
"**/scripts/commons": true,
"**/tyrion/commons": true
},
@xavxyz
xavxyz / machine.js
Last active December 12, 2019 17:51
Generated by XState Viz: https://xstate.js.org/viz
// helper functions, dev env only
const {
MISSION_STATUS: { QUALIFICATION, MATCHING, WIN },
MISSION_SELECTION_ANSWER,
SELECTION_STATUS
} = getConstants();
const guards = getGuards();
const mutations = getMutations();
const qualificationStates = {
@xavxyz
xavxyz / machine.js
Last active November 26, 2019 15:34
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
const animation = 'spin 1.6s linear infinite';
const OpticalGradient = props => {
return props.definitions.map(
({ x, y, start, end }) => [
/* linear gradient */
<rect
key="rectangle"
x={x}
y={y}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
const opticalGradient = [
// bottom left rectangle
{x: 0, y: 60, start: 0.5, end: 0 },
// top left rectangle
{x: 0, y: 0, start: 0.5, end: 0.75 },
// top right rectangle
{x: 60, y: 0, start: 0.75, end: 0.9 },
// bottom right rectangle
{x: 60, y: 60, start: 0.9, end: 1 },
];
[/* list of (rectangle + gradient) properties*/].map(
({ rectangle, gradient }) =>
<FancyRectangle
x={rectangle.x}
y={rectangle.y}
width={60}
height={60}
gradientStart={gradient.start}
gradientEnd={gradient.end}
/>
const LoadingSpinner = () => {
return (
<svg viewBox="0 0 120 120">
<circle r={42} cx={60} cy={60} fill="transparent" stroke="#133C99" strokeWidth={6} strokeDasharray="2 9.5" />
<linearGradient id="arc-gradient">
<stop offset="0%" stopOpacity="0" />
<stop offset="49.99%" stopOpacity="0" />
<stop offset="50%" stopColor="#133C99" />
<stop offset="100%" stopColor="#133C99" />
</linearGradient>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
const LoadingSpinner = () => {
return (
<svg viewBox="0 0 120 120">
{/* the shapes making the spinner */}
</svg>
);
}