bestwebdesign

Freelancign web design and Graphics design

bestwebdesign

How to Make Money as a Freelance Designer

Notwithstanding the fabulous notoriety, independent plan is no stroll in the recreation center. It takes an amazing hard working attitude, critical entrepreneurial ability, and a tad of madness to pull it off adequately. This article will talk about how to successfully bring home the bacon as a consultant (architect or something else)

web design

Is there "huge cash" to be made as an independent creator?

He had never heard of a millionaire graphic designer who “drives a Ferrari and lives in a mansion.”

css

Is there "huge cash" to be made as an independent creator?

Freelance graphic design work seems like the best job in the world: you get to make your own schedule, work from home and choose which projects and clients you take on. All of that is true; however, becoming a freelance graphic designer isn’t as easy as it seems.

html

Graphic Design Concentration

Advertising Concepts Form and Space, including Advanced Layout Design Package Design Business of Graphic Design Publication Design Art Direction

php

Graphics design project

Visual computerization, otherwise called correspondence configuration, is the workmanship and routine with regards to arranging and anticipating thoughts and encounters with visual and literary substance.

Showing posts with label HTML APIs. Show all posts
Showing posts with label HTML APIs. Show all posts

Tuesday, 5 December 2017

HTML SSE

HTML5 Server-Sent Events

Server-Sent Events - One Way Messaging

 A server-sent occasion is the point at which a web page naturally gets refreshes from a server.

This was likewise conceivable some time recently, however the web page would need to inquire as to whether any updates were accessible. With server-sent occasions, the updates come consequently.

Cases: Facebook/Twitter refreshes, stock value refreshes, news sustains, don comes about, and so forth.

Browser Support

Receive Server-Sent Event Notifications

Example

var source = new EventSource("demo_sse.php");
source.onmessage = function(event) {
    document.getElementById("result").innerHTML += event.data + "<br>";
};
Yourself Try

Check Server-Sent Events Support

In the tryit example above there were some extra lines of code to check browser support for server-sent events:

if(typeof(EventSource) !== "undefined") {
    // Yes! Server-sent events support!     // Some code..... } else {
    // Sorry! No server-sent events support.. }

Server-Side Code Example

For the example above to work, you need a server capable of sending data updates (like PHP or ASP).
The server-side event stream syntax is simple. Set the "Content-Type" header to "text/event-stream". Now you can start sending event streams.
Code in PHP (demo_sse.php):
<?php
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');

$time = date('r');
echo "data: The server time is: {$time}\n\n";
flush();
?>
Code in ASP (VB) (demo_sse.asp):
<%
Response.ContentType = "text/event-stream"
Response.Expires = -1
Response.Write("data: The server time is: " & now())
Response.Flush()
%> 





Wright © bestwebdesign and Graphics design

Share:

HTML Web Workers

HTML5 Web Workers

What is a Web Worker?

 When executing contents in a HTML page, the page winds up plainly lethargic until the point that the content is done.

A web laborer is a JavaScript that keeps running out of sight, freely of different contents, without influencing the execution of the page. You can keep on doing whatever you need: clicking, choosing things, and so on., while the web specialist keeps running out of sight.

Browser Support

Check Web Worker Support

 Before making a web laborer, check whether the client's program underpins it:

if (typeof(Worker) !== "undefined") {
    // Yes! Web worker support!     // Some code..... } else {
    // Sorry! No Web Worker support.. }

Create a Web Worker File

var i = 0;

function timedCount() {
    i = i + 1;
    postMessage(i);
    setTimeout("timedCount()",500);
}

timedCount();

Create a Web Worker Object



if (typeof(w) == "undefined") {
    w = new Worker("demo_workers.js");
}
Then we can send and receive messages from the web worker.
Add an "onmessage" event listener to the web worker.

w.onmessage = function(event){
    document.getElementById("result").innerHTML = event.data;
};


Terminate a Web Worker

When a web worker object is created, it will continue to listen for messages (even after the external script is finished) until it is terminated.
To terminate a web worker, and free browser/computer resources, use the terminate() method:
w.terminate();

Reuse the Web Worker


w = undefined;

Full Web Worker Example Code

Example

<!DOCTYPE html>
<html>
<body>

<p>Count numbers: <output id="result"></output></p>
<button onclick="startWorker()">Start Worker</button>
<button onclick="stopWorker()">Stop Worker</button>

<script>
var w;

function startWorker() {
    if(typeof(Worker) !== "undefined") {
        if(typeof(w) == "undefined") {
            w = new Worker("demo_workers.js");
        }
        w.onmessage = function(event) {
            document.getElementById("result").innerHTML = event.data;
        };
    } else {
        document.getElementById("result").innerHTML = "Sorry! No Web Worker support.";
    }
}

function stopWorker() {
    w.terminate();
    w = undefined;
}
</script>

</body>
</html>
Yourself Try





Wright © bestwebdesign and Graphics design

Share:

HTML Web Storage

HTML5 Web Storage

What is HTML Web Storage?(Wright-bestwebdesign)

 With web storage, web applications can store data locally inside the customer's program.

Before HTML5, application data must be secured in treats, consolidated into every server request. Web storage is more secure, and a considerable measure of data can be secured locally, without affecting website execution.
Not in the slightest degree like treats, quite far will be far greater (no under 5MB) and information is never traded to the server.
Web storage is per beginning stage (per space and tradition). All pages, from one beginning stage, can store and access comparative data

Browser Support

The localStorage Object

Example

// StorelocalStorage.setItem("lastname", "Smith");
// Retrieve document.getElementById("result").innerHTML = localStorage.getItem("lastname");
Yourself Try

The sessionStorage Object

Example

if (sessionStorage.clickcount) {
    sessionStorage.clickcount = Number(sessionStorage.clickcount) + 1;
} else {
    sessionStorage.clickcount = 1;
}
document.getElementById("result").innerHTML = "You have clicked the button " +
sessionStorage.clickcount + " time(s) in this session.";
Yourself Try



Wright © bestwebdesign and Graphics design

Share:

HTML Drag and Drop

HTML5 Drag and Drop

Drag and Drop

Drag and drop is an exceptionally basic element. It is the point at which you "get" a protest and drag it to an alternate area.
In HTML5, drag and drop is a piece of the standard: Any element can be draggable.

HTML Drag and Drop Example

Example

<!DOCTYPE HTML>
<html>
<head>
<script>
function allowDrop(ev) {
    ev.preventDefault();
}

function drag(ev) {
    ev.dataTransfer.setData("text", ev.target.id);
}

function drop(ev) {
    ev.preventDefault();
    var data = ev.dataTransfer.getData("text");
    ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>

<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"></div>

<img id="drag1" src="img_logo.gif" draggable="true"
ondragstart="drag(event)" width="336" height="69"
>


</body>
</html>
Yourself Try





Wright © bestwebdesign and Graphics design
Share:

HTML Geolocation

HTML5 Geolocation

Using HTML Geolocatio

 The getCurrentPosition() technique is utilized to restore the client's position.

The case underneath restores the scope and longitude of the client's position:

Example

<script>
var x = document.getElementById("demo");
function getLocation() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(showPosition);
    } else {
        x.innerHTML = "Geolocation is not supported by this browser.";
    }
}
function showPosition(position) {
    x.innerHTML = "Latitude: " + position.coords.latitude +
    "<br>Longitude: " + position.coords.longitude;
}
</script>
Yourself Try

Handling Errors and Rejections

Example

function showError(error) {
    switch(error.code) {
        case error.PERMISSION_DENIED:
            x.innerHTML = "User denied the request for Geolocation."
            break;
        case error.POSITION_UNAVAILABLE:
            x.innerHTML = "Location information is unavailable."
            break;
        case error.TIMEOUT:
            x.innerHTML = "The request to get user location timed out."
            break;
        case error.UNKNOWN_ERROR:
            x.innerHTML = "An unknown error occurred."
            break;
    }
}
Yourself Try

Displaying the Result in a Map

 

Example

function showPosition(position) {
    var latlon = position.coords.latitude + "," + position.coords.longitude;

    var img_url = "https://maps.googleapis.com/maps/api/staticmap?center=
    "
+latlon+"&zoom=14&size=400x300&sensor=false&key=YOUR_:KEY";

    document.getElementById("mapholder").innerHTML = "<img src='"+img_url+"'>";
}
Yourself Try

 


Wright © bestwebdesign and Graphics design

Share:

Web Design Tutorial

Theme Support

Munere veritus fierent cu sed, congue altera mea te, ex clita eripuit evertitur duo. Legendos tractatos honestatis ad mel. Legendos tractatos honestatis ad mel. , click here →