forked from jquery-archive/css-chassis
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance: Add performance test suite for comparing other frameworks
Fixes jquery-archivegh-19 Ref jquery-archivegh-2
- Loading branch information
Showing
9 changed files
with
353 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ style.css | |
# Folders | ||
bower_components/ | ||
node_modules/ | ||
external/ | ||
icons/svg-min/ | ||
.sass-cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title><%= title %></title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<% | ||
var stylesheets = ""; | ||
css.forEach(function( value ){ | ||
stylesheets += "<link rel='stylesheet' href='" + value + "'>"; | ||
}); | ||
%> | ||
<%- stylesheets %> | ||
</head> | ||
<body> | ||
<h1><%= title %></h1> | ||
<h2>Component Count: <%= count %></h2> | ||
<%- html %> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
var components = { | ||
generate: function( frameworkName, component, count ) { | ||
var currentCount = 0, | ||
framework = require( "./frameworks/" + frameworkName + ".js" ), | ||
keys = Object.keys( framework[ component ].variations ), | ||
current = {}, | ||
html = ""; | ||
|
||
function render( i ) { | ||
framework[ component ].variations[ keys[ i ] ].forEach(function( value ) { | ||
current[ keys[ i ] ] = value; | ||
if ( i < keys.length - 1 ) { | ||
render( i + 1 ); | ||
} else { | ||
if ( currentCount < count ) { | ||
currentCount++; | ||
html = html + framework[ component ].generator.call( this, current ); | ||
} | ||
} | ||
}); | ||
} | ||
while ( currentCount < count ) { | ||
render( 0 ); | ||
} | ||
return { | ||
html: html, | ||
count: currentCount, | ||
css: framework.css, | ||
title: frameworkName + ": " + component | ||
}; | ||
} | ||
}; | ||
module.exports = components; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module.exports = { | ||
css: [ "//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" ], | ||
button: { | ||
generator: function( options ) { | ||
var button = "<button class='btn " + options.state + " " + options.size + "' >"; | ||
if ( options.icon ) { | ||
button = button + "<span class='glyphicon glyphicon-" + options.icon + | ||
"'></span>"; | ||
} | ||
return button + " Button </button>"; | ||
}, | ||
variations: { | ||
state: [ | ||
"btn-default", | ||
"btn-primary", | ||
"btn-success", | ||
"btn-info", | ||
"btn-warning", | ||
"btn-danger", | ||
"btn-link" | ||
], | ||
size: [ | ||
"", | ||
"btn-lg", | ||
"btn-sm", | ||
"btn-xs" | ||
], | ||
icon: [ | ||
false, | ||
"astrisk", | ||
"plus", | ||
"minus", | ||
"euro", | ||
"fire" | ||
] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module.exports = { | ||
css: [ | ||
"//cdn.foundation5.zurb.com/foundation.css", | ||
"//cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.eot", | ||
"https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.min.css" | ||
], | ||
button: { | ||
generator: function( options ) { | ||
var button = "<button class='button" + options.state + options.size + options.shape + | ||
"' >"; | ||
if ( options.icon ) { | ||
button = button + "<i class='fi-" + options.icon + | ||
"'></i>"; | ||
} | ||
return button + " Button </button>"; | ||
}, | ||
variations: { | ||
state: [ | ||
"", | ||
" secondary", | ||
" alert", | ||
" info", | ||
" disabled", | ||
" success" | ||
], | ||
size: [ | ||
"", | ||
" tiny", | ||
" small", | ||
" large" | ||
], | ||
shape: [ | ||
" round", | ||
" radius", | ||
" expand" | ||
], | ||
icon: [ | ||
false, | ||
"compas", | ||
"power", | ||
"crown", | ||
"skull", | ||
"map" | ||
] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module.exports = { | ||
css: [ "//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" ], | ||
button: { | ||
generator: function( options ) { | ||
var position = ( options.icon === "" ) ? "" : options.iconPosition; | ||
return "<button class='ui-btn" + | ||
options.options + | ||
options.theme + | ||
position + | ||
options.icon + | ||
"'>Button</button>"; | ||
}, | ||
variations: { | ||
theme: [ | ||
" ui-btn-a", | ||
" ui-btn-b", | ||
" ui-state-disabled ui-btn-a", | ||
" ui-state-disabled ui-btn-b" | ||
], | ||
options: [ | ||
" ui-btn-inline ui-mini", | ||
" ui-btn-inline ui-corner-all", | ||
" ui-btn-inline ui-shadow", | ||
" ui-btn-inline", | ||
" ui-corner-all ui-shadow", | ||
" ui-corner-all ui-shadow ui-btn-inline", | ||
" ui-corner-all ui-shadow ui-mini ui-btn-inline" | ||
], | ||
iconPosition: [ | ||
" ui-btn-icon-left", | ||
" ui-btn-icon-top", | ||
" ui-btn-icon-bottom", | ||
" ui-btn-icon-right" | ||
], | ||
icon: [ | ||
"", | ||
" ui-icon ui-icon-bars", | ||
" ui-icon ui-icon-bullets", | ||
" ui-icon ui-icon-camera", | ||
" ui-icon ui-icon-audio", | ||
" ui-icon ui-icon-cloud" | ||
] | ||
} | ||
} | ||
}; |
Oops, something went wrong.