Skip to content

Instantly share code, notes, and snippets.

View stvrbbns's full-sized avatar

Stephen Thomas Robbins stvrbbns

View GitHub Profile
@stvrbbns
stvrbbns / css-accordion.css
Last active November 11, 2017 15:39
Pure CSS accordion
/* Pure CSS accordion
*
* Copyright (C) 2017 Stephen T. Robbins
* License: MIT : https://choosealicense.com/licenses/mit/
* : CC0 : https://creativecommons.org/publicdomain/zero/1.0/
*/
/* -- Known Issues, Suggested Updates/Improvements, and Notices --
NONE
*/
/** includeJS() appends a JavaScript file to an element of the open document.
* @param jsPath -- string - the path to the JavaScript file.
* @param docLocName -- string - optional - element tag or ID name;
* defaults to "head".
* @param docLocType -- string - optional - type of element name, "tag" or "id";
* defaults to "tag".
* @param docLocNum -- integer - optional - number of element with tag name;
* defaults to 0.
*/
function includeJS(jsPath, docLocName, docLocType, docLocNum)
@stvrbbns
stvrbbns / matrix_nocanvas.js
Last active January 1, 2016 22:45
showcasing graphical non-performance using DOM manipulation
// https://css-tricks.com/snippets/javascript/async-script-loader-with-callback/
var Loader = function () { };
Loader.prototype = {
require: function (scriptURLs, callback) {
this.loadCount = 0;
this.totalRequired = scriptURLs.length;
this.callback = callback;
for (var i = 0; i < scriptURLs.length; i++) {
this.writeScript(scriptURLs[i]);
@stvrbbns
stvrbbns / jQuery_Tabletop.js_template.html
Last active October 17, 2018 16:23
example jQuery Tabletop.js page
<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<title>Page Title</title>
<meta name="description" content="A description of the webpage.">
<!-- ***** INCLUDED RESOURCES ***** -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
@stvrbbns
stvrbbns / menubar.css
Last active November 11, 2017 15:39
Dark-theme navigation/menu bar, animated with CSS; requires a little jQuery JavaScript for mobile.
/* Dark-theme navigation/menu bar, animated with CSS; requires a little jQuery JavaScript for mobile.
* See: http://blog.logsine.com/2014/05/navigation-bar-gadget.html
* - http://red-team-design.com/css3-dropdown-menu/
* - http://red-team-design.com/css3-animated-dropdown-menu/ ("© 2016 Catalin Rosu. Feel free to use the articles you may find here in your projects, with or without any attribution.")
*
* Stephen T. Robbins made substantial changes to the initial (Red Team Design) CSS:
* - matched the :hover styling to the jQuery-UI "Dark Hive" theme.
* - added support for use as a bottom-up, right-to-left (expand-right) menu bar
* - added support for use as a dropdown, left-to-right (expand-left) menu bar
* - added support for disabling menu items