Spinning Watermark, implemented in CSS
Based on a Pen by Secret Sam on CodePen.
Spinning Watermark, implemented in CSS
Based on a Pen by Secret Sam on CodePen.
| /** | |
| * Given an integer, determine if it is a palindrome using only mathematical operations | |
| * @param {Integer} num - an integer number to be tested for palindromy-ness | |
| */ | |
| function isIntegerPalindrome( num ) { | |
| // all single digits are by definition palindromes | |
| if( num < 10 ) { | |
| return true; | |
| } | |
| /* logger */ | |
| // define the styles we'll use for logger | |
| var cssText = [ | |
| "position: fixed;", | |
| "height: 80px;", | |
| "bottom: 0px;", | |
| "left: 0;", | |
| "right: 0;", | |
| "margin: 0;", |
| (function(context){ | |
| var body = document.body, | |
| win = window, | |
| html = document.documentElement, | |
| docHeight, | |
| winHeight, | |
| progBar; | |
| // calculate size of document on load or window resize | |
| function calcSize () { |
| function random(min = 0, max = 100) { | |
| let rand = Math.random() * (max - min) + min; | |
| return rand; | |
| } | |
| class DataGen { | |
| constructor(range) { | |
| // | |
| this.from = range.from||0; | |
| this.to = range.to||10; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| pre { | |
| display: inline; | |
| background: #EAF0F0; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>Image Loader Test</title> | |
| <style> | |
| #canvas { | |
| width: 300px; | |
| height: 300px; |
| /** | |
| * bitwise masks | |
| */ | |
| const full = 255; /* 11111111 */ | |
| // es5 doesn't have Array.fill :( | |
| function makeMask(fn) { | |
| for (let i = 0, mask = []; i < 8; i++) { | |
| mask[i] = fn(full, i) & full; |
| function Storage(key) { | |
| this.key = key; | |
| this.db = this._load(key); | |
| } | |
| Storage.prototype = { | |
| _load: function(key) { | |
| var _existing = localStorage.getItem(key); | |
| return _existing ? JSON.parse(_existing) : {}; | |
| }, |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <button id="a">3</button> | |
| <button id="b">2</button> |