webdesign:html5
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
webdesign:html5 [2016/01/14 04:27] – [CSS tools] admin | webdesign:html5 [2016/01/14 04:29] (current) – removed admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== HTML5 ====== | ||
- | ===== Understand about HTML5 ===== | ||
- | ==== HTML5 Browser Support ==== | ||
- | refer: | ||
- | * http:// | ||
- | HTML5 browser support: | ||
- | * HTML5 is **supported in all modern browsers**. | ||
- | * In addition, all browsers, **old and new, automatically handle unrecognized elements as inline elements**. Because of this, you can **" | ||
- | ===== Javascript tools ===== | ||
- | |||
- | ==== npm(package manager for javascript...) ==== | ||
- | refer: https:// | ||
- | ==== bower(package manager for the web) ==== | ||
- | refer: http:// | ||
- | Web sites are made of lots of things — **frameworks, | ||
- | * Install bower< | ||
- | npm install -g bower | ||
- | </ | ||
- | * Using bower to search all libraries which contain the word **" | ||
- | bower search jquery | ||
- | </ | ||
- | ............................... | ||
- | jquery-autogrow-textarea git:// | ||
- | jquery-formchecker git:// | ||
- | inview-jquery-plugin git:// | ||
- | good-form git:// | ||
- | jquery-fivehundredpx git:// | ||
- | ............................... | ||
- | </ | ||
- | * Create bower.json from **bower_components** in project< | ||
- | bower init | ||
- | </ | ||
- | * Install all packages which were configured in bower.json to **bower_components**< | ||
- | bower install | ||
- | </ | ||
- | * Install single package to your project(You must **install git** before run **bower install**):< | ||
- | bower install < | ||
- | </ | ||
- | bower install good-form | ||
- | </ | ||
- | ==== Grunt(Javascript Task Runner) ==== | ||
- | refer: http:// | ||
- | ==== Node.js ==== | ||
- | refer: https:// | ||
- | Node.js® is a platform built on **Chrome' | ||
- | ==== Dust ==== | ||
- | refer: http:// | ||
- | ===== Javascript Framework ===== | ||
- | ==== Javascript and design Experience ==== | ||
- | Trong trường hợp ta có 1 bộ magamenu với HTML và javascript mẫu, làm thế nào bỏ megamenu vào design của mình? | ||
- | * Step1: Ta đem nguyên bộ HTML và javascript này đem vào sử dụng trong website -> Tiết kiệm được một khoảng thời gian dài để viết lại thuật toán phức tạp(Bao gồm layout, hiệu ứng javascript...) để hiển thị mega menu bằng javascript | ||
- | * Step2: Ta chỉnh sửa css (màu sắc, layout) cho phù hợp với giao diện của mình | ||
- | ==== backbone.js ==== | ||
- | refer: | ||
- | * http:// | ||
- | * http:// | ||
- | * https:// | ||
- | * https:// | ||
- | * https:// | ||
- | * https:// | ||
- | |||
- | Backbone.js gives structure to web applications by providing **models** with **key-value binding and custom events**, **collections** with a rich API of enumerable functions, views with declarative **event handling**, and connects it all to your existing API over a **RESTful JSON interface**. | ||
- | ==== underscore.js ==== | ||
- | refer: http:// | ||
- | Underscore is a **JavaScript library** that provides a whole **mess of useful functional programming helpers** without extending any built-in objects | ||
- | ==== emberjs ==== | ||
- | refer: http:// | ||
- | ==== requirejs ==== | ||
- | refer: http:// | ||
- | ==== angularjs ==== | ||
- | refer: https:// | ||
- | AngularJS lets you write client-side web applications **as if you had a smarter browser**. It lets you use good old HTML (or HAML, Jade and friends!) as your template language and **lets you extend HTML’s syntax** to express your application’s components clearly and succinctly. It **automatically synchronizes data from your UI (view) with your JavaScript objects (model)** through 2-way data binding. To help you structure your application better and make it easy to test, AngularJS teaches the browser how to do dependency injection and inversion of control.\\ | ||
- | And it **helps with server-side communication**, | ||
- | |||
- | opensource apps base on angularjs: | ||
- | * https:// | ||
- | * ionic mobile framework base on angularjs: https:// | ||
- | ==== Ionic framework base on angularjs ==== | ||
- | refer: | ||
- | * ionic: https:// | ||
- | * Ionic app with WordPress integration: | ||
- | Ionic is a **powerful HTML5 SDK** that helps you build native-feeling mobile apps using web technologies like HTML, CSS, and Javascript. | ||
- | |||
- | Ionic is **focused mainly on the look and feel, and UI interaction** of your app. That means we **aren' | ||
- | ==== highcharts ==== | ||
- | refer: http:// | ||
- | ==== ExtJs ==== | ||
- | ==== Top Opensources which using javascript framework ==== | ||
- | * https:// | ||
- | * https:// | ||
- | * https:// | ||
- | ===== Javascript with cross domain ===== | ||
- | a web browser permits scripts contained in a first web page to access data in a second web page(Or cross domain) which **Same-origin policy** | ||
- | ==== Same-origin policy ==== | ||
- | refer: http:// | ||
- | In computing, the same-origin policy is an important concept in the web application security model. Under the policy, **a web browser permits scripts contained in a first web page to access data in a second web page**, but only if **both web pages have the same origin**. An origin is defined as a **combination of URI scheme, hostname, and port number**\\. Example: | ||
- | |||
- | ^URL^Outcome^Reason^ | ||
- | |http:// | ||
- | |http:// | ||
- | |https:// | ||
- | |http:// | ||
- | |http:// | ||
- | |||
- | This mechanism bears a particular significance for modern web applications that **extensively depend on HTTP cookies to maintain authenticated user sessions**, as servers act based on the HTTP cookie information to reveal sensitive information or take state-changing actions. A strict separation between content provided by unrelated sites must be maintained on the client side to prevent the loss of data confidentiality or integrity. | ||
- | ==== Relaxing the same-origin policy(Nởi lỏng rule gốc) ==== | ||
- | refer: https:// | ||
- | === By Changing origin with document.domain property === | ||
- | A page may change its own origin with some limitations. **A script can set the value of document.domain to a subset of the current domain**. If it does so, the shorter domain is used for subsequent origin checks. For example, assume a script in the document at **http:// | ||
- | document.domain = " | ||
- | </ | ||
- | |||
- | **The port number is kept separately by the browser**. Any call to the setter, including **document.domain = document.domain causes the port number to be overwritten with null**. Therefore one cannot make company.com: | ||
- | === The Cross-Origin Resource Sharing method === | ||
- | refer: | ||
- | * https:// | ||
- | * http:// | ||
- | * http:// | ||
- | === Cross-document messaging === | ||
- | === Jsonp === | ||
- | === Web Sockets === | ||
- | === form post cross domain === | ||
- | The same origin policy is applicable only for browser side programming languages. So if you try to post to a different server than the origin server **using JavaScript, then the same origin policy comes into play** but if you post directly from the form i.e. the action points to a different server like:< | ||
- | <form action=" | ||
- | </ | ||
- | and there is **no javascript** involved in posting the form, then **the same origin policy is not applicable**. | ||
- | ===== CSS tools ===== | ||
- | ==== Sass(CSS pre-processor which wroten with Ruby Language) ==== | ||
- | refer: | ||
- | * http:// | ||
- | * http:// | ||
- | Install: | ||
- | * http:// | ||
- | Sass is an extension of CSS that adds power and elegance to the basic language. It allows you to use **variables, | ||
- | |||
- | Install sass with ruby: | ||
- | - Step1: download and install Ruby from http:// | ||
- | - Step2: install sass with gem tool:< | ||
- | gem install sass | ||
- | gem install compass | ||
- | </ | ||
- | Using sass: | ||
- | * display options of sass command:< | ||
- | sass --help | ||
- | </ | ||
- | * compile sass to css:< | ||
- | sass input.scss output.css | ||
- | </ | ||
- | * compass help:< | ||
- | compass --help | ||
- | </ | ||
- | Primary Commands: | ||
- | * clean - Remove generated files and the sass cache | ||
- | * compile | ||
- | * create | ||
- | * init - Add compass to an existing project | ||
- | * watch - Compile Sass stylesheets to CSS when they change | ||
- | </ | ||
- | * Using compass to compile sass to css(base on **config.rb** file):< | ||
- | compass compile | ||
- | </ | ||
- | Install User-defined language scss to edit with **notepad++** : | ||
- | - Step1: download user-defined language for scss from https:// | ||
- | - Step2: Go to **Language-> | ||
- | - Step3: go to your Notepad++ folder then to **plugins/ | ||
- | ==== Less(CSS pre-processor which wroten with Javascript Language) ==== | ||
- | refer: | ||
- | * http:// | ||
- | * less editor: http:// | ||
- | Less is a **CSS pre-processor**, | ||
- | |||
- | Less(less.js) **runs inside Node**, in the browser and **inside Rhino**. There are also many 3rd party tools that allow you to compile your files and watch for changes. | ||
- | |||
- | Install less:< | ||
- | npm install -g less | ||
- | </ | ||
- | Compile less file to css:< | ||
- | lessc styles.less > styles.css | ||
- | </ | ||
- | Basic about less language: | ||
- | * Variables: less content< | ||
- | @nice-blue: #5B83AD; | ||
- | @light-blue: | ||
- | |||
- | #header { | ||
- | color: @light-blue; | ||
- | } | ||
- | </ | ||
- | #header { | ||
- | color: #6c94be; | ||
- | } | ||
- | </ | ||
- | * Mixins: | ||
- | .bordered { | ||
- | border-top: dotted 1px black; | ||
- | border-bottom: | ||
- | }And we want to **use these properties inside other rule-sets**. Well, we just have to drop in the name of the class where we want the properties, like so:<code css> | ||
- | #menu a { | ||
- | color: #111; | ||
- | .bordered; | ||
- | } | ||
- | |||
- | .post a { | ||
- | color: red; | ||
- | .bordered; | ||
- | } | ||
- | </ | ||
- | * Nested rules: Less gives you the ability to use **nesting** instead of, or **in combination with cascading**. Let's say we have the following **CSS**:< | ||
- | #header { | ||
- | color: black; | ||
- | } | ||
- | #header .navigation { | ||
- | font-size: 12px; | ||
- | } | ||
- | #header .logo { | ||
- | width: 300px; | ||
- | } | ||
- | </ | ||
- | #header { | ||
- | color: black; | ||
- | .navigation { | ||
- | font-size: 12px; | ||
- | } | ||
- | .logo { | ||
- | width: 300px; | ||
- | } | ||
- | } | ||
- | </ | ||
- | .clearfix { | ||
- | display: block; | ||
- | zoom: 1; | ||
- | |||
- | &:after { | ||
- | content: " "; | ||
- | display: block; | ||
- | font-size: 0; | ||
- | height: 0; | ||
- | clear: both; | ||
- | visibility: hidden; | ||
- | } | ||
- | } | ||
- | </ | ||
- | ==== Compat Framework ==== | ||
- | refer: http:// | ||
- | ==== css to less ==== | ||
- | refer: | ||
- | * http:// | ||
- | * https:// | ||
- | * https:// | ||
- | * https:// | ||
- | ==== intern ==== | ||
- | refer: https:// | ||
- | ===== Bootstrap ===== | ||
- | refer: | ||
- | * http:// | ||
- | * http:// | ||
- | * http:// | ||
- | * http:// | ||
- | * http:// | ||
- | Bootstrap is the most popular **HTML, CSS, and JS framework** for developing responsive, mobile first projects on the web | ||
- | ==== Build bootstrap from source with gruntjs ==== | ||
- | === Install some basic tool before build === | ||
- | - Step1: Install **npm** tool by **install nodejs** to d: | ||
- | - Step2: Install **grunt**(Package Manager for Javascript):< | ||
- | npm install -g grunt-cli | ||
- | </ | ||
- | === Build Bootstrap === | ||
- | - Step1: Navigate to the **root /bootstrap/ directory**, | ||
- | npm install | ||
- | </ | ||
- | - Step2: Regenerates the /dist/ directory with compiled and minified CSS and JavaScript files< | ||
- | grunt dist | ||
- | </ | ||
- | ==== Create custom style ==== | ||
- | You can create a **custom navbar class**(navbar-custom), | ||
- | <code html> | ||
- | <nav class=" | ||
- | <div class=" | ||
- | <button type=" | ||
- | </ | ||
- | <a class=" | ||
- | </ | ||
- | ... | ||
- | </ | ||
- | </ | ||
- | CSS | ||
- | <code css> | ||
- | .navbar-custom { | ||
- | background-color:# | ||
- | color:# | ||
- | border-radius: | ||
- | } | ||
- | |||
- | .navbar-custom .navbar-nav > li > a { | ||
- | color:#fff; | ||
- | } | ||
- | .navbar-custom .navbar-nav > .active > a, .navbar-nav > .active > a:hover, .navbar-nav > .active > a:focus { | ||
- | color: #ffffff; | ||
- | background-color: | ||
- | } | ||
- | .navbar-custom .navbar-brand { | ||
- | color:# | ||
- | } | ||
- | </ | ||
- | |||
- | ==== Create custom style for bootstrap with less ==== | ||
- | === Advantages of this method === | ||
- | Using Less, especially with Bootstrap 3, gives you a few advantages that really make it a awesome choice | ||
- | |||
- | Advantages of less language: | ||
- | * Changing variables in one place can have wide-reaching effects, for super easy global customization | ||
- | * Augment, shift, and change existing styles and variables, or roll your own | ||
- | * Componentization. You can break your Less up into smaller files for very easy editing and separation, great for applications where you’re using version control like GitHub | ||
- | Advantages of importing bootstrap.less: | ||
- | * Have a clean, customized singular CSS file | ||
- | * You can easily comment out any part of Bootstrap you don’t need or want, right down to the single line | ||
- | * Easily override Bootstrap variables/ | ||
- | * We can easily **reused the variables and mixins** of bootstrap in new styles, for example< | ||
- | .main-content { | ||
- | .make-row(); | ||
- | .sidebar { | ||
- | padding: 20px; | ||
- | @media(min-width: | ||
- | padding: 30px; | ||
- | } | ||
- | h2 { | ||
- | font-size: 20px; | ||
- | @media(min-width: | ||
- | font-size: 30px | ||
- | } | ||
- | } | ||
- | .make-sm-column(2); | ||
- | .make-md-column(3); | ||
- | } | ||
- | .content-area { | ||
- | line-height: | ||
- | @media(min-width: | ||
- | line-height: | ||
- | } | ||
- | h1 { | ||
- | font-size: 30px; | ||
- | @media(min-width: | ||
- | font-size: 40px; | ||
- | } | ||
- | } | ||
- | .make-sm-column(10); | ||
- | .make-md-column(9); | ||
- | } | ||
- | } | ||
- | </ | ||
- | === Custom css with less file which don't change variables of bootstrap.less === | ||
- | We **create the new less file** and using **less tool** to rebuild new less file | ||
- | - Step1: Create **style.less** which import **bootstrap** and other changes in **nav.less, header.less, | ||
- | @import " | ||
- | @import " | ||
- | |||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | </ | ||
- | - Step2: create files **variables.less, | ||
- | - Step3: Using less tool to compile style.css< | ||
- | lessc style.less > style.css | ||
- | </ | ||
- | === Custom css with less file and change variables of bootstrap.less === | ||
- | refer: http:// | ||
- | - Step1: create custom-variables.less:< | ||
- | // Single primary color that all mixins use. Str8 ballin. | ||
- | @primary: | ||
- | |||
- | // Primary Variants - | ||
- | @primaryLight: | ||
- | @primaryDark: | ||
- | @primaryFaded: | ||
- | |||
- | // 180degree Variants | ||
- | @variant: | ||
- | @variantLight: | ||
- | @variantDark: | ||
- | @variantFaded: | ||
- | |||
- | // 90degree Variants | ||
- | @corner: | ||
- | @cornerLight: | ||
- | @cornerDark: | ||
- | @cornerFaded: | ||
- | </ | ||
- | - Step2: create **styles.less** which import **custom-variables.less** and other less files of bootstrap(We create this file by **editing | ||
- | // Core variables and mixins | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | |||
- | // Reset and dependencies | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | |||
- | // Core CSS | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | |||
- | // Components | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | |||
- | // Components w/ JavaScript | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | |||
- | // Utility classes | ||
- | @import " | ||
- | @import " | ||
- | |||
- | </ | ||
- | ==== Themes for bootstrap ==== | ||
- | refer: | ||
- | * http:// | ||
- | * http:// | ||
- | * http:// | ||
- | * https:// | ||
- | * http:// | ||
- | * http:// | ||
- | * http:// | ||
- | ==== Build less file in bootswatch ==== | ||
- | Create below script to build all less file in bootswatch(Base on https:// | ||
- | #!/bin/sh | ||
- | |||
- | set -e | ||
- | |||
- | cd bootstrap_themes/ | ||
- | for theme in *; do | ||
- | if [ -d " | ||
- | mkdir -p " | ||
- | lessc " | ||
- | recess --compress " | ||
- | fi | ||
- | done | ||
- | </ | ||
- | ===== Javascript Resources which support for designer ===== | ||
- | ==== Respond.js ==== | ||
- | Respond.js: https:// | ||
- | ==== Modernizr ==== | ||
- | Modernizr – http:// | ||
- | ===== UI Kits ===== | ||
- | ==== Flat UI ==== | ||
- | refer: | ||
- | * http:// | ||
- | * https:// | ||
- | |||
- | |||
- | ==== Boot Flat ==== | ||
- | refer: | ||
- | * http:// | ||
- | * https:// |
webdesign/html5.1452745630.txt.gz · Last modified: 2022/10/29 16:15 (external edit)