introduction html5
html4>5
xml(1998)/css/(1966)
xhr()1999)
a,jax(2004)
- Paths
- Simple or compound shape outlines are drawn with curved or straight lines that can be filled in, outlined, or used as a clipping path. Paths have a compact coding. For example M (for ‘move to’) precedes initial numeric x and y coordinates and L (line to) precedes a point to which a line should be drawn. Further command letters (C, S, Q, Tand A) precede data that is used to draw various Bézier and elliptical curves. Z is used to close a path. In all cases, absolute coordinates follow capital letter commands and relative coordinates are used after the equivalent lower-case letters.[27]
- Basic shapes
- Straight-line paths and paths made up of a series of connected straight-line segments (polylines), as well as closed polygons, circles and ellipses can be drawn. Rectangles and round-cornered rectangles are also standard elements.[28]
- Text
- Unicode character text included in an SVG file is expressed as XML character data. Many visual effects are possible, and the SVG specification automatically handles bidirectional text (for composing a combination of English and Arabic text, for example), vertical text (as Chinese was historically written) and characters along a curved path (such as the text around the edge of the Great Seal of the United States).[29]
- Painting
- SVG shapes can be filled and/or outlined (painted with a color, a gradient, or a pattern). Fills can be opaque or have any degree of transparency. “Markers” are line-end features, such as arrowheads, or symbols that can appear at the vertices of a polygon.[30]
- Color
- Colors can be applied to all visible SVG elements, either directly or via ‘fill’, ‘stroke,’ and other properties. Colors are specified in the same way as in CSS2, i.e. using names like
black
orblue
, in hexadecimal such as#2f0
or#22ff00
, in decimal likergb(255,255,127)
, or as percentages of the formrgb(100%,100%,50%)
.[31] - Gradients and patterns
- SVG shapes can be filled or outlined with solid colors as above, or with color gradients or with repeating patterns. Color gradients can be linear or radial (circular), and can involve any number of colors as well as repeats. Opacity gradients can also be specified. Patterns are based on predefined raster or vector graphic objects, which can be repeated in x and/or y directions. Gradients and patterns can be animated and scripted.[32]
- Since 2008, there has been discussion[33][34] among professional users of SVG that either gradient meshes or preferably diffusion curves could usefully be added to the SVG specification. It is said that a “simple representation [using diffusion curves] is capable of representing even very subtle shading effects”[35] and that “Diffusion curve images are comparable both in quality and coding efficiency with gradient meshes, but are simpler to create (according to several artists who have used both tools), and can be captured from bitmaps fully automatically.”[36]
- Clipping, masking and compositing
- Graphic elements, including text, paths, basic shapes and combinations of these, can be used as outlines to define both ‘inside’ and ‘outside’ regions that can be painted (with colors, gradients and patterns) independently. Fully opaque clipping paths and semi-transparent masks are composited together to calculate the color and opacity of every pixel of the final image, using alpha blending.[37]
- Filter effects[38]
- Interactivity
- SVG images can interact with users in many ways. In addition to hyperlinks as mentioned below, any part of an SVG image can be made receptive to user interface eventssuch as changes in focus, mouse clicks, scrolling or zooming the image and other pointer, keyboard and document events. Event handlers may start, stop or alter animations as well as trigger scripts in response to such events.[39]
- Linking
- SVG images can contain hyperlinks to other documents, using XLink. URLs of SVG images can specify geometrical transforms in the fragment section.[40]
- Scripting
- All aspects of an SVG document can be accessed and manipulated using scripts in a similar way to HTML. The default scripting language is ECMAScript (closely related toJavaScript) and there are defined Document Object Model (DOM) objects for every SVG element and attribute. Scripts are enclosed in
elements. They can run in response to pointer events, keyboard events and document events as required.[41]
- Animation
- SVG content can be animated using the built-in animation elements such as
,
and
. Content can be animated by manipulating the DOM using ECMAScript and the scripting language’s built-in timers. SVG animation has been designed to be compatible with current and future versions ofSynchronized Multimedia Integration Language (SMIL). Animations can be continuous, they can loop and repeat, and they can respond to user events, as mentioned above.[42]
- Fonts
- As with HTML and CSS, text in SVG may reference external font files, such as system fonts. If the required font files do not exist on the machine where the SVG file is rendered, the text may not appear as intended. To overcome this limitation, text can be displayed in an ‘SVG font’, where the required glyphs are defined in SVG as a font that is then referenced from the
element.[43]
- Metadata
- In accord with the W3C‘s Semantic Web initiative, SVG allows authors to provide metadata about SVG content. The main facility is the
element, where the document can be described using Dublin Core metadata properties (e.g., title, creator/author, subject, description, etc). Other metadata schemas may also be used. In addition, SVG defines
and
elements where authors may also provide plain-text descriptive material within an SVG image to help indexing, searching and retrieval by a number of means.[44]
[edit]SVG on the web
[edit]Example
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)" />
</svg>
svg(web vector graphics)
-scalable vector graphics
rectagle
<rect x,y width/…..
……id and css class
html likes for drawing
mozilla download center– a map of the wolr the svg map-
benjamin joffes
population demo
think about data visualizations
————————————-recordings ———–ur. data bases
bespin (created by mozilla)
again a data visualization for svg and canvas by the german elections
it supports all the modern ——-svg web / java script base
SVG web
SVG is the future so is the main requirment for obtaining a minimal understanding of
canvas and svg (they are
html 5 video
application cashe-database
Number
object’s properties to assign values to several numeric variables:var
biggestNum = Number.MAX_VALUE;
var
smallestNum = Number.MIN_VALUE;
var
infiniteNum = Number.POSITIVE_INFINITY;
var
negInfiniteNum = Number.NEGATIVE_INFINITY;
var
notANum = Number.NaN;
The following example converts the Date
object to a numerical value using Number
as a function:
var
d =
new
Date(
"December 17, 1995 03:24:00"
);
print(Number(d));// print
This displays "819199440000".
*
MAX_VALUE
-MAX_VALUE
.MIN_VALUE
-MIN_VALUE
.NaN
NEGATIVE_INFINITY
POSITIVE_INFINITY
prototype
|
s1 = "2 + 2" ; // creates a string primitive s2 = new String( "2 + 2" ); // creates a String object console.log(eval(s1)); // returns the number 4 console.log(eval(s2)); // returns the string "2 + 2" |
String
generic methods
Array
methods.var
num = 15;
alert(String.replace(num, /5/,
'2'
));
/*globals define*/
// Assumes all supplied String instance methods already present (one may use shims for these if not available)
(
function
() {
'use strict'
;
var
i,
// We could also build the array of methods with the following, but the
// getOwnPropertyNames() method is non-shimable:
// Object.getOwnPropertyNames(String).filter(function (methodName) {return typeof String[methodName] === 'function'});
methods = [
'quote'
,
'substring'
,
'toLowerCase'
,
'toUpperCase'
,
'charAt'
,
'charCodeAt'
,
'indexOf'
,
'lastIndexOf'
,
'startsWith'
,
'endsWith'
,
'trim'
,
'trimLeft'
,
'trimRight'
,
'toLocaleLowerCase'
,
'toLocaleUpperCase'
,
'localeCompare'
,
'match'
,
'search'
,
'replace'
,
'split'
,
'substr'
,
'concat'
,
'slice'
,
'fromCharCode'
],
methodCount = methods.length,
assignStringGeneric =
function
(methodName) {
var
method = String.prototype[methodName];
String[methodName] =
function
(arg1) {
return
method.apply(arg1, Array.prototype.slice.call(arguments, 1));
};
};
for
(i = 0; i < methodCount; i++) {
assignStringGeneric(methods[i]);
}
}());
string instances-methods- non-native methods
uowm2013-1lesson-javascript lanqauge code
// explanations about i frme -examples 14years old Nyegen Phong,
-change the gameHeight and gameWidth variables
-change the height and width attributes
iframe.game class, in the style of the index page
//asigning variables
var gameHeight = 320
var gameWidth = 360
var intervalOne,intervalTwo,timeoutOne,x
var angle = 2
var tempX = 0
var tempY = 0
var block = 1
var square = 0
var squareTop = 0
var squareLeft = 0
var squareMotion = 1
var speed = 80
var getPad = 0
var nextScore = 0
var score = 0
var count = 0
var collisionOne = 0
var collisionTwo = 0
var collisionThree = 0
document.body.style.margin = “0px”
document.body.style.padding = “0px”
function setupGame() // about fuctions, doc., pad L.T,R,…
{
document.getElementById(“game”).style.borderRight = “1px solid #aaa”
document.getElementById(“game”).style.borderRight = “1px solid #aaa”
document.getElementById(“game”).style.borderBottom = “1px solid #aaa”
document.getElementById(“game”).style.width = gameWidth+”px”
document.getElementById(“game”).style.height = gameHeight+”px”
document.getElementById(“square0”).style.position = “absolute”
document.getElementById(“square0”).style.width = “40px”
document.getElementById(“square0”).style.height = “40px”
document.getElementById(“square0”).style.backgroundColor = “#444”
document.getElementById(“square0”).style.display = “none”
document.getElementById(“square1”).style.position = “absolute”
document.getElementById(“square1”).style.width = “40px”
document.getElementById(“square1”).style.height = “40px”
document.getElementById(“square1”).style.backgroundColor = “#444”
document.getElementById(“square1”).style.display = “none”
document.getElementById(“pad”).style.position = “absolute”
document.getElementById(“pad”).style.width = “60px”
document.getElementById(“pad”).style.height = “30px”
document.getElementById(“pad”).style.paddingTop = “10px”
document.getElementById(“pad”).style.textAlign = “center”
document.getElementById(“pad”).style.font = “15px Verdana, sans-serif”
document.getElementById(“pad”).style.backgroundColor = “#000”
document.getElementById(“pad”).style.color = “#fff”
document.getElementById(“pad”).innerHTML = “PLAY“
document.getElementById(“play”).style.color = “#fff”
document.getElementById(“play”).style.textDecoration = “none”
padTop = Math.floor(gameHeight/2)-20
padLeft = Math.floor(gameWidth/2)-30
document.getElementById(“pad”).style.top = padTop+”px”
document.getElementById(“pad”).style.left = padLeft+”px”
document.getElementById(“notepad”).innerHTML = “BounceGame”
document.getElementById(“notepad”).style.padding = “10px”
document.getElementById(“notepad”).style.textAlign = “center”
document.getElementById(“notepad”).style.font = “2.0em Georgia, serif”
document.getElementById(“notepad”).style.fontWeight = “normal”
document.getElementById(“notepad”).style.color = “#222”
timeoutOne = setTimeout(“intervalTwo = setInterval(‘demoGame()’, speed)”, 4000)
}
function demoGame()
{
angle = 2
clearTimeout(timeoutOne)
document.getElementById(“square0”).style.display = “block”
document.getElementById(“square1”).style.display = “block”
if(square == 0)
{
x = document.getElementById(“square0”)
square = 1
}
else
{
x = document.getElementById(“square1”)
square = 0
}
bounceGame()
}
function newGame()
{
block = 0
angle = 2
tempX = 0
tempY = 0
square = 0
squareTop = 0
squareLeft = 0
squareMotion = 1
nextScore = 0
score = 0
count = 0
collisionOne = 0
collisionTwo = 0
collisionThree = 0
clearTimeout(timeoutOne)
clearInterval(intervalOne)
clearInterval(intervalTwo)
document.getElementById(“square0”).style.left = “0px”
document.getElementById(“square0”).style.top = “0px”
document.getElementById(“square0”).style.display = “block”
document.getElementById(“square1”).style.left = “0px”
document.getElementById(“square1”).style.top = “0px”
document.getElementById(“square1”).style.display = “block”
document.getElementById(“pad”).style.top = (gameHeight-40)+”px”
document.getElementById(“pad”).innerHTML = “”
document.getElementById(“notepad”).innerHTML = “”
intervalOne = setInterval(“playGame()”, speed)
}
function playGame()
{
if(block)
{
return
}
if(square == 0)
{
x = document.getElementById(“square0”)
square = 1
}
else
{
x = document.getElementById(“square1”)
square = 0
}
bounceGame()
checkCollision()
}
function assignM(aM)
{
squareMotion = aM
}
function bounceGame()
{
if(squareMotion==1)
{
if(squareTop>=(gameHeight-40) && squareLeft>=(gameWidth-40))
{
assignM(3)
moveDR(-40)
}
if(squareTop>=(gameHeight-40))
{
assignM(2)
moveDL(-40)
}
else if(squareLeft>=(gameWidth-40))
{
assignM(4)
moveDL(40)
}
else {
moveDR(40)
}
}
else if(squareMotion==2)
{
if(squareTop=(gameWidth-40))
{
assignM(4)
moveDL(40)
}
if(squareLeft>=(gameWidth-40))
{
assignM(3)
moveDR(-40)
}
else if(squareTop<=0)
{
assignM(1)
moveDR(40)
}
else
{
moveDL(-40)
}
}
else if(squareMotion==3)
{
if(squareTop<=0 && squareLeft<=0)
{
assignM(1)
moveDR(40)
}
if(squareTop<=0)
{
assignM(4)
moveDL(40)
}
else if(squareLeft<=0)
{
assignM(2)
moveDL(-40)
}
else
{
moveDR(-40)
}
}
else if(squareMotion==4)
{
if(squareTop>=(gameHeight-40) && squareLeft<=0)
{
assignM(2)
moveDL(-40)
}
if(squareLeft<=0)
{
assignM(1)
moveDR(40)
}
else if(squareTop>=(gameHeight-40))
{
assignM(3)
moveDR(-40)
}
else
{
moveDL(40)
}
}
}
function moveDR(amount)
{
save = amount
amount = Math.floor(amount/angle)
if(angle == 0)
{
amount = 0
}
squareLeft += amount
x.style.left = squareLeft+”px”
squareTop += save
x.style.top = squareTop+”px”
}
function moveDL(amount)
{
save = amount
amount = Math.floor(amount/angle)
if(angle == 0)
{
amount = 0
}
squareLeft -= amount
x.style.left = squareLeft+”px”
squareTop += save
x.style.top = squareTop+”px”
}
function assignAngle(aa)
{
if(aa==1)
{
angle = 0
nextScore = 1000
}
if(aa==2)
{
angle = 2
nextScore = 100
}
score += nextScore
document.getElementById(“pad”).innerHTML = nextScore
}
function flashScore()
{
if(score > 0)
{
if(nextScore == “BounceGame”)
{
nextScore = score
}
else
{
nextScore = “BounceGame”
}
document.getElementById(“notepad”).innerHTML = nextScore
}
else
{
document.getElementById(“notepad”).innerHTML = “BounceGame”
}
}
function countUp()
{
if(count < (Math.floor(score/10)*8))
{
count += Math.floor(score/10)
}
else if(count >= (Math.floor(score/10)*8) && count <= (Math.floor(score/10)*9))
{
if((Math.floor(score/10)*9) > 200)
{
count += Math.floor(score/10)
}
else
{
count += 10
}
}
else
{
if(Math.floor(score/10) > 30)
{
count += 10
}
else
{
count += 1
}
}
if(count > score)
{
count = score
clearInterval(intervalOne)
intervalOne = setInterval(“flashScore()”, 2000)
}
document.getElementById(“notepad”).innerHTML = count
}
function checkCollision()
{
var actualLeft = getPad-30
if(squareTop == 0)
{
document.getElementById(“pad”).innerHTML = “”
}
if((squareTop+40)==(gameHeight-40))
{
difference = Math.floor(squareLeft-actualLeft)
if(difference>=(-39)&&difference<4)
{
collisionOne++
collisionTwo = 0
collisionThree = 0
if(collisionOne > 3)
{
assignM(Math.floor(Math.random() * 2) + 2)
}
else
{
assignM(3)
}
assignAngle(2)
}
else if(difference>=5&&difference<15)
{
collisionOne = 0
collisionTwo++
collisionThree = 0
if(collisionTwo > 3)
{
assignM(Math.floor(Math.random() * 2) + 2)
assignAngle(2)
}
else
{
assignM(3)
assignAngle(1)
}
}
else if(difference>=15&&difference<59)
{
collisionOne = 0
collisionTwo = 0
collisionThree++
if(collisionThree > 3)
{
assignM(Math.floor(Math.random() * 2) + 2) // examples by math creativity-flash creativity paul-
}
else
{
assignM(2)
}
assignAngle(2)
}
}
else if((squareTop+40)==gameHeight)
{
block = 1
clearInterval(intervalOne)
setupGame()
intervalOne = setInterval(“countUp()”, speed)
}
}
function getMouseXY(e)
{
if(navigator.appName==”Netscape”)
{
tempX = e.pageX
tempY = e.pageY
}
else
{
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
}
if(tempX < 0)
{
tempX = 0
}
getPad = tempX
if(getPad <= 30)
{
getPad = 30
}
if((getPad-30) > Math.floor(gameWidth-60))
{
getPad = Math.floor(gameWidth-60)+30
}
if(!block)
{
document.getElementById(“pad”).style.left = (getPad-30)+”px”
}
}
document.onmousemove = getMouseXY
setupGame()
.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*create a file named countdown.css in a folder css**************************************************
***************************************************/
.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ul.jCounterDefault {
height: 5.2em;
margin: 0;
font-size: 16px; /* change to resize counter */
padding: 0;
}
ul.jCounterDefault * {
margin: 0;
padding: 0;
}
ul.jCounterDefault li {
background-color: #333;
border: 0.16em solid #fff;
color: #fff;
display: inline;
float: left;
list-style-type: none;
margin-left: 0.2em;
min-width: 4.3em;
position: relative;
text-align: center;
border-radius: 0.5em;
-moz-box-shadow: 0 0 0.2em #777;
-ms-box-shadow: 0 0 0.2em #777;
-o-box-shadow: 0 0 0.2em #777;
-webkit-box-shadow: 0 0 0.2em #777;
box-shadow: 0 0 0.2em #777;
}
ul.jCounterDefault span {
display: block;
font: normal bold 300% times;
letter-spacing: 0.08em;
margin-left: 0.06em;
padding: 0 0.1em;
}
ul.jCounterDefault em.textDays, ul.jCounterDefault em.textHours, ul.jCounterDefault em.textMinutes, ul.jCounterDefault em.textSeconds{
display: block;
font: normal normal 80% “Trebuchet MS”;
letter-spacing: 0;
margin: 0 auto;
padding-bottom: 0.4em;
}
.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//default settings
//merge the settings with the options values
//METHODS
//FUNCTIONS
//main jCounter processor
var thisInstanceFormat = thisEl.data(“userOptions”).format;
//conditional Ss
//updates the jCounter’s html values
}
//////////////////////////////////////////////////////////////
jCounter – jQuery plugin – devingredients.com
// the file is not working when runs locally
$(document).ready(function() {
//first counter
$(“.countdown1”).jCounter({
date: “01 january 2013 12:00:00”, //format: DD month YYYY HH:MM:SS
timezone: “Europe/Bucharest”,
format: “dd:hh:mm:ss”,
twoDigits: ‘on’,
fallback: function() { console.log(“Counter 1 finished!”) }
});
$(‘.pause1’).click(function() {
$(“.countdown1”).jCounter(‘pause’);
});
$(‘.stop1’).click(function() {
$(“.countdown1”).jCounter(‘stop’);
});
$(‘.start1’).click(function() {
$(“.countdown1”).jCounter(‘start’);
});
//second counter
$(“.countdown3”).jCounter({
format: “ss”,
twoDigits: ‘on’,
customDuration: 60*9, //9 minutes
fallback: function() { console.log(“Counter 2 finished! “) }
});
$(‘.pause3’).click(function() {
$(“.countdown3”).jCounter(‘pause’);
});
$(‘.stop3’).click(function() {
$(“.countdown3”).jCounter(‘stop’);
});
$(‘.reset3’).click(function() {
$(“.countdown3”).jCounter(‘reset’);
});
$(‘.start3’).click(function() {
$(“.countdown3”).jCounter(‘start’);
});
//third counter
$(“.countdown2”).jCounter({
format: “dd:hh:mm:ss”,
twoDigits: ‘on’,
customRange: ’10:9999′,
fallback: function() { console.log(“Counter 3 finished!”) }
});
$(‘.pause2’).click(function() {
$(“.countdown2”).jCounter(‘pause’);
});
$(‘.stop2’).click(function() {
$(“.countdown2”).jCounter(‘stop’);
});
$(‘.reset2’).click(function() {
$(“.countdown2”).jCounter(‘reset’);
});
$(‘.start2’).click(function() {
$(“.countdown2”).jCounter(‘start’);
});
});
Date-based countdown
00
Days
00
Hours
00
Minutes
00
Seconds
Custom-Duration Counter
00
Seconds
Custom-Range Count Up
00
Hours
00
Minutes
00
Seconds
/////////////////////////////
and finally the php file dateandtime.php
that has to be executed(+php server)
<?php
if (isset($_GET[‘timezone’])) {
$timezone = new DateTimeZone($_GET[‘timezone’]);
} else {
$timezone = new DateTimeZone(“Europe/London”);
}
$date = new DateTime();
$date->setTimezone($timezone);
$dateAndTime = array(“currentDate”=>$date->format(‘d F Y H:i:s’));
echo $_GET[‘callback’] . ‘(‘ . json_encode($dateAndTime) . ‘)’;
?>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////download //////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
Τα πρώτα έτη και όσοι/ες θα κάνουν κάποια θεματική 1-3 μμ την Τετάρτη
Μετά την παρουσιαση που έχει 3-5μμ σε σχέση με τις προοπτικές επαγγελματικής αποκατάστασης θα συνεχιστεί η συνάντη
Σχόλιο by vasileios bouzas — 2 Απριλίου 2013 @ 13:30
Διόρθωση 1μμ-3μμ η παρουσίαση για το wrkshp για επαγγελματικά
και 3-4 σύντομη παρουσίαση 4-7 ανοιχτή συνάντηση με όσους/ες θέλουν να ασχοληθούν με τις θεματικές
Σχόλιο by vasileios bouzas — 2 Απριλίου 2013 @ 14:42