Full explanatory article on my site.
A Pen by Dudley Storey on CodePen.
"use strict"; | |
// below functions can be accessed from the console | |
// very basic fibonacci | |
function basicFib() { | |
var first = 1, | |
second = 0, | |
answer = first + second; | |
while(answer < 100) { |
// 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 | |
// 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 | |
// Fn = Fn-1 + Fn-2 | |
// F0 = 0, F1 = 1 | |
"use strict"; | |
// fibonacci html output | |
function fibonacciHTML() { | |
var result = 0, term1 = 0, term2 = 1, i = 1; |
<div class="js"><!--this is supposed to be on the HTML element but codepen won't let me do it--> | |
<body> | |
<div id="preloader"></div> | |
<h1>SUPER SIMPLE FULL PAGE PRELOADER</h1> | |
<p>Works with modernizr, or you could just add your own js class to the html element using javascript</p> | |
<p>You can make it fit your site better by generating your own image here: http://ajaxload.info/ then change the background color in the css</p> | |
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force | |
npm install -g npm-windows-upgrade | |
npm-windows-upgrade |
sudo rm -rvf /var/lib/apt/lists/* | |
sudo apt-get update | |
sudo shutdown -r now |
Load a line chart from chart.js in a bootstrap modal. The chart data came from link attribute.
A Pen by Michael Topp on CodePen.
CSS only 3D bar chart showing weekly step counts. Works best in Chrome.
A Pen by Steve Gardner on CodePen.
doctype html | |
html | |
head | |
meta(charset="utf-8") | |
body | |
.wrapper | |
header.main-header | |
h1.page-title Single Element CSS Loaders | |
main.main-content | |
section.loader-section |
var Chart = (function(window,d3) { | |
var svg, data, x, y, xAxis, yAxis, dim, chartWrapper, line, path, margin = {}, width, height, locator; | |
var breakPoint = 768; | |
d3.csv('data.csv', init); //load data, then initialize chart | |
//called once the data is loaded | |
function init(csv) { |