Javascript utility for blending colors.
The post ColorBlendjs : JavaScript Blending Colors appeared first on jQuery Rain.
by Admin via jQuery Rain
"Mr Branding" is a blog based on RSS for everything related to website branding and website design, it collects its posts from many sites in order to facilitate the updating to the latest technology.
To suggest any source, please contact me: Taha.baba@consultant.com
Javascript utility for blending colors.
The post ColorBlendjs : JavaScript Blending Colors appeared first on jQuery Rain.
jqModal is a plugin for jQuery to help you display modals, popups, and notices. It is flexible and tiny, akin to a “Swiss Army Knife”, and provides a great base for your windowing needs.
The post jqModal : jQuery Modal Window Plugin appeared first on jQuery Rain.
A jQuery plugin to embed interactive images on your website.
Features:
The post jQuery Interactive Image Plugin appeared first on jQuery Rain.
We've just launched something new, and we're celebrating with a huge discount on SitePoint Premium memberships.
Introducing Collections: we've made it even easier to watch playlists of screencasts on your favorite topics (and by your favorite teachers) in grouped bundles so you can learn more intuitively - the next instalment is right there in the relevant Collection, exactly where you need it. New videos are added daily.
Watch one lesson or binge away, the choice is yours, free for all SitePoint Premium Members.
To celebrate the launch, we're doing something we never, ever do and offering SitePoint Premium Membership at a massive discount for one week only:
Monthly - $7 (normally $15)
Annual - $48 (normally $108)
And, for the first time ever, you can now have a SitePoint Premium Lifetime Membership! A one time cost of $199 for ongoing access to the best resources to develop your skills - forever. That’s unlimited access to all SitePoint books, courses, collections and screencasts.
We're reverting to our usual pricing at the end of the week, so now's the time to join!
Continue reading %Introducing SitePoint Premium Collections (and Our Best Price Ever)%
Have you ever finished a project in a single run without ever needing to look at the code again? Neither have I. When working on an older project, you probably want to spend little to no time figuring out how code works. Readable code is imperative to keep a product maintainable and to keep yourself, and your colleagues or collaborators happy.
Exaggerated examples of unreadable code can be found on JS1k contests, where the goal is to write the best JavaScript applications with 1024 characters or less, and JSFuck, an esoteric programming style which uses only six different characters to write JavaScript code. Looking at code on either of these sites will make you wonder what is going on. Imagine writing such code and trying to fix a bug months later.
If you surf the internet regularly, or build interfaces, you may know that it’s easier to quit a large, bulky form than one that seems simple and small. The same can be said about code. When perceived as easier to read and to work on, one may enjoy working on it more. At least it will save you tossing out your computer in frustration.
In this article, I’m going to look at tips and tricks to make your code more readable, as well as pitfalls to avoid.
[author_more]
Sticking with the form analogy, forms are sometimes split in parts, making them appear less of a hurdle. The same can be done with code. By splitting it up into parts, readers can skip to what is relevant for them instead of ploughing through a jungle.
For years, we have been optimising things for the web. JavaScript files are no exception of that. Think of minification and pre-HTTP/2, we saved HTTP requests by combining scripts into a single one. Today, we can work as we want and have a task runner like Gulp or Grunt process our files. It’s safe to say we get to program the way we like, and leave optimization (such as concatenation) to tools.
// Load user data from API
var getUsersRequest = new XMLHttpRequest();
getUsersRequest.open('GET', '/api/users', true);
getUsersRequest.addEventListener('load', function() {
// Do something with users
});
getUsersRequest.send();
//---------------------------------------------------
// Different functionality starts here. Perhaps
// this is an opportunity to split into files.
//---------------------------------------------------
// Load post data from API
var getPostsRequest = new XMLHttpRequest();
getPostsRequest.open('GET', '/api/posts', true);
getPostsRequest.addEventListener('load', function() {
// Do something with posts
});
getPostsRequest.send();
Functions allow us to create blocks of code we can reuse. Normally, a function’s content is indented, making it easy to see where a function starts and ends. A good habit is to keep functions tiny—10 lines or less. When a function is named correctly, it’s also easy to understand what is happening when it’s being called. We’ll get to naming conventions later.
// Load user data from API
function getUsers(callback) {
var getUsersRequest = new XMLHttpRequest();
getUsersRequest.open('GET', '/api/users', true);
getUsersRequest.addEventListener('load', function() {
callback(JSON.parse(getUsersRequest.responseText));
});
getUsersRequest.send();
}
// Load post data from API
function getPosts(callback) {
var getPostsRequest = new XMLHttpRequest();
getPostsRequest.open('GET', '/api/posts', true);
getPostsRequest.addEventListener('load', function() {
callback(JSON.parse(getPostsRequest.responseText));
});
getPostsRequest.send();
}
// Because of proper naming, it’s easy to understand this code
// without reading the actual functions
getUsers(function(users) {
// Do something with users
});
getPosts(function(posts) {
// Do something with posts
});
We can simplify the above code. Note how both functions are almost identical? We can apply the Don’t Repeat Yourself (DRY) principle. This prevents clutter.
function fetchJson(url, callback) {
var request = new XMLHttpRequest();
request.open('GET', url, true);
request.addEventListener('load', function() {
callback(JSON.parse(request.responseText));
});
request.send();
}
// The below code is still easy to understand
// without reading the above function
fetchJson('/api/users', function(users) {
// Do something with users
});
fetchJson('/api/posts', function(posts) {
// Do something with posts
});
What if we want to create a new user through a POST request? At this point, one option is to add optional arguments to the function, introducing new logic to the function, making it too complex for one function. Another option is to create a new function specifically for POST requests, which would result in duplicate code.
We can get the best of both with object-oriented programming, allowing us to create a configurable single-use object, while keeping it maintainable.
Note: if you need a primer specifically on object-oriented JavaScript, I recommend this video: The Definitive Guide to Object-Oriented JavaScript
Consider objects, often called classes, a cluster of functions that are context-aware. An object fits beautifully in a dedicated file. In our case, we can build a basic wrapper for XMLHttpRequest.
HttpRequest.js
function HttpRequest(url) {
this.request = new XMLHttpRequest();
this.body = undefined;
this.method = HttpRequest.METHOD_GET;
this.url = url;
this.responseParser = undefined;
}
HttpRequest.METHOD_GET = 'GET';
HttpRequest.METHOD_POST = 'POST';
HttpRequest.prototype.setMethod = function(method) {
this.method = method;
return this;
};
HttpRequest.prototype.setBody = function(body) {
if (typeof body === 'object') {
body = JSON.stringify(body);
}
this.body = body;
return this;
};
HttpRequest.prototype.setResponseParser = function(responseConverter) {
if (typeof responseParser !== 'function') return;
this.responseParser = responseParser;
return this;
};
HttpRequest.prototype.send = function(callback) {
this.request.addEventListener('load', function() {
if (this.responseParser) {
callback(this.responseParser(this.request.responseText));
} else {
callback(this.request.responseText);
}
}, false);
this.request.open(this.method, this.url, true);
this.request.send(this.body);
return this;
};
app.js
new HttpRequest('/users')
.setResponseParser(JSON.parse)
.send(function(users) {
// Do something with users
});
new HttpRequest('/posts')
.setResponseParser(JSON.parse)
.send(function(posts) {
// Do something with posts
});
// Create a new user
new HttpRequest('/user')
.setMethod(HttpRequest.METHOD_POST)
.setBody({
name: 'Tim',
email: 'info@example.com'
})
.setResponseParser(JSON.parse)
.send(function(user) {
// Do something with new user
});
Continue reading %The Importance of Writing Code That Humans Can Read%
Make time for this one. A very entertaining post by Tyler Sticka that gives us lots of great reasons to stop using icon fonts and get on the SVG train. (cloudfour.com)
Matt Mullenweg writes about WordPress’s new publishing and site management experience which has had a lot of hype this week. (ma.tt)
An excerpt from Ethan Marcotte’s new book, Responsive Design: Patterns & Principles. If you haven’t ordered the book already, I’m sure you won’t hesitate after reading this. As always, wise words by Mr RWD. (alistapart.com)
A good reminder that keeping the number of options within an interface allows people to make decisions easier and complete tasks faster. (nngroup.com)
While good color palettes are easy to come by these days, finding the right color palette for data visualizations is still quite challenging. Thankfully Samantha Zhang shares some trade secrets to potentially make our job easier. (medium.com)
Next time you need to do a code review, taking 5 minutes to read this great article by Jezen Thomas could go a long way. (jezenthomas.com)
The team at Sauce have taken the time to build a live style guide so developers, designers and product managers can be consistent across all products. It’s built with AngularJS as Kuba Siemiฤ tkowski explains. (saucelabs.com)
If performance is your thing, both this article by Tobias Ahlin and Harry Robert’s quick screencast about speeding up Tobias’s site are full of handy tips. (tobiasahlin.com)
A small JavaScript library to help web applications with accessibility. (allyjs.io)
As a developer, you will build complex web sites and applications and must be able to collaborate with multi-disciplinary teams consisting of strategists, designers and programmers. (hellodesign.com)
As a member of our Front End team you’ll be given the freedom to make meaningful and measurable improvements impacting millions of people. You’ll join us at our beautiful Amsterdam HQ and work with some of our industry’s smartest people. (booking.com)
This article Ben Sandofsky is focused more towards shipping iOS apps but has some really interesting thoughts around hitting deadlines. (sandofsky.com)
The post Web Design Weekly #214 appeared first on Web Design Weekly.
2015 has been a big year for the Internet of Things. We have seen huge advancements in the size and capability of devices, big players like Microsoft and Samsung are really moving into the space and the IoT community overall is starting to grow ever larger! Over the past two years here at SitePoint, it has become a bit of a tradition for me to look at the year that was for the Internet of Things and JavaScript (see JavaScript Beyond the Web and JavaScript Beyond the Web in 2014). Whilst the initial hype and excitement of having JavaScript as a language of the Internet of Things (IoT) seemed to calm down a bit over 2015, JavaScript still continues to pop up as a rather strong option for enabling magic within more IoT platforms than people realise.
In this overview, we'll look at some of the big movements in the Internet of Things that will enable new possibilities for JavaScript developers and further JavaScript's potential beyond the web.
[caption id="attachment_120043" align="aligncenter" width="1024"] The Tessel 2 (Photo credit: Tessel)[/caption]
The Tessel is a microcontroller (similar to an Arduino) that ran on JavaScript rather than the typical languages such as C. It was the perfect device to help JavaScript lovers leap into the Internet of Things. Last year it shipped to the world and people made some pretty neat things with it. The Tessel 2 released pre-orders this year and has some very exciting upgrades from the first generation Tessel.
The Tessel was able to run various npm packages, but wasn't able to run Node.js itself, so Tessel often had to build in compatibility specifically for commonly used packages. The Tessel 2 greatly improves on this by running the real Node.js out of the box. This fact alone made me pre-order it instantly. Access to npm modules brings a lot of potential to this microcontroller.
It also has two USB ports, providing access to USB devices (e.g. webcams) as well as ready made Tessel modules and the GPIO port (to directly connect all sorts of electronics via jumper wires to pins).
[caption id="attachment_120075" align="aligncenter" width="974"] OpenHybrid in action (Photo credit: OpenHybrid)[/caption]
Augmented reality is a fascinating alternative method of controlling the Internet of Things around us. Rather than putting physical controls on objects, you can view them through an augmented reality interface like a smartphone app and control them in intuitive and limitless ways! Various companies are looking into ways of implementing this but in 2015, MIT Media Labs revealed (and open-sourced) a pretty impressive method called Open Hybrid. JavaScript IoT developers in particular might be very interested by this solution as it allows for application development via web technologies including HTML and JavaScript. Whilst it is still early days for augmented reality, now is the time to start tinkering with its potential alongside the IoT!
[caption id="attachment_120046" align="aligncenter" width="1000"] The Samsung IoT.js and JerryScript pages[/caption]
Samsung has put plenty of resources towards enabling JavaScript to be the language for the Internet of Things. In 2015, they open sourced JerryScript, a JavaScript engine for the Internet of Things. It allows JavaScript to run on small, resource constrained devices like the microcontrollers commonly used in the IoT. To me, it sounds similar to what Tessel were attempting to put together in the first iteration of the Tessel but on a grander scale which is open to many more small IoT devices.
IoT.js is another endeavour of Samsung to enable JavaScript within the Internet of Things ecosystem. It was open sourced around the same time as JerryScript. IoT.js is a framework for creating an inter-operable platform for devices using JavaScript. It has been described as a lightweight version of Node.js, however I've yet to play around with it myself to get a true feel for how accurate that description is.
Both JerryScript and IoT.js are still in their early stages, so it will be exciting to see how they progress throughout 2016. I'm eagerly hoping for integration with the Samsung SmartThings platform at some point but I haven't heard of any mention of this yet!
Continue reading %JavaScript Beyond the Web in 2015%
The Android Wear API brings the Android platform to the newest generation of wearable devices and smartwatches. With Android Wear, you can create a user experience designed specifically for wearables.
But how do you debug your applications? While it is possible to debug most Wear features using the Android emulators, sometimes it is helpful to see the application on a real device.
In this short video tutorial from my recent Android Wear course, I’ll show you how to debug your applications on a physical Wear device.
In the full course, Develop Apps for Android Wear, I'll teach you about the various UI components specifically designed for Android Wear. You will also learn how to extend your application to use the new Wear notification types.
I'll use practical examples to demonstrate how each of these new components can improve your wearable device applications, and I'll also show you how to create a basic digital watch face to help customize your users' experiences.
For more help with your Android development projects, check out the Android app templates on Envato Market.
PDF files are one of the most common ways of sharing documents online. Whether we need to pass our clients’ documents to third-party service providers like banks or insurance companies, or just to send a CV to an employer, using a PDF document is frequently the first option.
PDF files can transfer plain/formatted text, images, hyperlinks, and even fillable forms. In this tutorial, we’re going to see how we can fill out PDF forms using PHP and a great PDF manipulation tool called PDFtk Server.
To keep things simple enough, we’ll refer to PDFtk Server
as PDFtk
throughout the rest of the article.
We’ll use Homestead Improved for our development environment, as usual.
Once the VM is booted up, and we’ve managed to ssh into the system with vagrant ssh
, we can start installing PDFtk
using apt-get
:
sudo apt-get install pdftk
To check if it works, we can run the following command:
pdftk --version
The output should be similar to:
Copyright (c) 2003-13 Steward and Lee, LLC - Please Visit:www.pdftk.com. This is free software; see the source code for copying conditions. There is NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
PDFtk provides a wide variety of features for manipulating PDF documents, from merging and splitting pages to filling out PDF forms, or even applying watermarks. This article focuses on using PDFtk to fill out a standard PDF form using PHP.
PDFtk uses FDF files for manipulating PDF forms, but what is an FDF file?
FDF or Form Data File is a plain-text file, which can store form data in a much simpler structure than PDF files.
Simply put, we need to generate an FDF file from user submitted data, and merge it with the original PDF file using PDFtk’s commands.
The structure of an FDF file is composed of three parts: the header, the content and the footer:
Continue reading %Filling out PDF Forms with PDFtk and PHP%
Plug your phone into the USB port on your laptop and you’ll have hands-free, eye-level access to it while it charges, thanks to the Bobine’s 24-inch, ultra-strong and flexible cable. And it’s that strong cable that makes it a great tripod for taking photos. Crafted from military-grade, nickel-plated steel, the Bobine is virtually indestructible, no […]
Continue reading %Grab This Three-in-One Charging Solution for $25%
Corpo site aims to provide information about drinking water supply for citizens in the Slovenian coastal area and to build awareness about clean drinking water preservation.
Able is the world’s first collaborative lender. We fund small business loans up to $500,000 at low rates with the support of your network and ours.
ODNOWA is an object Fitness & SPA in Poland in the Krakรณw-Czฤstochowa Upland. It’s located in Stara Wieล Relax Centre, where for the guests, those from near and far, are waiting health-related attractions.
With no prior agency experience, I wanted to create a motivating and character reflecting pitch to agencies, which also showed my skills.
As you probably know by now, Material Design (codenamed Quantum Paper) is a design language developed by Google.
In May this year, we published an article titled Top 5 Material Design Frameworks to Use in 2015. Since then many new material design frameworks have emerged and quite a few existing frameworks were brought to our attention.
So, here's our retake on five other worthy Material Design frameworks that you should definitely consider using in your next project.
Material Design for Bootstrap (MDB) is a powerful Material Design UI KIT for most popular HTML, CSS, and JS framework - Bootstrap. It is one of the most comprehensive material design frameworks that we have seen till date.
[caption id="attachment_119879" align="aligncenter" width="800"] Material Design for Bootstrap[/caption]
The framework includes CSS for handling Animations, Colors, Typography, Helpers, Hover effects, Shadows, Icons, Components, and JavaScript. Additionally, it offers Badges, Buttons, Social buttons, Cards, Footer, Forms, Material box, Nabbers, Pagination, Panels, Parallax, Progress bar, Tables, Galleries and JavaScript.
That's clearly an impressive list and the framework makes for one of the most feature complete offerings, best -suited for use on enterprise-level web development projects.
Daemonite's Material UI is a fully responsive, cross-platform, front-end interface based on Google Material Design. This lightweight framework is built in HTML5, again using Bootstrap, JS and CSS.
The Daemonite's framework was released on 23rd of June as open-source project hosted at GitHub and currently has about 1,000 stars attesting to its popularity.
[caption id="attachment_119880" align="aligncenter" width="800"] Daemonite's Material UI [/caption]
This framework provides a good collection of components (Cards, Collapsible Regions, Dropdowns, Modal & Toasts, Navs, Progress Bars, Tabs and Tiles) and elements (Button, Form Elements (basic), Form Elements (materialised), Icons and Tables).
This is an excellent new framework that will give you smooth animations and transitions. The component that set the framework apart from others for us was the excellent Material Datepicker. Give it a try here.
This Bootstrap theme is one of the easiest easy ways to incorporate the new Material Design guidelines into your Bootstrap 3 based application. This project is open source with its repository hosted at GitHub and has about 13,200 stars of approval.
[caption id="attachment_119876" align="aligncenter" width="800"] Material Design by FEZVRASTA[/caption]
However, be aware that the repository of this theme does warn:
This theme is still in development, it could be used on production websites but I can't guarantee compatibility with previous versions.
As a result of that note, I perhaps wouldn't recommend that you commit important projects to this theme at present. However, you should definitely keep an eye on this one in future.
lumX Material Design is the first responsive front-end framework based on AngularJS & Google Material Design specifications. Its GitHub repository has about 1,300 stars and they state that lumX will help you to design your applications faster and easier.
[caption id="attachment_119878" align="aligncenter" width="800"] lumX Material Design[/caption]
It's CSS is lighter than some of the larger frameworks but includes common Mixins, Typography, Colors, Flexbox, Buttons, Floating, action button, Icons, Lists, Data table, Cards, Checkboxes, Radio buttons, Switches and Toolbars. It is also a stable framework and can prove to be a good choice for a web development project.
Continue reading %Top 5 Material Design Frameworks to Use in 2015 – the Sequel!%
A few weeks back, I was just getting into Elixir. I was so interested that I hopped on IRC and started asking questions, much to everyone's annoyance. I asked the creator, Jose Valim, a couple of questions. Jose is well-loved in the Ruby Community, so I dropped him a line and he was kind enough to respond. After answering some of my questions I thought, I have to interview him. Here is the resulting conversation.
Continue reading %An Interview with Jose Valim%
This weeks featured Advertiser is WordPress hosting specialists, WP Engine. They decided to do things differently and asked me to list exactly why I chose them to host the onepagelove.com website.
There are so many but I shortened the list to these:
One Page Love users burn 36.2GB of bandwidth per day! Yup, that’s over 1TB per month and WP Engine don’t charge us anything for bandwidth. Zero, zip, ziltch…
Whenever I update a WordPress plugin I always make a quick on-demand backup first. You won’t believe how easy it is to restore when your 3rd party plugin messes something up. I’m talking 2-clicks in the WP Engine user dashboard and perfectly back to normal:
Also if you have a big WordPress install, WP Engine kindly mail you when it’s ready. One Page Love takes roughly 18 seconds:
It’s probably worth adding here that WP Engine do the courtesy of a daily backup for you. This means if you run into trouble at least you can “roll back” your website within the last 24hrs.
When a new version of WordPress is ready, WP Engine will upgrade your WordPress with good warning beforehand. This helps ensure you don’t get “hacked” with older WordPress code that becomes more vulnerable over time.
This feature is such a lifesaver if you travel. I was offline once for 2 days and they rolled out a quick WordPress update when an serious vulnerability was spotted a security patch release. I’ll add here too that they always backup your site before the auto-upgrades to play it safe, dig that.
Article currently being updated.
Ok, yup, as you can see I’m a WP Engine fan boy:)
At the end of the day when you stop worrying about hosting, you start focusing on everything that really matters.
Hope this was useful.
Cheers,
Rob
WebODF is a JavaScript library that makes it easy to add Open Document Format (ODF) support to your website and to your mobile or desktop application. It uses HTML and CSS to display ODF documents.
The post WebODF : JavaScript Document Engine appeared first on jQuery Rain.
Eagle Gallery this is modern gallery with image zoom functionality. To manage the gallery you can use gestures or control buttons. This is a fully responsive gallery which has support touch screen and was created for mobile devices, laptops and desktops. With this gallery you can easily create a product gallery on your internet shop for detailed view and customize it with help of options
The post Eagle Gallery – jQuery responsive, Touch, Zoom, Gallery appeared first on jQuery Rain.
A MelonJS port of the famous Flappy Bird Game.
The post Clumsy Bird : Flappy Bird Game appeared first on jQuery Rain.
TypeIt is a lightweight, scalable jQuery animated typing plugin that types single or multiple strings for you.
Are you using the Facebook conversion pixel? Wondering how to transition from your old conversion pixel to the new pixel? Facebook’s new “one-pixel solution” makes it easier for marketers to monitor and measure conversions from Facebook users. In this article you’ll discover how to install the new Facebook pixel, track conversions and view the cost […]
This post Facebook Conversion Pixel Changes: What Marketers Need to Know first appeared on Social Media Examiner.
Social Media Examiner - Your Guide to the Social Media Jungle
Is your Twitter marketing working? Do you want more engagement for your tweets? Knowing how to write your tweets and when to publish them can increase visibility, boost engagement and drive traffic to your site. In this article you’ll discover eight tips to deliver better tweets. #1: Tweet Without Links Research shows that tweets without […]
This post 8 Twitter Tips to Improve Your Twitter Marketing first appeared on Social Media Examiner.
Social Media Examiner - Your Guide to the Social Media Jungle
This is a review of the online course Complete UX Fundamentals, by Adam Treister and Pablo Stanley. This is part of our series of reviews of online UX courses.
Read some of our other reviews or browse the full list of online UX courses.
The course begins with an intriguing introduction into UX theory (delivered by Adam Triester), starting with a brief history. Section 3 (Understanding Users) is particularly interesting, dealing with user research processes, tools and methods. The various tools available for conducting user research are introduced, along with guidance around choosing the most appropriate ones for the varying stages of the research process. Adam then discusses some examples of real world user research projects that he has participated in.
Section 4 (Information Architecture) outlines the basics of information architecture, structure and two basic website models. I skimmed over the sections on the principles of visual and layout design, because I am already experienced in those areas. I suspect that other intermediate designers would probably feel the same way.
The last theoretical section is about user psychology, which I found particularly beneficial. Adam guides you through user motivations and emotions, outlining a few behaviour models that will help you during decision processes. During the theoretical part of the course there are plenty of visuals aids to assist with understanding the concepts that are being introduced.
The post Review: User Experience Design: Complete UX Fundamentals Course appeared first on UX Mastery.
Web design and web development for the peruvian restaurant La Barra.
Pixel Fox Studios is a Mumbai-based full service digital agency. We are the agency for the connected world crafting beautiful & useful digital & marketing campaigns.
Mรฒ Arredo Top Modern Contemporary Furniture Selection Online Store with awesome style.
A simple jQuery plugin to get a warning when the maximum char limit has been exceeded.
This is an experiment. The idea is to create a battle game, where the participants code their AI, and then we make them fight! You can play by adding your own AI to the game!
The post ClashJS : Javascript AI battle Game appeared first on jQuery Rain.
Turn a multiselect list into a nice and easy to use list with checkboxes.
The post jQuery MultiSelect Plugin appeared first on jQuery Rain.