SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von Sebastian Pożoga

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

Mehr von 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
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 

Game jump: frontend introduction #1