Moving from jQuery
Events
// jQuery
$(document).ready(function() {
// code
})
const { PurgeCSS } = require('purgecss'); | |
/** | |
* Remove any CSS not used on the page and inline the remaining CSS in the | |
* <head>. | |
* | |
* @see {@link https://github.com/FullHuman/purgecss} | |
*/ | |
eleventyConfig.addTransform('purge-and-inline-css', async (content, outputPath) => { | |
if (process.env.ELEVENTY_ENV !== 'production' || !outputPath.endsWith('.html')) { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="Modern Unicode Symbols"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Modern Unicode Symbols</title> | |
<style> | |
body { | |
font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; |
/* Modern Font Stacks */ | |
/* System */ | |
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif; | |
/* Times New Roman-based serif */ | |
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; | |
/* A modern Georgia-based serif */ | |
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif; |
<div class="screen"> | |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 92" class="droop"> | |
<path fill="#0070B9" d="M0 0v82.6a1745.7 1745.7 0 00360 0V0H0z"/> | |
<path fill="#FFFFFF" d="M317 7v10h-10V7h10zm13 0a5 5 0 110 10 5 5 0 010-10zm23 0l-6 10-6-10h12z"/> | |
<text fill="#FFFFFF" font-size="20" font-weight="400" letter-spacing=".25"> | |
<tspan x="72" y="54">Good thing happened</tspan> | |
</text> | |
<path fill="#FFFFFF" d="M28.7 38.5c.4.4.4 1 0 1.4l-5 5.1H35a1 1 0 01.1 2H23.5l5.1 5c.4.4.4 1 0 1.4a1 1 0 01-1.3.1h-.1l-6.8-6.8a1 1 0 010-1.3v-.1l6.8-6.8a1 1 0 011.4 0z"/> | |
</svg> | |
<div class="screen"> | |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 92" class="droop"> | |
<path fill="#0070B9" d="M0 0v82.6a1745.7 1745.7 0 00360 0V0H0z"/> | |
<path fill="#FFFFFF" d="M317 7v10h-10V7h10zm13 0a5 5 0 110 10 5 5 0 010-10zm23 0l-6 10-6-10h12z"/> | |
<text fill="#FFFFFF" font-size="20" font-weight="400" letter-spacing=".25"> | |
<tspan x="72" y="54">Share Feedback</tspan> | |
</text> | |
<path fill="#FFFFFF" d="M28.7 38.5c.4.4.4 1 0 1.4l-5 5.1H35a1 1 0 01.1 2H23.5l5.1 5c.4.4.4 1 0 1.4a1 1 0 01-1.3.1h-.1l-6.8-6.8a1 1 0 010-1.3v-.1l6.8-6.8a1 1 0 011.4 0z"/> | |
</svg> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Super Simple JS + CSS Crossfade (SVG)</title> | |
<meta name="description" content="Super Simple JS + CSS Crossfade (SVG)"> | |
<script src="https://code.jquery.com/jquery-2.1.4.js"></script> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="CSS-Only Animated 'Reminder' Placeholders" /> | |
<meta id="viewport" name="viewport" content="initial-scale=1, user-scalable=1, minimum-scale=1, maximum-scale=1" /> | |
<meta charset="utf-8"> | |
<style id="jsbin-css"> | |
* { | |
box-sizing: border-box; | |
margin: 0; |
/*=========== Touch support detection ===========*/ | |
(function detect_touch_support(){ | |
if ("ontouchend" in document) { | |
$('html').addClass('touch'); | |
} else { | |
$('html').addClass('no-touch'); | |
} | |
}()); |
// jQuery
$(document).ready(function() {
// code
})
/* | |
* Vanilla JS - Touch Gestures | |
* @version 0.1 | |
* @inspired QuoJS - http://quojs.tapquo.com | |
* | |
* Supported Gestures: singleTap, doubleTap, hold, | |
* swipe, swiping, swipeLeft, swipeRight, swipeUp, swipeDown, | |
* rotate, rotating, rotateLeft, rotateRight, pinch, pinching, | |
* pinchIn, pinchOut, | |
* drag, dragLeft, dragRight, dragUp, dragDown |