Skip to content

Instantly share code, notes, and snippets.

View ChanMenglin's full-sized avatar

陈孟林 ChanMenglin

  • 中国湖北
  • 17:58 (UTC +08:00)
View GitHub Profile
@ChanMenglin
ChanMenglin / custom-image-slider.markdown
Created November 6, 2018 05:46
Custom Image Slider

Custom Image Slider

Wanted to experiment with this prototype of image slicing and combining the pieces together to create the full image in a slider.

A Pen by Menglin Chen on CodePen.

License.

@ChanMenglin
ChanMenglin / index.slim
Created November 6, 2018 05:42
Pure CSS Barcode (UPC-A)
ul
li.start
li.digit-0
li.digit-4
li.digit-2
li.digit-1
li.digit-0
li.digit-0
li.mid
li.digit-0
@ChanMenglin
ChanMenglin / script.js
Created October 30, 2018 05:27
Spiral horn
const width = window.innerWidth
const height = window.innerHeight
const NS = "http://www.w3.org/2000/svg"
const svg = document.createElementNS(NS, "svg")
const size = Math.min(width, height) * 0.75
svg.setAttribute("viewBox", `0 0 ${size} ${size}`)
svg.setAttribute("width", `${size}px`)
svg.setAttribute("height", `${size}px`)
svg.setAttribute("xmlns", NS)
document.body.appendChild(svg)
@ChanMenglin
ChanMenglin / script.js
Created October 30, 2018 05:27
Sine Freq Spiral
const width = window.innerWidth
const height = window.innerHeight
const NS = "http://www.w3.org/2000/svg"
const svg = document.createElementNS(NS, "svg")
const size = Math.min(width, height) * 0.75
svg.setAttribute("viewBox", `0 0 ${size} ${size}`)
svg.setAttribute("width", `${size}px`)
svg.setAttribute("height", `${size}px`)
svg.setAttribute("xmlns", NS)
document.body.appendChild(svg)
@ChanMenglin
ChanMenglin / index.html
Created October 30, 2018 05:24
Literary Constellations
<body id="body">
<form id="form">
<input autocomplete="off" id="input" type="text">
<button id="button">Go</button>
</form>
<svg version="1.1" baseProfile="full" height="100%" id="canvas" width="100%" xmlns="http://www.w3.org/2000/svg">
<rect id="bg" fill="transparent" />
<g id="constellation"></g>
</svg>
</body>
@ChanMenglin
ChanMenglin / script.js
Created October 30, 2018 05:23
ZIM Zinkle - Animated Squiggles on Blob Path
const frame = new Frame("fit", 1024, 768, "#000", "#111");
frame.on("ready", ()=>{ // ES6 Arrow Function - similar to function(){}
zog("ready from ZIM Frame"); // logs in console (F12 - choose console)
// often need below - so consider it part of the template
let stage = frame.stage;
let stageW = frame.width;
let stageH = frame.height;
// REFERENCES for ZIM at http://zimjs.com
@ChanMenglin
ChanMenglin / index.html
Created October 30, 2018 05:21
The Pythagoras tree
<canvas></canvas>
@ChanMenglin
ChanMenglin / index.html
Created October 30, 2018 05:21
SCSS 3D text mixin
<h1>I&nbsp;am&nbsp;a&nbsp;3D (not&nbsp;really, tho)&nbsp;heading</h1>