“When the input
has more than 15 characters, make the border red”
@element 'input' and (min-characters: 16) {
input { border-color: red; }
}
“Increase the height of the textarea
the moment is contains more than 3 lines of text”
(function() { | |
if (typeof EQCSS === 'undefined') { | |
var eq = document.createElement('script'); | |
eq.src = 'http://elementqueries.com/EQCSS.js'; | |
document.body.appendChild(eq); | |
}; | |
var myWidget = document.createElement('section'), | |
widgetStyles = document.createElement('script'), | |
tag = document.querySelectorAll('[src*=\'myWidget\']')[0]; | |
myWidget.innerHTML = '\ |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>SpeedTester</title> | |
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, minimal-ui"> | |
<style type="text/css"> | |
* { | |
box-sizing: border-box; | |
-moz-box-sizing: border-box; |
<?php header('X-Frame-Options: GOFORIT'); ?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>SpeedTester</title> | |
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, minimal-ui"> | |
<style type="text/css"> | |
* { box-sizing: border-box; -moz-box-sizing: border-box; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-kerning: auto; font-family: 'Source Sans Pro', 'Open Sans', Roboto, 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', 'Myriad Pro', 'Segoe UI', Myriad, Helvetica, 'Lucida Grande', 'DejaVu Sans Condensed', 'Liberation Sans', 'Nimbus Sans L', Tahoma, Geneva, Arial, sans-serif; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; cursor: default; } | |
html { font-size: 10pt; background: #ccc; -webkit-text-size-adjust: 100%; } |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title id="site_title"></title> | |
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, minimal-ui"> | |
<link href="style.css" rel="stylesheet" type="text/css"> | |
<link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css"> | |
<link href="//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic,700italic" rel="stylesheet" type="text/css"> | |
<link href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css"> |
data-personas | |
data-default="<?php $dd = get_field_escaped($field); echo $dd; ?>" | |
<?php | |
$field = 'YourTagGoesHere'; | |
if(get_field($field . '_mm')) { | |
$mm = get_field_escaped($field . '_mm'); echo 'data-persona-marketing-maggie="' . $mm . '" '; | |
} else { | |
$mm = get_field_escaped($field); echo 'data-persona-marketing-maggie="' . $mm . '" '; | |
} | |
if(get_field($field . '_tt')) { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>FizzBuzz in JavaScript</title> | |
</head> | |
<body> | |
<script> | |
function fizzBuzz() { // Let's create a function called FizzBuzz | |
var message = '', digit; // We'll start with an empty message, and a placeholder for the digits |
Percent & Dollar inputs, linked to a Range Slider ('-' * 49) With thousands separator for the hundreds
A Pen by Tommy Hodgins on CodePen.
// Add this code to Reddit.com | |
/* Hide the Side */ | |
if (document.getElementsByTagName('html')[0].classList.contains('reddit')) { | |
var input = document.createElement('input'), | |
inputCSS = document.createElement('style'), | |
inputJS = document.createElement('script'); | |
input.id = 'hTS'; | |
input.setAttribute('type','checkbox'); | |
input.setAttribute('onclick','hideTheSide()'); |
// Run code on Youtube.com | |
/* Youtube Cinema Mode */ | |
if (document.getElementsByTagName('html')[0].classList.contains('youtube')) { | |
var input = document.createElement('input'), | |
inputCSS = document.createElement('style'), | |
inputJS = document.createElement('script'); | |
input.id = 'ytCM'; | |
input.setAttribute('type','checkbox'); | |
input.setAttribute('onclick','cinemaMode()'); |