Skip to content

Instantly share code, notes, and snippets.

View paceaux's full-sized avatar
🌐
Obsessing with languagey things

Paceaux paceaux

🌐
Obsessing with languagey things
View GitHub Profile
@paceaux
paceaux / dabblet.css
Created December 31, 2014 17:40
Flexboxing lists
/**
* Flexboxing lists
*/
ul{
display:flex;
flex-direction: column;
margin: 0;
padding: 0;
height: 100vh;
@paceaux
paceaux / uiFrame.js
Created January 5, 2015 18:16
return a Tridion view frame as an object
var uiFrame = function (viewName) {
var frameIndex = 0, tridionView;
while (windowFrame = window.top.frames[frameIndex++])
{
if ( (tridionView = windowFrame.$display && windowFrame.$display.getView() ) && tridionView.getId() === viewName)
{
return tridionView;
}
}
console.log(tridionView);
@paceaux
paceaux / StylusFlexFoundation
Created February 5, 2015 04:19
Stylus Flexbox Foundation
[class*="flex"]
display:flex
&[class*="col"]
flex-direction: column;
&[class*="row"]
flex-direction: row;
for prop in space-between space-around center flex-start flex-end
&[class*=\"justify--{prop}\"]
@paceaux
paceaux / stateSelect
Created February 8, 2015 17:44
select Box with all 50 states.
<select class="fieldset__field__select " id="js-state" name="state" title="Select your state" >
<option>State</option>
<option value="AL">AL</option>
<option value="AK">AK</option>
<option value="AZ">AZ</option>
<option value="AR">AR</option>
<option value="CA">CA</option>
<option value="CO">CO</option>
<option value="CT">CT</option>
<option value="DE">DE</option>
@paceaux
paceaux / testvh.js
Created February 19, 2015 21:26
Test if a browser supports VH. Based on the idea from vminpoly: https://github.com/saabi/vminpoly/blob/master/vminpoly.js
supportsVh = function () {
var detector = document.createElement('div'),
winHeight = parseInt(window.innerHeight / 10, 10),
testHeight;
detector.style.height = '10vh'; // set an arbitrarily chosen height
document.getElementsByTagName('body')[0].appendChild(detector); // add the element
testHeight = parseInt(window.getComputedStyle(detector, null).height, 10); //get the computed style of the element
document.getElementsByTagName('body')[0].removeChild(detector); // now remove the element
@paceaux
paceaux / dabblet.css
Last active August 29, 2015 14:19
property order
/**
* property order
*/
html{
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
p {
background: rgba(100,100,100,.2);
@paceaux
paceaux / canvasApp.js
Last active August 29, 2015 14:21
Canvas app. Simple api for creating and drawing on canvas.
var CvsApp = function (selector) {
this.el = document.querySelector(selector);
this.ctx = this.el.getContext('2d');
this.shapes = [];
this.Shape = function (x,y) {
this.path = new Path2D();
this.coords = { x:x, y:y};
this.size = {h:'', w:''};
};
this.addShape = function (shape) {
@paceaux
paceaux / tridionWindow.js
Created August 13, 2015 20:28
Get the Window that contains Tridion and Anguilla
var TridionWindow = function () {
if ($messages) {return window;} else {
for (var i = 0; i<frames.length; i++) {
if (frames[i].$messages) return frames[i];
}
}
}
tridionWindow = tridionWindow();
@paceaux
paceaux / demo.html
Last active September 15, 2015 07:56
Brightness Detection
<section>
<figure class="static">
<img src="img/img1.jpg" data-imgDetect="parentClass" class="static__img"/>
</figure>
<figure class="static">
<img src="img/img2.jpg" data-imgDetect="selfClass" class="static__img"/>
</figure>
<figure class="static">
<img src="img/img3.jpg" data-imgDetect="parentClass" class="static__img"/>
</figure>
@paceaux
paceaux / Wanimate
Created March 9, 2012 06:08
A quick and dirty boilerplate for webkit animations
@-webkit-keyframes blink {
from {
opacity: 0.1;
font-size: 100%;
}
to {
opacity: 1.0;
font-size: 200%;
}
}