반응형

Animo.js: CSS animation management with JavaScript

 

animo.js

A powerful little tool for managing CSS animations. Stack animations, create cross-browser blurring, set callbacks on animation completion, make magic.

Full article and demos - http://labs.bigroomstudios.com/libraries/animo-js

Animo.js: CSS animation management with JavaScript

CSS - Javascript/Added on September 30, 2013/Add to favorites

Animo.js is a powerful tool for managing CSS animations. It makes it possible to stack animations and trigger one right after another.

animo.js

반응형
반응형

 file 첨부 스타일 변경하기

 

http://www.quirksmode.org/dom/inputfile.html

 

 

div.fakefile{position:absolute;top:85px;right:64px;z-index:1;}
div.fakefile .ff{position:relative;}
div.fakefile img{position:absolute;top:7px;right:0;vertical-align:bottom;}
input.file{position:absolute;top:82px;right:61px;-moz-opacity:0;filter:alpha(opacity:0);opacity:0;z-index:2;cursor:pointer;}

 

<!--div  class="fileinputs"-->
                <input type="file" name="첨부파일_file" style="display:;" class="file" value="찾기" />
                <div class="fakefile" >
                  <div class="ff">
                      <input type="text" name="sns_file2" class="ip_txt1 " readonly=readonly/>
                      <img src="버튼.jpg" alt="찾기" />
                  </div>
                </div>
            <!--/div-->

 

Styling an input type="file"

The problem

For a site I created I needed input fields like this one:

The designer wanted the same styles, plus a "Select" image, to apply to all file upload fields. When I applied the rules of normal input fields to file upload fields, though, it didn't really work. There were wild differences between the browsers, and styling the default button is totally impossible.

Ponder the differences.

Screenshot: File input fields in the various browsersFile input fields in the various browsers

This is hardly what anyone would call a nicely designed form field. Until recently, though, it was the best we could do.

Also note Safari's fundamentally different approach. The Safari team has probably decided on this approach to disallow the manual entering of a file name and this avoid exploits like this one. The drawback is that the user can't decide not to upload a file after having selected one.

The solution

Fortunately, reader Michael McGrady invented a very neat trick that allows us to (more or less) style file upload fields. The credits for the solution presented on this page are wholly his, I only added the position: relative, a few notes and tests, and ported it entirely to JavaScript.

Without the technique your browser reacts like this:

Using McGrady's technique, I was able to produce this file upload field:

 

Now that looks much better, doesn't it? (Provided your browser supports opacity)

McGrady's technique is elegant in its simplicity:

  1. Take a normal <input type="file"> and put it in an element with position: relative.
  2. To this same parent element, add a normal <input> and an image, which have the correct styles. Position these elements absolutely, so that they occupy the same place as the <input type="file">.
  3. Set the z-index of the <input type="file"> to 2 so that it lies on top of the styled input/image.
  4. Finally, set the opacity of the <input type="file"> to 0. The <input type="file">now becomes effectively invisible, and the styles input/image shines through,but you can still click on the "Browse" button. If the button is positioned on top of the image, the user appears to click on the image and gets the normal file selection window.
    (Note that you can't use visibility: hidden, because a truly invisible element is unclickable, too, and we need the <input type="file"> to remain clickable)

Until here the effect can be achieved through pure CSS. However, one feature is still lacking.

  1. When the user has selected a file, the visible, fake input field should show the correct path to this file, as a normal <input type="file"> would. It's simply a matter of copying the new value of the <input type="file"> to the fake input field, but we need JavaScript to do this.

Therefore this technique will not wholly work without JavaScript. For reasons I'll explain later, I decided to port the entire idea to JavaScript. If you're willing to do without the visible file name you can use the pure CSS solution. I'm not sure if this would be a good idea, though.

The HTML/CSS structure

I've decided on the following HTML/CSS approach:

div.fileinputs {
	position: relative;
}

div.fakefile {
	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 1;
}

input.file {
	position: relative;
	text-align: right;
	-moz-opacity:0 ;
	filter:alpha(opacity: 0);
	opacity: 0;
	z-index: 2;
}

<div class="fileinputs">
	<input type="file" class="file" />
	<div class="fakefile">
		<input />
		<img src="search.gif" />
	</div>
</div>

 

반응형
반응형

Best Collection of Useful CSS Tools for Developers

Layouts

  • CSS Layout GeneratorThis generator will create a fluid or fixed width floated column layout, with up to 3 columns and with header and footer. Values can be specified in either pixels, ems or percentages.
  • Grid DesignerGenerates fixed and scalable grid layouts along with basic reset and typography.
  • Layout GeneratorsGenerate multi-column and grid layouts with CSS techniques using %, px, or em.

CSS Frameworks

Fonts

  • TypetesterThe Typetester is an online application for comparison of the fonts for the screen.
  • @font-face GeneratorEasy to use CSS3 @font-face generator from Font Squirrel.
  • CSS Type Set
  • TypeChartLets you flip through, preview and compare web typography while retrieving the CSS
  • CSS-Typoset Matrix and Code Generator
  • CSStxtTool for generating CSS for web typography.
  • EM Calculator AIR ApplicationCalculator for Vertical Rhythm in XHTML & CSS; easily convert px to em based on base font-size and line-height; Padding and margins automatically calculated
  • Em CalculatorEm Calculator is a small JavaScript tool which helps making scalable and accessible CSS design. It converts size in pixels to relative em units, which are based on a text size.
  • PXtoEM

Colors

  • CSS Color EditorCSS Color Editor allows you to replace the color scheme of your website without going through the entire CSS file. You choose your local CSS file, select new colors and then download the new CSS file with new color codes automatically replaced for you.
  • Color Palette GeneratorUpload an image to generate a color palette based on the image’s primary colors. Useful for quickly grabbing a particular color within an image for inspiration.
  • Color Contrast CheckThe Color Contrast Check Tool allows to specify a foreground and a background color and determine if they provide enough of a contrast “when viewed by someone having color deficits or when viewed on a black and white screen”.
  • ColorZillaColorZilla is an extension for Firefox offering advanced eyedropper, color picker, palette viewer and other colorful goodies like: DOM color analyzer, full page zoom, firebug support, etc.
  • HSL to RGB Converter

Sprites

  • CSS Sprite GeneratorCreates single sprite image and generate the appropriate CSS for you.
  • CSS Sprite – Online CSS Sprite Builder / GeneratorAn online tool to help web designers and web developers to build CSS Sprites. All you need to do is upload multiple files and it will generate sprite image and relted CSS and HTML for you.
  • CSS Sprite GeneratorCSS Sprite Generator will combine the uploaded images into a single sprite and generate the CSS for you.
  • YASC (Yet Another Sprite Creator)This tools is useful when all your sprite images have been created in a single file. The process is fairly straight forward: you upload this file, then visually select each individual item and specify its CSS id; once you have selected all your sprites you can generate all the required CSS with a single click.
  • Nav-o-MaticGenerates navigation markup and CSS for your sprite.
  • SmartSpritesSmartSprites is Java command line utility that will let you easily introduce and maintain CSS sprites in your designs. SmartSprites parses special directives you can insert into your original CSS to mark individual images to be turned into sprites. It then builds sprite images from the collected images and automatically inserts the required CSS properties into your style sheet, so that the sprites are used instead of the individual images.

Forms

  • Accessible Form BuilderCreate accessible form with CSS or table layout, including all label elements simply by typing a list of fields that you need.
  • WufooWufoo is an online service that allows anybody to easily build great looking online forms. You can use Wufoo as an easy way to create good-looking, valid CSS/XHTML form markup. It allows you to use your account to design and download the markup and CSS for FREE.

UI Components

  • List-o-MaticCreate CSS-styled navigation blocks based on unordered list <li> items. Get your semantics on!
  • CSS Menu GeneratorGenerates horizontal, vertical & dropdown CSS menus
  • ThemeRollerThemeRoller allows you to design custom jQuery UI themes for tight integration in your projects.

Text Wrappers

  • CSS Text WrapperGenerates HTML/CSS to wrap content to any shape
  • The Box OfficeThe Box Office lets you wrap/float/contour text around freeform images using CSS for usage in HTML pages.

Analysis & Debugging

  • W3C CSS Validation Service
  • CSS AnalyzerCSS Analyzer checks the validity of your CSS against the W3C’s validation service, along with a color contrast test, and a test to ensure that relevant sizes are specified in relative units of measurement.
  • FirebugOne of the post popular web developer tool – Firebug is a Firefox add-on that allows you to edit, debug, and monitor CSS, HTML, and JavaScript live in any web page. You can use Firebug Lite in IE, Opera, and Safari.

Convertors

  • Primer CSSPrimer undercoats your CSS by pulling out all of your classes and id’s and placing them into a starter stylesheet.
  • Automatic CSS Inliner ToolTool that will automatically transform all of your local styles into inline styles. Useful for styling email news letters.
  • DrawterOnline tool that literally lets you draw your website’s code.

Maintenance

  • Dust-Me SelectorsDust-Me Selectors is a Firefox extension that finds unused CSS selectors
  • CssCleanerWindows desktop application that removes unused CSS Classes from your web application
  • CSS Redundancy CheckerUse this tool to find CSS selectors that aren’t used by any of your HTML files and may be redundant.
  • CSS SuperScrubThis tool can significantly reduce the size and complexity of your CSS by programmatically stripping unneeded content, stripping redundant calls, and intelligently grouping the remaining element names.
  • HeliumJavaScript tool to scan your site and show unused CSS

Optimization

  • CSS Drive CSS CompressorNormal mode allows you to choose from three levels of compression, depending on how legible you want the compressed CSS to be versus degree of compression. You can switch to Advanced mode for greater customization.
  • Robson CSS CompressorA good CSS Compressor still in development.
  • MinifyMe – AIR ApplicationAdobe AIR application that allows you pack multiple files together.

Formatting

  • CSS SorterFree online tool for sorting CSS files. It organizes CSS rules alphabetically so that it will be easier for you to maintain your CSS files.
  • CleanCSS – CSS Formatter and OptimizerThis tool comes with several options for formatting as well as optimization. It also provides ready made sets of options for various level of balances between optimization and readability. Important feature includes ability to automatically merged the same selectors and properties.
  • StyleneatIt organizes and standardizes your CSS – selectors, sub-selectors and properties – in a structure that makes it easier to define page areas and see how they relate to each other.
  • WordoffStrips the cruft that is pasted into WYSIWYG editors from Word
  • CSS ToolboxFree CSS Validation, CSS Formatter, CSS Compressor

Browser Specific

  • ModernizrA really useful JavaScript library that detects native availability of HTML5/CSS3 features and offers you a way to maintain a fine level of control over your site regardless of a browser’s capabilities. If you prefer using MooTools, you can use MooModernizr (MooTools port of Modernizr)
  • Conditional-CSSConditional-CSS allows you to write maintainable CSS with conditional logic to target specific CSS statements at both individual browsers and groups of browsers. Compilers for Conditional-CSS are available in PHP, C# and C.
  • LitmusLitmus shows you exactly how your designs look on various platform, across every popular web browser.
  • Web Browser CSS SupportDetailed information about CSS support in major web browsers, allows you to pick which browser appear on the information tables.
  • When Can I Use?Compatibility tables for features in HTML5, CSS3, SVG and other upcoming web technologies. Allows you to specify browsers, features, time period, status, search and sorting options.
  • CSS3 support for Internet Explorer 6, 7, and 8IE-CSS3 is a script to provide Internet Explorer support for several of the popular new styles available in the upcoming CSS3 standard.
  • IE7.jsIE7 is a JavaScript library to make Microsoft Internet Explorer behave like a standards-compliant browser. It fixes many HTML and CSS issues and makes transparent PNG work correctly under IE5 and IE6.
  • IE6 CSS FixerA tool specifically designed to ease the pain of the IE6 CSS debugger.

Selectors

  • CSS3 pseudo-class Selector Emulationie-css3.js allows Internet Explorer to identify CSS3 pseudo-class selectors and render any style rules defined with them. Simply include the script in your pages, start using these selectors in your style sheets and they’ll work in IE.
  • Dust-Me SelectorsA Firefox extension that finds unused CSS selectors.
  • Sizzle JavaScript Selector LibraryA pure JavaScript CSS selector engine designed to be easily dropped in to a host library. Sizzle supports virtually all CSS3 selectors – this even includes some parts that are infrequently implemented such as escaped selectors (”.foo+bar”), Unicode selectors, and results returned in document order.
  • SelectORacleOnline tool that provides explanation of CSS2 and CSS3 selectors. Simply provide it with some selectors and it will return descriptions of what the selectors will match.
  • YUI Selector UtilityThe YUI Selector Utility brings CSS3 Selector syntax to JavaScript, providing a compact shorthand for collecting, filtering, and testing HTMLElements.
  • YUI StyleSheet UtilityThe StyleSheet Utility allows you to create and modify CSS stylesheets on the fly.

CSS3 Generators

Miscellaneous

  • XRAYXRAY is a bookmarklet for Internet Explorer 6+, and Webkit and Mozilla based browsers (including Safari, Firefox, Camino or Mozilla). Use it to see the box model for any element on any web page.
  • CSSUtilitiesA JavaScript library that provides unique and indispensible methods for querying CSS style sheets
  • ReCSSThis little bookmarklet makes refreshing your CSS a breeze

Cheat Sheets

Beyond CSS

  • MoreCSSMoreCSS is a JavaScript library that can assist you with all the daily JavaScript things like pop-ups, tabs, tooltips, hyphenation, advanced list styling and more using CSS like syntax.
  • LESS – Leaner CSSLess extends CSS by adding: variables, mixins, operations and nested rules. Less uses existing CSS syntax. This means you can migrate your current .css files to .less in seconds and there is virtually no learning curve. However you’ll need Ruby installed to use it.
  • DtCSSDtCSS is a PHP script that preprocesses your CSS file. It speeds up CSS coding by extending the features to CSS. Such as nested selectors, color mixing and more. DtCSS reads the CSS file with special syntax written for DtCSS, and outputs the standard CSS. It also comes with a smart caching system.

HTML5 CSS3 Tutorial Videos

반응형
반응형

Responsive Web CSS: Layout responsive pages in minutes

CSS - Responsive/Added on August 17, 2013/Add to favorites

Responsive Web CSS makes it simple to create responsive web layouts. Just add divs, set how big each should be for each device you want to target, and download your site’s skeleton.

responsive web css

반응형
반응형

The Holy Grail jQuery Plugin of CSS Design

 

http://www.codeproject.com/Articles/629019/The-Holy-Grail-jQuery-Plugin-of-CSS-Design

 

 

 

The joy of creating jQuery Plugin resides in the fact that you can wrap a big deal of jQuery code that otherwise could end up spread all over your codebase, and by establishing a jQuery Plugin, you can confine a coherent set of functionalities in a self-contained component, and then work on this component in order to make it useful for a very wide community of web developers.

In Holy Grail plogin code, we start by creating a immediately-invoked function expression (IIFE) in JavaScript code. The IIFE is a design pattern that provides the self-containment of private functions variables and functions within the plugin scope, thus avoiding the pollution of JavaScript's Global Environment. JavaScript developers will easily recognize the IIFE pattern by the following code:

 

            (function(){
              /* code */ 
            }());
        

In the above code, the outermost pair of parentheses wrap the function in an expression and immediately forces its evaluation. The pair of parentheses in the last line of code invokes the function immediately.

Notice that, within the jQuery plugin development, it's important to pass the jQuery reference as a parameter in our IIFE expression, so that the dollar sign ($) can be used safely within the scope of the plugin, without the risk of external libraries overriding the dollar sign:

 

            (function($){
              /* Our Holy Grail jQuery Plugin code goes here. Notice the $ sign will never have a meaning other than the jQuery object. */ 
            }(jQuery));
        

Next, we create the function that will hold and execute the whole of our Holy Grail plugin functionality. Notice the options parameter, which will contain all the initialization settings needed to configure the bar chart according to the Holy Grail plugin requirements:

 

            (function($){
              $.fn.holygrail = function (options) {
                    //as expected, our holy grail plugin code falls here.
                }
            }(jQuery));
        

Inside the plugin function, the context is given by the this JavaScript keyword. Most often than not, developers will be tempted to reference the context by enclosing it using the dollar sign (i.e. jQuery) function: "$(this)", instead of just this. This is a common mistake, since the this keyword already refers to the jQuery object and not the DOM element inside which the bar chart is being created:

 

            (function($){
              $.fn.barChart = function (options) {
                    var self = this;
                }
            }(jQuery));
        

In the above JavaScript code, we are storing the value of the this object in the self reference. This is needed specifically inside functions, where the this keyword behaves as the context for the function itself, instead of the context for the outermost plugin function. Thus, the self will be used as the context for the bar chart plugin instead.

The plugin code starts by defining a series of settings that will become the default values for the most common configurations. This will provide our plugin users with convenient standard values that can be either configured (allowing a flexible charting component) or ignored (so that the plugin user can provide the smallest set of startup configuration).

As the plugin component gets more sophisticated, it's generally a good idea to provide a more complete and comprehensive set of default settings, in order to give users a powerful, flexible and unobtrusive plugin.

 

            $.fn.holygrail = function (options) {

                var self = this;

                // Create some defaults, extending them with any options that were provided
                var settings = $.extend({
                    headerContent: options.headerContent,
                    centerContent: options.centerContent,
                    leftContent: options.leftContent,
                    rightContent: options.rightContent,
                    footerContent: options.footerContent
                }, options);

        

The above code snippet shows the plugin settings: there is a different plugin configuration for each of the page's sections: headerContent, centerContent, leftContent, rightContent and footerContent:

 

		=========================
		|         header        |
		=========================
		|      |        |       |
		| left | center | right |
		|      |        |       |
		=========================
		|         footer        |
		=========================
		

The plugin code itself is all about gathering the content elements and rearranging them in a way that the resulting rendering complies with the above layout:

 

			/// <reference path="jquery-1.9.1.min.js">
			(function ($) {

				var HolyGrail = {};

				var raster;

				$.fn.holygrail = function (options) {

					var self = this;

					// Create some defaults, extending them with any options that were provided
					var settings = $.extend({
						headerContent: options.headerContent,
						centerContent: options.centerContent,
						leftContent: options.leftContent,
						rightContent: options.rightContent,
						footerContent: options.footerContent
					}, options);

					var body = $('body');
					var hgHeader = $('<div>').attr({ id: 'hg-header' });
					var hgContainer = $('<div>').attr({ id: 'hg-container' });
					var hgCenter = $('<div>').attr({ id: 'hg-center', 'class': 'hg-column' });
					var hgLeft = $('<div>').attr({ id: 'hg-left', 'class': 'hg-column' });
					var hgRight = $('<div>').attr({ id: 'hg-right', 'class': 'hg-column' });
					var hgFooter = $('<div>').attr({ id: 'hg-footer' });

					$(hgContainer).append(hgCenter);
					$(hgContainer).append(hgLeft);
					$(hgContainer).append(hgRight);
					$(body).append(hgHeader);
					$(body).append(hgContainer);
					$(body).append(hgFooter);

					$(this.headerContent).attr({ 'class': 'hg-pad' });
					$(this.centerContent).attr({ 'class': 'hg-pad' });
					$(this.leftContent).attr({ 'class': 'hg-pad' });
					$(this.rightContent).attr({ 'class': 'hg-pad' });
					$(this.footerContent).attr({ 'class': 'hg-pad' });

					$(hgHeader).append($(settings.headerContent));
					$(hgCenter).append($(settings.centerContent));
					$(hgLeft).append($(settings.leftContent));
					$(hgRight).append($(settings.rightContent));
					$(hgFooter).append($(settings.footerContent));
				}
			}(jQuery));
		</div></div></div></div></div></div></reference>

반응형
반응형

CSS - Cheat sheet

 

 

반응형
반응형

Cardinal — Mobile-first CSS framework with useful defaults

Cardinal is a mobile-first CSS framework that comes with some useful default styles, reusable modules, scalable typography, and a responsive grid system. It’s great for developers who want a simpler way to build responsive web apps.

cardinal

 

반응형
반응형

[CSS] css 참고 사이트.   transform, transition, Animation

 

CSS3 transform:skew
CSS3 transform:rotate
CSS3 transform-origin

 

transform
transition
animation

 

http://tcbs17.cafe24.com/tc/html5/css_/css_demo2/index.html


SVG : Scalable Vector Graphics

 

CSS 참고 사이트
http://htmlcss.kr/
http://w3schools.com/
http://css3generator.com/
http://caniuse.com/

반응형

+ Recent posts