Multi Step Form with Progress Bar using jQuery and CSS3

Wizard

Got long forms on your website ? Break them up into smaller logical sections and convert it into a multi-step form with a cool progress bar. Could work for lengthy processes like registration, checkout, profile fillups, 2-factor authentication logins, etc.

The form has 3 fieldsets containing the 3 different sections of the form. The fieldsets are absolutely positioned and only the first one is visible by default. Moving to the next section fades out the current fieldset using jQuery .animate() and brings in the next fieldset from the right. The reverse happens if the user moves to the previous section.

HTML

<!-- multistep form -->
<form id="msform">
	<!-- progressbar -->
	<ul id="progressbar">
		<li class="active">Account Setup</li>
		<li>Social Profiles</li>
		<li>Personal Details</li>
	</ul>
	<!-- fieldsets -->
	<fieldset>
		<h2 class="fs-title">Create your account</h2>
		<h3 class="fs-subtitle">This is step 1</h3>
		<input type="text" name="email" placeholder="Email" />
		<input type="password" name="pass" placeholder="Password" />
		<input type="password" name="cpass" placeholder="Confirm Password" />
		<input type="button" name="next" class="next action-button" value="Next" />
	</fieldset>
	<fieldset>
		<h2 class="fs-title">Social Profiles</h2>
		<h3 class="fs-subtitle">Your presence on the social network</h3>
		<input type="text" name="twitter" placeholder="Twitter" />
		<input type="text" name="facebook" placeholder="Facebook" />
		<input type="text" name="gplus" placeholder="Google Plus" />
		<input type="button" name="previous" class="previous action-button" value="Previous" />
		<input type="button" name="next" class="next action-button" value="Next" />
	</fieldset>
	<fieldset>
		<h2 class="fs-title">Personal Details</h2>
		<h3 class="fs-subtitle">We will never sell it</h3>
		<input type="text" name="fname" placeholder="First Name" />
		<input type="text" name="lname" placeholder="Last Name" />
		<input type="text" name="phone" placeholder="Phone" />
		<textarea name="address" placeholder="Address"></textarea>
		<input type="button" name="previous" class="previous action-button" value="Previous" />
		<input type="submit" name="submit" class="submit action-button" value="Submit" />
	</fieldset>
</form>

CSS

/*custom font*/
@import url(http://fonts.googleapis.com/css?family=Montserrat);

/*basic reset*/
* {margin: 0; padding: 0;}

html {
	height: 100%;
	/*Image only BG fallback*/
	background: url('http://thecodeplayer.com/uploads/media/gs.png');
	/*background = gradient + image pattern combo*/
	background: 
		linear-gradient(rgba(196, 102, 0, 0.2), rgba(155, 89, 182, 0.2)), 
		url('http://thecodeplayer.com/uploads/media/gs.png');
}

body {
	font-family: montserrat, arial, verdana;
}
/*form styles*/
#msform {
	width: 400px;
	margin: 50px auto;
	text-align: center;
	position: relative;
}
#msform fieldset {
	background: white;
	border: 0 none;
	border-radius: 3px;
	box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4);
	padding: 20px 30px;
	
	box-sizing: border-box;
	width: 80%;
	margin: 0 10%;
	
	/*stacking fieldsets above each other*/
	position: absolute;
}
/*Hide all except first fieldset*/
#msform fieldset:not(:first-of-type) {
	display: none;
}
/*inputs*/
#msform input, #msform textarea {
	padding: 15px;
	border: 1px solid #ccc;
	border-radius: 3px;
	margin-bottom: 10px;
	width: 100%;
	box-sizing: border-box;
	font-family: montserrat;
	color: #2C3E50;
	font-size: 13px;
}
/*buttons*/
#msform .action-button {
	width: 100px;
	background: #27AE60;
	font-weight: bold;
	color: white;
	border: 0 none;
	border-radius: 1px;
	cursor: pointer;
	padding: 10px 5px;
	margin: 10px 5px;
}
#msform .action-button:hover, #msform .action-button:focus {
	box-shadow: 0 0 0 2px white, 0 0 0 3px #27AE60;
}
/*headings*/
.fs-title {
	font-size: 15px;
	text-transform: uppercase;
	color: #2C3E50;
	margin-bottom: 10px;
}
.fs-subtitle {
	font-weight: normal;
	font-size: 13px;
	color: #666;
	margin-bottom: 20px;
}
/*progressbar*/
#progressbar {
	margin-bottom: 30px;
	overflow: hidden;
	/*CSS counters to number the steps*/
	counter-reset: step;
}
#progressbar li {
	list-style-type: none;
	color: white;
	text-transform: uppercase;
	font-size: 9px;
	width: 33.33%;
	float: left;
	position: relative;
}
#progressbar li:before {
	content: counter(step);
	counter-increment: step;
	width: 20px;
	line-height: 20px;
	display: block;
	font-size: 10px;
	color: #333;
	background: white;
	border-radius: 3px;
	margin: 0 auto 5px auto;
}
/*progressbar connectors*/
#progressbar li:after {
	content: '';
	width: 100%;
	height: 2px;
	background: white;
	position: absolute;
	left: -50%;
	top: 9px;
	z-index: -1; /*put it behind the numbers*/
}
#progressbar li:first-child:after {
	/*connector not needed before the first step*/
	content: none; 
}
/*marking active/completed steps green*/
/*The number of the step and the connector before it = green*/
#progressbar li.active:before,  #progressbar li.active:after{
	background: #27AE60;
	color: white;
}

JavaScript

//jQuery time
var current_fs, next_fs, previous_fs; //fieldsets
var left, opacity, scale; //fieldset properties which we will animate
var animating; //flag to prevent quick multi-click glitches

$(".next").click(function(){
	if(animating) return false;
	animating = true;
	
	current_fs = $(this).parent();
	next_fs = $(this).parent().next();
	
	//activate next step on progressbar using the index of next_fs
	$("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active");
	
	//show the next fieldset
	next_fs.show(); 
	//hide the current fieldset with style
	current_fs.animate({opacity: 0}, {
		step: function(now, mx) {
			//as the opacity of current_fs reduces to 0 - stored in "now"
			//1. scale current_fs down to 80%
			scale = 1 - (1 - now) * 0.2;
			//2. bring next_fs from the right(50%)
			left = (now * 50)+"%";
			//3. increase opacity of next_fs to 1 as it moves in
			opacity = 1 - now;
			current_fs.css({'transform': 'scale('+scale+')'});
			next_fs.css({'left': left, 'opacity': opacity});
		}, 
		duration: 800, 
		complete: function(){
			current_fs.hide();
			animating = false;
		}, 
		//this comes from the custom easing plugin
		easing: 'easeInOutBack'
	});
});

$(".previous").click(function(){
	if(animating) return false;
	animating = true;
	
	current_fs = $(this).parent();
	previous_fs = $(this).parent().prev();
	
	//de-activate current step on progressbar
	$("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active");
	
	//show the previous fieldset
	previous_fs.show(); 
	//hide the current fieldset with style
	current_fs.animate({opacity: 0}, {
		step: function(now, mx) {
			//as the opacity of current_fs reduces to 0 - stored in "now"
			//1. scale previous_fs from 80% to 100%
			scale = 0.8 + (1 - now) * 0.2;
			//2. take current_fs to the right(50%) - from 0%
			left = ((1-now) * 50)+"%";
			//3. increase opacity of previous_fs to 1 as it moves in
			opacity = 1 - now;
			current_fs.css({'left': left});
			previous_fs.css({'transform': 'scale('+scale+')', 'opacity': opacity});
		}, 
		duration: 800, 
		complete: function(){
			current_fs.hide();
			animating = false;
		}, 
		//this comes from the custom easing plugin
		easing: 'easeInOutBack'
	});
});

$(".submit").click(function(){
	return false;
})

 

Happy coding!

Tim Cook defended Apple's approach to security: 'Encryption is inherently great'

Apple CEO Tim Cook has robustly defended his company's strident approach to security in a new on-stage Q&A, declaring: "Encryption is inherently great."

The Cupertino tech exec spoke in Salt Lake City, Utah, as part of the US state's "Utah Tech Tour" event

How Do I Add a Splitter to my WPF Window?

Splitters are a useful UI feature where the width or height of a control on the form can be modified to show more or less information.

An Example of this is the splitter between the folder tree-view in and the file and subfolder detail view in Windows Explorer, allowing the size of the folder tree-view on the left-hand side of the form to be sized up to 50% of the form width. Windows Forms 1.1 included a Splitter control, and Windows Forms 2.0 included a SplitContainer.

WPF does not have equivalent versions of either of these controls; however it is possible to add splitters to your WPF application using the WPF Grid, and a GridSplitter. The example code below allows the two columns in the grid to be re-sized. This is done by adding a GridSplitter as a child item of the Grid.

<Window x:Class="PSC.Splitter.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="PSC.Splitter" Height="300" Width="300">
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition />
      </Grid.ColumnDefinitions>
      <StackPanel Background="#feca00" Grid.Column="0">
        <TextBlock FontSize="35" Foreground="#58290A" 
                   TextWrapping="Wrap">Left Hand Side</TextBlock>
      </StackPanel>
      <GridSplitter/>
      <Border CornerRadius="10" BorderBrush="#58290A" 
              BorderThickness="5" Grid.Column="1">
        <TextBlock FontSize="25" Margin="20" Foreground="#FECA00" 
                   TextWrapping="Wrap">Right Hand Side</TextBlock>
      </Border>
    </Grid>
</Window>

Happy coding!

Microsoft announces formation of AI and Research Group with over 5000 computer scientists

cortana-microsoft_story

For the last year or so, Microsoft has backed artificial intelligence as "the most important technology on the planet" and has released various products that make use of AI. The company's flagship AI product, Cortana, is available to all Windows 10 users - although its capabilities vary depending on which part of the world you're in. Now, the company will be bringing its artificial intelligence research under one umbrella with the formation of the Microsoft AI and Research Group that will include 5000 computer scientists.

The AI and Research Group will be headed by Microsoft veteran of 20 years, Harry Shum, who has worked with Microsoft Research and Bing prior to this appointment. The group will bring together various related teams such as Information Platform, Cortana and Bing, and Ambient Computing and Robotics teams.

According to Microsoft's post about the announcement, the company will be taking a four-pronged approach to democratize AI:

  • Agents: Harness AI to fundamentally change human and computer interaction through agents such as Microsoft’s digital personal assistant Cortana
  • Applications: Infuse every application, from the photo app on people’s phones to Skype and Office 365, with intelligence
  • Services: Make these same intelligent capabilities that are infused in Microsoft’s apps —cognitive capabilities such as vision and speech, and machine analytics — available to every application developer in the world
  • Infrastructure: Build the world’s most powerful AI supercomputer with Azure and make it available to anyone, to enable people and organizations to harness its power

Currently, there are no announcements regarding any upcoming products, but with the newly formed group we can surely expect to hear more about AI and related products from the software giant in the not-too-distant future.

Source: Microsoft

Alan Turing's computer-generated music gets restored after 65 years

alan_turing

Alan Turing is considered to be one of the fathers of computer science. He played a crucial role in World War II counter intelligence and worked for the Government Code and Cypher School at Bletchley Park.

He was also responsible for breaking a large number of Nazi ciphers, including the German Enigma code. After the war, Turing continued his work as a pioneer computer engineer, and developed what’s considered to be one of the first designs for a stored-program computer.

But it seems code breaking wasn’t Turing’s only talent.

Now the earliest known recording of computer-generated music, created more than 65 years ago, has been restored by the University of Canterbury. But the interesting thing is that it was created on computer programming techniques devised by Turing himself. 

Here's the story. In 1951, a BBC outside-broadcast unit in Manchester used a portable acetate disc cutter to capture three melodies played by a primeval computer. This gigantic computer filled much of the ground floor of pioneering British computer scientist Alan Turing's Computing Machine Laboratory.

Now, decades later, director of the Turing Archive for the History of Computing, Professor Jack Copeland, and his fellow researcher UC alumni and composer Jason Long, have restored the music. However, it has not been so easy. The researchers had to do some electronic sleuthing to recreate the historic sound accurately.

“Today all that remains of the recording session is a 12-inch single-sided acetate disc, cut by the BBC's technician while the computer played. The computer itself was scrapped long ago, so the archived recording is our only window on that historic soundscape,” said the researchers.

“What a disappointment it was, therefore, to discover that the frequencies in the recording were not accurate: the recording gave at best only a rough impression of how the computer sounded.”

They found that there was a deviation in the speed of the recording, probably as a result of the turntable in BBC's portable disc cutter rotating too fast. But, with some electronic detective work, it proved possible to restore the recording – with the result that the true sound of this ancestral computer can be heard once again, for the first time in more than half a century.

The computer music researchers were then able to calculate exactly how much the recording had to be speeded up in order to reproduce the original sound of the computer.

“As well as increasing the speed – and so altering the frequencies – we also filtered out extraneous noise from the recording; and using pitch-correction software we removed the effects of a troublesome wobble in the speed of the recording,” added the researchers.

“It was a beautiful moment when we first heard the true sound of Turing's computer.”

The complete 1951 recording, including God Save the King, nursery rhyme Baa Baa Black Sheep and Glenn Miller hit In The Mood, can be heard here over at the university’s website.

Europe’s Court of Justice rules that hyperlinking can infringe on copyright

EuropeanCommissionEuropa

On Thursday, the Dutch publisher of Playboy won a major legal victory concerning photographs that had been uploaded to the internet without its permission on a file sharing site. The ruling handed down by the European Union Court of Justice could have enormous consequences for users across the internet.

The case stemmed from a complaint against a Dutch website called GeenStijl, which had posted links to leaked photos from Playboy in October 2011. The website had received a tip that the pictures had been uploaded to FileFactory. It posted a cutout of one of the images and linked to the rest. Sanoma Media, Playboy’s Dutch publisher, requested that content be removed, which GeenStijl refused to do. Sanoma then sued the GeenStijl and its parent company, GS Media, arguing that the hyperlink and part of one of the images infringed on its copyright. The case found itself before the EU court, which ruled that posting hyperlinks amounted to copyright infringement, because the website profited from the traffic that it generated.

The court noted in its ruling that the website’s editors knew that the works had yet to be published in the print magazine and that its distribution through FileFactory was unauthorized. "Whoever post[ed] those links knew or ought to have been aware of those facts and the fact that that rightholder did not consent to the publication of the works in question on that latter website."

They key point in this case comes down to the phrase "Communication to the public of their works" in Article 3(1) of Directive 2001/29, On the harmonisation of certain aspects of copyright and related rights in the information society:

Member States shall provide authors with the exclusive right to authorise or prohibit any communication to the public of their works, by wire or wireless means, including the making available to the public of their works in such a way that members of the public may access them from a place and at a time individually chosen by them.

The court noted that the directive does not define "communication to the public", but that EU laws do work to protect the rights of copyright owners. It also surmised that those seeking to communicate to the public must make a judgment call as to the ethical nature of what they’re doing: balancing legitimate news against copyright infringement.

Amazon Kindle Fire HD 8 Gets 50 Percent More RAM At A 40 Percent Price; Takes On iPad Mini 4 Head On

Amazon just announced the 2.0 version of last year's Fire HD 8. They claim that the brand new Fire HD 8 tablet comes with improved features. The Kindle Fire HD 8 still looks the same as the one released last year, so what's really new with it?

Amazon's Kindle Fire HD 8 Tablet Gets A New Assistant

NY Times reports, Amazon Echo's cloud-based intelligent digital personal assistant, Alexa, goes mobile as the newest update to come in the Kindle Fire HD 8 will include Alexa. With the Fire HD 8 being the first Amazon tablet to be integrated with Alexa, you can interact with your gadget and ask it to perform certain functions for you such as playing music, read audiobooks, search the web and a lot more.

Other Amazon Kindle Tablets don't have to worry because they are getting Alexa, too. The update will also come to the Amazon Fire, Fire HD 10, and the Fire HD 8 2015.

Bigger Memory And Faster Processor For The 2016 Kindle Fire HD 8

Amazon's Kindle Fire HD 8 Tablet 2016 is equipped with a quad-core MediaTek processor that allows it to perform faster than it used to with the Kindle Fire HD 8 2015. According to CNET, the Kindle Fire HD 8 2016 supports microSD cards up to 200 GB, but also offers more RAM and internal storage of either 16 GB and 32 GB.

New Features For Amazon's Kindle Fire HD 8 2016

The Fire HD 8 2016 runs on Fire OS 5 and now has a front-facing camera plus a primary camera with 2 megapixels. Sources suggest that Amazon's latest tablet has an 8-inch display, stereo speakers with Dolby Audio and a 4,750 mAh battery that can last up to 12 hours.  The Fire HD 8 2016 will come in four colors: black, tangerine, blue and magenta.

Is Kindle Fire HD 8 2016 Tablet Better Than The iPad Mini 4?

There have been rumors that Amazon's Kindle Fire HD 8 2016 is two times more durable than the iPad Mini 4 after enduring several tumble tests. It is a lot more affordable which ideal for practical reasons, but the Fire HD 8 is no match to Apple's iPad Mini 4 in terms of the device's premium build quality.


The Euro: And its Threat to the Future of Europe

From Nobel Prize-winning economist and best-selling author Joseph Sitglitz, author of Globalization and Its Discontents, this is the essential, must-read guide to the future of Europe.

Solidarity and prosperity fostered by economic integration: this principle has underpinned the European project from the start, and the establishment of a common currency was supposed to be its most audacious and tangible achievement. Since 2008, however, the European Union has ricocheted between stagnation and crisis. The inability of the eurozone to match the recovery in the USA and UK has exposed its governing structures, institutions and policies as dysfunctional and called into question the viability of a common currency shared by such different economies as Germany and Greece.

Designed to bring the European Union closer together, the euro has actually done the opposite: after nearly a decade without growth, unity has been replaced with dissent and enlargements with prospective exits. Joseph Stiglitz argues that Europe's stagnation and bleak outlook are a direct result of the fundamental flaws inherent in the euro project - economic integration outpacing political integration with a structure that promotes divergence rather than convergence. Money relentlessly leaves the weaker member states and goes to the strong, with debt accumulating in a few ill-favoured countries. The question then is: Can the euro be saved?

Laying bare the European Central Bank's misguided inflation-only mandate and explaining why austerity has condemned Europe to unending stagnation, Stiglitz outlines the fundamental reforms necessary to the structure of the eurozone and the policies imposed on the member countries suffering the most. But the same lack of sufficient political solidarity that led to the creation of a flawed euro twenty years ago suggests that these reforms are unlikely to be adopted. Hoping to avoid the huge costs associated with current policies, Stiglitz proposes two other alternatives: a well-managed end to the common currency; or a bold, new system dubbed 'the flexible euro.' This important book, by one of the world's leading economists, addresses the euro-crisis on a bigger intellectual scale than any predecessor.

Mobile apps are now bigger than the web — a trend that threatens to eat Google's core business

Apps are eating the web.

Over the past decade, there has been an inexorable movement from the open internet to the walled gardens of apps — and this trend just hit a major milestone.

According to new data from ComScore, more than half of all time Americans spend online is spent in apps — up from around 41% two years ago.

It's a stat that will be discomfiting to advocates of the open web, as well as companies whose core business is built around it — notably Google.

As content that was once freely available and indexable on websites becomes silo-ed away in closed-off apps, it makes it harder to search and link to content. This is, of course, the cornerstone of Google's original business. Google is fighting back, by making the internal contents of apps searchable. But it is not clear that Google will come to dominate app search the same way it did web search.

Below is the data from ComScore, showing how mobile dominates when it comes to platforms people use to get online — and on mobile, apps are the most popular way of accessing information.

adamblog2_reference

And here's how the amount of time spent in apps has rocketed over the last few years.

adamblog1_reference

Amazon regala Kindle e promuove la lettura nei Paesi in via di sviluppo

Amazon regala Kindle, gli e-reader più in voga tra coloro che amano leggere in digitale. Solo pochi giorni fa, il 24 agosto, la nota azienda statunitense ha annunciato il suo nuovissimo progetto chiamato Kindle Reading Fund. Nasce con lo scopo di promuovere la lettura e, contemporaneamente, rendere quella digitale più accessibile a livello mondiale. L’intenzione è quella di donare un gran numero di Kindle, tablet Fire e milioni di e-book ai paesi in via di sviluppo in collaborazione con varie organizzazioni, tra cui Worldwidereader, con la quale ha già collaborato in passato.

Recentemente, quest’ultima ha infatti lavorato con Amazon al progetto LEAP 2.0, grazie al quale ben 61 biblioteche del Kenya e circa 500.000 dei suoi abitanti hanno potuto beneficiare degli e-book. La Worldwidereader, inoltre, può vantare di aver fatto in modo che, negli scorsi 6 anni, una gran quantità di libri abbia raggiunto oltre 4 milioni di persone. Si tratta di numeri impressionanti, considerato che in alcuni paesi la cultura non viene purtroppo promossa e i giovani di oggi si interessano sempre meno alla lettura. Basti pensare alle decine di librerie che chiudono ogni anno.

Amazon promuove la lettura e, proprio come per la Worldwidereader, non è la prima volta e non sarà l’ultima. L’azienda ha infatti donato, e continua a donare, migliaia di e-book di ogni genere a studenti e insegnanti. In collaborazione con la National PTA, inoltre, sta lavorando ad un progetto che vede il coinvolgimento dei genitori in un programma di lettura chiamato Family Reading Experience. Il supporto della famiglia è molto importante nella formazione dei bambini, quindi la speranza è che anche quest’iniziativa riscuota un grande successo. I più piccoli sono il futuro e, fortunatamente, Amazon lo sa bene e porta un aiuto non indifferente.

Se ciò non fosse abbastanza, è sufficiente citare alcuni degli altri enti a cui Amazon regala i Kindle. Ci sono il Seattle Children’s Hospital, Mary’s Place, Rainier Scholars e tantissimi altri ospedali, case famiglia e associazioni no-profit. Amazon promuove la lettura e, secondo un suo portavoce, il sogno dell’azienda è fare in modo che i libri e i benefici che portano arrivino a più persone possibili, comprese quelle dei paesi in via di sviluppo. Per informazioni più dettagliate, si può consultare il sito ufficiale.

Advertsing

125X125_06

Planet Xamarin

Planet Xamarin

Calendar

<<  July 2017  >>
MonTueWedThuFriSatSun
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

View posts in large calendar

Month List