View commands.js
Cypress.Commands.add('shouldBeInViewport', { prevSubject: true }, subject => { | |
cy.document().then(doc => { | |
let clientHeight = doc.documentElement.clientHeight | |
let viewportTop = doc.documentElement.scrollTop | |
let viewportBottom = viewportTop + clientHeight | |
let subjectTop = subject[0].offsetTop | |
cy.expect(subjectTop).to.be.at.least(viewportTop) | |
cy.expect(subjectTop).to.be.at.most(viewportBottom) | |
}) |
View coolers-shades.js
let allColors = [[], [], [], [], []] | |
$('.palette-shades-row').each((i, thisRow) => { | |
$(thisRow) | |
.find('.palette-shades-col') | |
.each((j, thisCol) => { | |
allColors[j].push('#' + $(thisCol).data('color')) | |
}) | |
}) |
View editor-style.css
/* step 1: load this in editor-style.css in the theme folder */ | |
/* step 2: activate function "Create CSS classes menu" in tinymce advanced */ | |
/* this gets shown automatically in the formats dropdown */ | |
.MY-CUSTOM-CLASS { | |
background-color:red; | |
} |
View For Sandwiches
for { sandwiches | |
while lettuce => 0 | |
return true; } | |
else (return vicky); |
View RetinaMixin3.less
.retina3(@bg-image, @size: cover, @file-type: 'png'){ | |
background-image: url('@{path}@{bg-image}.@{file-type}'); | |
background-size: @size; | |
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), | |
only screen and (min--moz-device-pixel-ratio: 1.5), | |
only screen and (min-device-pixel-ratio: 1.5) { | |
background-image: url('@{path}@{bg-image}@2x.@{file-type}'); | |
background-size: @size; |
View BlurMixin.less
.blur(@blur) { | |
filter: blur(@blur); | |
-webkit-filter: blur(@blur); | |
} |
View BX-Slider Logo Ticker.html
<section class="logos-bar"> | |
<div class="width-container"> | |
<ul class="logos"> | |
<li> | |
<div><a href="javascript:void(0)"><img src="path/to/logo.png" alt="thumbnail logo" /></div></a> | |
</li> | |
<li> | |
<div><a href="javascript:void(0)"><img src="path/to/logo.png" alt="thumbnail logo" /></div></a> | |
</li> | |
<li> |
View Strip Off Any Protocol from a URL.js
// strip off the protocol | |
url = 'http://twitter.com/mikezarandona'; | |
if ( url.indexOf('://') != -1 ) { | |
url = url.substr( url.indexOf('://') + 3 ); | |
} |
View getURLParameter.js
// Get URL parameters | |
function getURLParameter(name) { | |
name = name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"); | |
var regexS = "[\\?&]"+name+"=([^&#]*)", | |
regex = new RegExp( regexS ), | |
results = regex.exec( window.location.href ) | |
; | |
if( results === null ) { |
View Statamic-Admin-iOS-Install-as-WebApp
<?php | |
$current_user = Auth::getCurrentMember(); | |
$name = $current_user->get('name'); | |
?><!doctype html> | |
<html lang="<?php echo Config::getCurrentLanguage(); ?>"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"> | |
<title>Statamic Control Panel</title> | |
<link rel="stylesheet" href="<?php echo Path::tidy(Config::getSiteRoot().'/'.$app->config['theme_path']) ?>css/ascent.min.css"> |
NewerOlder