There's always a gap between theoretical knowledge and practice. Particularly, how to start you first web project when you are familiar with HTML, JS, and CSS. This presentation covers such aspects as project functionality, modeling, file organization, building initial layout with HTML, insights of CSS, and jQuery.
2. WHAT'S YOUR NAME, U SAID?
Front end Developer @ New ProImage
Co-organizer @ Ember-IL Meetup
Graduate Student @ Technion, IM&E
Web: http://bolshchikov.net
Blog: http://blog.bolshchikov.net
Github: https://github.com/bolshchikov
3. OUTLINE
1. Understand the destiny
2. Organize your life
3. Choose your comrades
4. Lay out your way
5. Add the make up
6. Bring some action
7. Coding
6. DESTINY :: GOAL
The goal should formulate the main purpose or idea of future
project. It can be describe by one sentence or two sentences,
e.g.
“Create user-friendly web store for
selling fruits and vegetables”
7. DESTINY :: FUNCTIONALITY
● Login
● Display a list of available items with prices
● Display detailed information per item
● Be able to add the item to the basket
● Calculate the overall sum
● Send the order
11. HTML5BOILERPLATE
Project started by Paul Irish (Google) for keepin'
best techniques for web project
http://html5boilerplate.com/
● Code structure
● File template (html, css, js)
● Comes with libraries: jQuery, Modernizr
● and other
13. COMRADES
How? Checklist:
○ Amount of watchers in Github (big)
○ Amount of forks on Github (medium)
○ Amount of issues on Github (small)
○ Amount of results on Stackoverflow
○ Amount of votes on Stackoverflow
14. COMRADES :: DOM
Why? Cross browser API is not the same
What? Relieves you from pain developments
Who? jQuery, Zepto, MooTools
Save yourself some time
DO NOT WRITE YOUR OWN
16. COMRADES :: JS FRAMEWORKS
Why? JS mess, spaghetti code
What? Clean separation of concerns
Who? EmberJS, Backbone, Angular, etc.
How? Write test programs in each of them
http://todomvc.com/
24. CSS :: SELECTORS
Selector Description Example
*
Matches any element.
E Matches any E element (i.e., an
element of type E).
a
E F Matches any F element that is a
descendant of an E element.
div a
E > F Matches any F element that is a
child of an element E.
div > a
E:first-child Matches element E when E is the
first child of its parent.
li:first-child
E:link
E:visited
Matches element E if E is the source
anchor of a hyperlink of which the
target is not yet visited (:link) or
already visited (:visited).
a:link
a:visited
25. CSS :: SELECTORS (cont.)
Selector Description Example
E:active
E:hover
E:focus
Matches E during certain user
actions.
a:active
a:hover
a:focus
E + F Matches any F element immediately
preceded by a sibling element E.
div + div
E[foo] Matches any E element with the
"foo" attribute set (whatever the
value).
div[data-id]
E[foo="warning"] Matches any E element whose "foo"
attribute value is exactly equal to
"warning".
input[type=”text”]
DIV.warning Language specific. (In HTML, the
same as DIV[class~="warning"].)
div.navigation
E#myid Matches any E element with ID equal
to "myid".
div#main
33. JQUERY :: SELECTORS
$(selector).method()
For example, $(‘#list’) will return the elements which has the attribute id=”list”.
For more, see http://api.jquery.com/category/selectors/.
37. JAVASCRIPT :: GUIDELINES
Do not populate global space
Use namespaces: create one global variable, e.g. name of your app, and store
everything there.
window.YUI = {};
YUI.version = ‘0.3’,
YUI.start = function () {};
38. JAVASCRIPT :: GUIDELINES
Write JavaScript only in js file
Do NOT write it in HTML:
<a class=”add” onclick=”function () {}”>Add</a>
Instead use jQuery and register the click handler:
$(‘.add’).on(‘click’, function () {});