SlideShare une entreprise Scribd logo
1  sur  41
Télécharger pour lire hors ligne
Frontend introduction
#1
gameJUMP
Introduction
● HTML
● Web Style Sheets
○ CSS
○ SASS
● JavaScript
○ jquery
○ requirejs
● First game
HTML5
HTML
Head
Body #html tags
Body #own tags
Create own tag & attribute:
<mytagname attributeName=”attributeValue” />
Examples:
jQuery Mobile
AngularJS
Web Style Sheets
CSS #What is CSS?
“Cascading Style Sheets (CSS) is a simple mechanism for
adding style (e.g., fonts, colors, spacing) to Web
documents”
by W3C
CSS #selectors
*{...}
E{...}
E F{...}
E > F{...}
E:first-child{...}
E#id{...}

E.class{...}
a:visited{...}
E + F{...}
E[foo="warning"]{...}
E[foo~="warning"]{...}
E[lang|="en"]{...}
CSS #combining selectors
div.car.destroyed .wheel,
span.motor.destroyed .
wheel
{...}

#id ul li:first-child,
#id ul li:nth-child(3n)
{...}
CSS #properties
display: block;
float: left;
background-color: red;
width: 300px;
color: black;
font-weight: bold;
font: 1em Helvetica, sansserif;

-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
SASS
SASS #What is SASS?
“Sass is the most mature, stable, and powerful professional
grade CSS extension language in the world.”
http://sass-lang.com/
SASS #variables
$m-margin: 33px;

$color: #333;

#menu{
margin:$m-margin+10px;
}

ul li{
color:$color;
a{
lighten($color, 50%);
}
}
SASS #nesting
nav {
background: red;

nav {
background: red;
}

ul{
background: black;
}
}

nav ul{
background: black;
}
SASS @import
@import 'path/to/file';
SASS @mixin
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
-o-border-radius: $radius;
border-radius: $radius;
}
.box { @include border-radius(10px); }
JavaScript
js #What is it?!?!
“JavaScript is a programming language used to make web
pages interactive.”
“Java is to JavaScript as ham is to hamster”
js #script
<script src="myscripts.js"></script>
<script type="text/javascript">
alert(“gamejump.pl”);
</script>
js #vars
zm = 22;
var arr = [“a1”,”a2”];
var obj = {
“key”:”value”,
number: 22,
string:”text”
};

//mean window.zm = 22
js #function
function globalFn(){
return “global”;
}
var localFn = function(){
return “function is a object”;
}
js #closure
var makeCounter = function() {
var privateCounter = 0;
return {
increment: function() {
return privateCounter ++;
}
}
};
jQuery
jQuery #What is it?!?!
“jQuery is a JavaScript library. It makes things like HTML
document traversal and manipulation, event handling,
animation, and Ajax much simpler with an easy-to-use API
that works across a multitude of browsers.”
jquery.com
jQuery #ready
$(document)
.ready(function() {
// Your code here.
});

$(function() {
// Your code here.
});
jQuery #selectors
//show elements
$(“#menu :hide”).show();
//hide elements
$(“#menu :visible”).hide();

//find
var $set = $(“#menu”);
$set.find(“:visible”).hide();
jQuery #css
$(selector).addClass(name);

$(selector).css(name,val);

$(selector)
.removeClass(name);

$(selector).css({
“background”:”red”,
“color”:”blue”
});
jQuery #events
$(“.button”).on(“click”,
function(){
alert(“clicked”);
});

$(“.button”).on(“click”,
function(event){
event.preventDefault();
alert(“clicked”);
});
jQuery #val
<form method=”post” id=”f”>
<input id=”in” />
</form>

$(“#f”).on("submit"
, function(){
var v = $(“#in”).val();
alert(v);
return false;
});
jQuery #ajax
$.get("url",function(data){
alert(data);
});
$.post("url", {k1:1,k2:2},
function(data){
alert(data);
});

$.ajax({
type: "POST",
url: "some.php"
}).done(function( msg ) {
alert(msg);
});
requirejs
requirejs #What is it?!?!
“RequireJS is a JavaScript file and module loader… Using
a modular script loader like RequireJS will improve the
speed and quality of your code.”
http://requirejs.org/
requirejs #start
<html>
<head>
<script data-main="js/app" src="js/require.js">
</script>
</head>
<!-- … - ->
</html>
requirejs #config
require.config({
paths: {
backbone: "libs/backbone.js/backbone",
jquery: "http://ajax.googleapis.com/.../jquery.min",
underscore: "libs/underscore.js/underscore"
}
});
requirejs #app
require(["jquery"], function() {
$(function(){
alert(“loaded”);
});
});
requirejs #module
define([], function() {
alert(“module”);
});
Questions??
We can start create a
first game now :)
Download a game template from github
Thank you for your attention

sebastian@pozoga.eu

Contenu connexe

Tendances

jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
girish82
 

Tendances (20)

A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuery
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
 
jQuery Awesomesauce
jQuery AwesomesaucejQuery Awesomesauce
jQuery Awesomesauce
 
Jquery In Rails
Jquery In RailsJquery In Rails
Jquery In Rails
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
 
JQuery UI
JQuery UIJQuery UI
JQuery UI
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
 
Jquery
JqueryJquery
Jquery
 
jQuery
jQueryjQuery
jQuery
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
J queryui
J queryuiJ queryui
J queryui
 
Jquery ui
Jquery uiJquery ui
Jquery ui
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Let jQuery Rock Your World
Let jQuery Rock Your WorldLet jQuery Rock Your World
Let jQuery Rock Your World
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
jQuery
jQueryjQuery
jQuery
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
J Query Public
J Query PublicJ Query Public
J Query Public
 

En vedette

Responsive Web Design with HTML5 and CSS3
Responsive Web Design with HTML5 and CSS3Responsive Web Design with HTML5 and CSS3
Responsive Web Design with HTML5 and CSS3
Kannika Kong
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
Varun Garg
 

En vedette (10)

Introduction to Frontend Development - Session 1 - HTML Fundamentals
Introduction to Frontend Development - Session 1 - HTML FundamentalsIntroduction to Frontend Development - Session 1 - HTML Fundamentals
Introduction to Frontend Development - Session 1 - HTML Fundamentals
 
Game jump frontend introduction #workshop1
Game jump  frontend introduction #workshop1Game jump  frontend introduction #workshop1
Game jump frontend introduction #workshop1
 
Reponsive web design (HTML5 + css3)
Reponsive web design (HTML5 + css3)Reponsive web design (HTML5 + css3)
Reponsive web design (HTML5 + css3)
 
Responsive Web Design with HTML5 and CSS3
Responsive Web Design with HTML5 and CSS3Responsive Web Design with HTML5 and CSS3
Responsive Web Design with HTML5 and CSS3
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Refreshing Your UI with HTML5, Bootstrap and CSS3
Refreshing Your UI with HTML5, Bootstrap and CSS3Refreshing Your UI with HTML5, Bootstrap and CSS3
Refreshing Your UI with HTML5, Bootstrap and CSS3
 
UX & UI Design - Differentiate through design
UX & UI Design - Differentiate through designUX & UI Design - Differentiate through design
UX & UI Design - Differentiate through design
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 
Simple Steps to UX/UI Web Design
Simple Steps to UX/UI Web DesignSimple Steps to UX/UI Web Design
Simple Steps to UX/UI Web Design
 

Similaire à Game jump: frontend introduction #1

How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
David Giard
 
J Query(04 12 2008) Foiaz
J Query(04 12 2008) FoiazJ Query(04 12 2008) Foiaz
J Query(04 12 2008) Foiaz
testingphase
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Library
rsnarayanan
 

Similaire à Game jump: frontend introduction #1 (20)

Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
Jquery Basics
Jquery BasicsJquery Basics
Jquery Basics
 
jQuery
jQueryjQuery
jQuery
 
22 j query1
22 j query122 j query1
22 j query1
 
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
 
J query1
J query1J query1
J query1
 
jQuery
jQueryjQuery
jQuery
 
J query training
J query trainingJ query training
J query training
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
J Query(04 12 2008) Foiaz
J Query(04 12 2008) FoiazJ Query(04 12 2008) Foiaz
J Query(04 12 2008) Foiaz
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
Jquery optimization-tips
Jquery optimization-tipsJquery optimization-tips
Jquery optimization-tips
 
Jquery News Packages
Jquery News PackagesJquery News Packages
Jquery News Packages
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
Jquery introduction
Jquery introductionJquery introduction
Jquery introduction
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
jQuery Presentasion
jQuery PresentasionjQuery Presentasion
jQuery Presentasion
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Library
 

Plus de Sebastian Pożoga

GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
Sebastian Pożoga
 

Plus de Sebastian Pożoga (20)

GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
 
Go dla elektronika
Go dla elektronikaGo dla elektronika
Go dla elektronika
 
Angular2 - Co jest grane?!?!
Angular2 - Co jest grane?!?! Angular2 - Co jest grane?!?!
Angular2 - Co jest grane?!?!
 
Fosdem i inne konferencje
Fosdem i inne konferencjeFosdem i inne konferencje
Fosdem i inne konferencje
 
Angular2 - In Action
Angular2  - In ActionAngular2  - In Action
Angular2 - In Action
 
Hardgroup - Raspberry PI #1
Hardgroup - Raspberry PI #1Hardgroup - Raspberry PI #1
Hardgroup - Raspberry PI #1
 
IoT dla programistów
IoT dla programistówIoT dla programistów
IoT dla programistów
 
Sails.js - Overview
Sails.js - OverviewSails.js - Overview
Sails.js - Overview
 
3D Printing
3D Printing3D Printing
3D Printing
 
Overview of AngularJS
Overview of AngularJS Overview of AngularJS
Overview of AngularJS
 
Meet.php #gpio
Meet.php #gpioMeet.php #gpio
Meet.php #gpio
 
OSFile#2
OSFile#2OSFile#2
OSFile#2
 
The future of technologies
The future of technologiesThe future of technologies
The future of technologies
 
OSFile
OSFileOSFile
OSFile
 
gameJUMP.pl#about
gameJUMP.pl#aboutgameJUMP.pl#about
gameJUMP.pl#about
 
Poznań 4.04.2013
Poznań 4.04.2013Poznań 4.04.2013
Poznań 4.04.2013
 
Programming style
Programming styleProgramming style
Programming style
 
Blender3 d
Blender3 dBlender3 d
Blender3 d
 
Events poznań 7.02.2013
Events poznań 7.02.2013Events poznań 7.02.2013
Events poznań 7.02.2013
 
Events Poznań 18.01.2013
Events Poznań 18.01.2013Events Poznań 18.01.2013
Events Poznań 18.01.2013
 

Dernier

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Dernier (20)

The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 

Game jump: frontend introduction #1