{Carrer web log}
picoCSS - really small JavaScript Framework
Thursday, April 28, 2011 { 15 Comments }
I've had some extra time during the Easter holidays and I did some JavaScript experiments. The result of that experiment is super small JavaScript library for basic CSS manipulation mainly for building iPhone, iPad and Android web apps.This project has one objective DOM CSS manipulation with JavaScript that is optimized for webkit browsers(Safari, Chrome) and it will work in (Firefox, Opera) without the part of animation.
With this library you can do just three things insert inline CSS or manipulate CSS with changing the id and the class name of the HTML element. Also webkit CSS3 animation are supported. I've used Svetlo like selector engine.
The coding syntax looks like this:
p.select("#a").css("background-color : green; color: #fff;");
or
p.select("#b").animate('0.5', '1','360','1','1','1','1', '0','0');
or
p.select("#main").att("class","bumm");
And here are some examples (Safari/Chrome):
Example 1
Example 2
Example 3
Example 4
>> Download & Watch the library on GitHub
This Framework is not meant to be complete JS Framework like jQuery. It is just CSS helper library.
If you need small but complete framework for mobile development I suggest you check:
Zepto.js
Ender.js
jQuery Mobile
All comments and suggestions are appreciated!
Svetlo - One Line JavaScript Selector Engine
Tuesday, April 12, 2011 { 7 Comments }
I'm working on one new mini JavaScript Framework for building mobile apps.Probably the most critical part of any JavaScript Framework is the selector engine. Naturally the faster is the selector engine the faster will be all the Framework.
Most of the modern selector engines are build upon querySelectorAll because it gives the best flexibility. Little problem with querySelectorAll is the speed.
Traditionally getElementById is much faster then querySelectorAll, but things are changing. Opera 11 has super optimized querySelectorAll and probably all the browsers in the future will try to speed optimize querySelectorAll.
For my (not yet published) JavaScript Framework I've used this code for the selector engine (codename Svetlo).
// Svetlo :
function $(selector){return Array.prototype.slice.call(document.querySelectorAll(selector))}
What this code does is putting the querySelectorAll results "toArray" and that helps the speed optimization. The code is not new I think the first time I saw it on John Resig blog.
I'm not even sure that this line of code can be called selector engine, but I think that it can be helpful to someone and is good baseline for writing JS applications that doesn't need to run in IE. Hint: Web apps for iPhone and Android.
I did some performance test.
The test are based on this principle http://jsperf.com/nodelist-vs-array-iteration
http://jsperf.com/svetlo-class
http://jsperf.com/svetlo-id/3
http://jsperf.com/svetlo/3
If my testing logic is correct result show that this selector engine is faster then the native querySelectorAll and equal like native getElementById method.
If my testing logic is correct result show that this selector engine is faster then the native querySelectorAll and equal like native getElementById method.
This solution will run on of Safari, Chrome, Firefox, Opera and doesn't support IE.
My intention was to build JS Framework for mobile webkit browsers(iOS, Android).
So if you building web app for iPhone, iPad, Android this selector engine can help you, if you need to support IE this selector engine is completely useless.
Other super small selectors:
Ben Alman QSA library
Dan Heberden Quewery
Dustin Diaz Qwery
All comments and suggestion about this small selector will be appreciated!
About Me <<<
Name: Vladimir Carrer
vladocar [at] gmail.com
Location: Verona, Italy
I'm a web designer, developer, teacher, speaker, generally web addicted ...
My projects <<<
- AI Prompt Directory
- Hand Drawn Icons
- Font Design Inspiration
- Font Pairings
- Free SVG Cut File
- Upcoming NFT projects
- Discord Tutorials
- Free Sublimation Designs
- Tech Feed
- MySQL Lite Administrator
- Quark Mini PHP CMS
- Formy - CSS Form Framework
- Emastic - CSS Framework
- Malo - CSS Library
- The Golden Grid
- 1 line CSS Grid Framework
- Two Lines CSS Framework
- Child Selector System - CSS Framework
- Better Web Readability Project
- Azbuka - CSS Typographical Base Rendering Library
- ClipR - bookmarklet for better reading
- CSS3 Action Framework
- CSS Mini Reset
- HTML5 Mini Template
- CSS Mobile Reset
- picoCSS - JavaScript Framework
- HTML Lorem Ipsum Crash Test
- Object Auto Documentation - JavaScript
- o - JS Library for Object Manipulation
- Foxy - CSS Framework
- Tumblr Free Theme - Better Readability Project
- Box - CSS Framework
- SMART CSS GRID
- nanoJS - Minimal JS DOM Library
- Flexy CSS Framework
- Katana is CSS Layout System made with Flexbox
- Micro CSS Reset
- 60 Grid System
- Simple CSS Button
- ramd.js JavaScript library for making web applications.
- Minimal Notes web app build with Vue.js
- Scribble Font for Prototyping & Wireframing
- Flex One - 1 CSS Class System
- Floaty - CSS Float Based Layout System
- Infinity CSS Grid
- CLI Convert websites into readable PDFs
- keywords-extract - CLI tool, extract keywords from any web page.
- screenshoteer - Make website screenshots and mobile emulations from the command line.
- Basic.css - Classless CSS Starter File
§§Previous Posts <<<
- GPT-3 and CSS Frameworks
- Don’t use CSS Reset use CSS Set
- One Page 2020 Calendar Print Version
- 3 CLI tools based on Node.js
- Scribble Font for Prototyping & Wireframing
- ramd.js - Small JavaScript library for making TODO...
- Katana.scss - CSS Layout System made with Flexbox
- Flexy CSS Framework
- nanoJS - JavaScript for DOM manipulation
- SMART CSS GRID
§Archives <<<
- May 2006
- June 2006
- July 2006
- August 2006
- September 2006
- October 2006
- January 2007
- February 2007
- October 2007
- April 2008
- June 2008
- July 2008
- August 2008
- September 2008
- November 2008
- December 2008
- January 2009
- February 2009
- March 2009
- April 2009
- May 2009
- June 2009
- August 2009
- September 2009
- October 2009
- November 2009
- December 2009
- January 2010
- February 2010
- March 2010
- April 2010
- May 2010
- June 2010
- July 2010
- August 2010
- September 2010
- October 2010
- November 2010
- December 2010
- January 2011
- February 2011
- March 2011
- April 2011
- May 2011
- June 2011
- July 2011
- August 2011
- September 2011
- October 2011
- November 2011
- December 2011
- January 2012
- February 2012
- March 2012
- April 2012
- June 2012
- August 2012
- November 2012
- January 2013
- March 2013
- June 2013
- October 2013
- November 2013
- March 2014
- September 2014
- October 2014
- November 2015
- March 2018
- May 2018
- June 2018
- July 2018
- October 2018
- January 2019
- January 2020
- June 2020
- April 2021
Other Profiles <<<
Content is licensed under a Creative Commons Public Domain License