Two.js is a two-dimensional drawing api geared towards modern web browsers. It is renderer agnostic enabling the same api to draw in multiple contexts: svg, canvas, and webgl.
by via jQuery-Plugins.net RSS Feed
"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
Two.js is a two-dimensional drawing api geared towards modern web browsers. It is renderer agnostic enabling the same api to draw in multiple contexts: svg, canvas, and webgl.
Local notifications let an application inform its users that it has something for them. For example, a reminder or an new item for sale while the application isn’t running in the foreground. Local notifications are considered the best way by which an app can communicate with its user, even if the user is not actively using the app.
In this tutorial I will show you how to trigger local notifications in a cordova based app. I will explain how local notification work, how they differ from push notifications and the APIs provided by the Cordova Local-Notification Plugin to trigger local notifications. I will create a basic Reminder app to show how to use the Cordova Local-Notification plugin in a real world project.
Continue reading %Integrating Local Notifications in Cordova Apps%
Welcome to the third part of the "Toolbox of the Smart WordPress Developer" series. In this part, we're going to go through GenerateWP, a website dedicated to building WordPress code.
Yes.
Before you let your blood boil with anger, ask yourself this question: Have you ever made a mistake while you were learning coding in WordPress?
I know I have. 'Twas a cold night in Kocaeli, Turkey (my hometown, right next to İstanbul) when I saw my first White Screen of Death (WSOD). The year was 2006 and I was editing a free WordPress theme for my blog, Beyn. I was also new to PHP, MySQL, HTML and CSS, so you can imagine the horror when I saw that I couldn't open any page—including the admin panel, if I'm not mistaken. After minutes of terror and a few drops of cold sweat on my forehead, I finally thought of deleting the theme from FTP and starting anew with the unedited theme files. I managed to locate the problem in my index.php file—you guessed it: a missing semicolon.
Let me answer the question one more time: Yes, writing WordPress code is hard for WordPress beginners. Actually, all WordPress developers might benefit from GenerateWP, no matter how well they know WordPress.
I'll tell you why.
If GenerateWP had existed back in 2006, I would have learned WordPress way faster.
GenerateWP defines itself as "The easiest and the fastest way to create custom and high quality code for your WordPress project using the latest WordPress coding standards and API's", according to the GenerateWP.com homepage. It's a really fun way to build WordPress code without any hassle.
But it's more than that. By its nature, GenerateWP also teaches people how to code in WordPress. When you select a tool and build your code, you see what your settings actually affect in the code, and that gives you an idea of how the code works. And this isn't only for WordPress beginners—even WordPress veterans can benefit from it. After all, being good at WordPress coding does not mean memorizing every single bit of code in the core of WordPress.
I like to think that GenerateWP serves the purpose of being a hands-on training exercise for WordPress beginners. Why? Simply because it shows users how the code is built. Experimenting with the tools for a couple of times, one can learn how the code is generated, what the arguments are, how the arguments work, and how the code changes if the tool is used with different values. A smart WordPress beginner would have fun and experiment with the tools, then try to type the code by himself or herself for the first time. The rest would turn the beginner into a veteran, or in cool terms, a WordPress ninja!
But, of course, some people like to take the easy way out and use the tool every day. It's still not bad when those people release their code for the community (because the code will be well-written, thanks to GenerateWP), but they will never understand that after a certain point, using the tool is slower than coding by hand.
As I'm writing this article, GenerateWP has 20 easy-to-use tools, and a section where you can store your custom code snippets (which we'll get to in a little while). Let's see what the tools are:
WP_Query Generator, you can create WordPress queries.WP_User_Query Generator, you can create WordPress user queries.WP_Comment_Query Generator, you can create WordPress comment queries.wp-config.php File Generator, you can create a custom wp-config.php file.readme.txt file.All of these tools are really fun to play with, and as I said earlier, even WordPress veterans might—nay, will—benefit from these tools.
But even if you've memorized all the codes in the WordPress core and don't need any of those tools, you might enjoy the latest and newest section of GenerateWP: sharing snippets.
When GenerateWP.com turned two at the beginning of 2015, its creator Rami Yushuvaev posted a celebration on GenerateWP's blog, and introduced a new tool called "custom snippets". With this tool, you can save your WordPress code snippets and share them with the world. You just have to register first. *sigh*
Under each GenerateWP tool, you see two buttons: "Update Code" and "Save Snippet". By clicking that second button, you can easily save the code you just built with GenerateWP. Better yet, you can also write code from scratch (instead of working with the tools) from the Custom WordPress Snippets homepage. Neat.
GenerateWP is a WordPress tool that, for me, closes an important gap in hands-on WordPress training experience. With its tools, I'm sure that many WordPress beginners will speed up their learning processes for important APIs and functions of WordPress.
What's your take on GenerateWP? Tell us what you think by posting in the Comments section below. And if you liked the article, don't forget to share it with your friends!
See you in the next part where we'll be covering WP Quick Install, a tool to quickly install WordPress with lots of customization.
Everyone wants to be unique. I guess you won’t be super happy if in your surroundings there are many people looking just like you, right? This holds true for the other people too. Your friends also won’t be happy to see clones of you everywhere. The same is true for our websites.
Nowadays, building a website with a front-end framework is common. The problem though is that many people blame such frameworks for making all websites “look the same”. But the tool isn’t to blame if developers aren’t willing to make the necessary customizations.
For those of you who want the websites you build to stand out from the crowd, I’ll demonstrate how you can use UIkit’s Customizer to create different themes and theme variations (styles). The process is straightforward, but you need a proper workflow to do it with a minimum amount of headache.
Let’s say that you want to create a dark theme for your website with orange as an accent color. Also, you want two more variations of that theme with blue and green accent colors. Let’s see how we can do it. (Note: For the sake of brevity, I’ll use only buttons to demonstrate the process).
We’ll need to start with ensuring the following steps are complete:
npm install from the terminal.When all of this is set up correctly, we can start creating our theme.
Still in the root directory, create a folder called “custom”. In that folder, create another one called “dark” and inside it create a file called uikit.less. Open the file and add the following:
[code language="sass"]
@import "../../src/less/uikit.less";
@import "button.less";
[/code]
The first line will get all Less files from the core framework and the second line will import the file you’re going to use to modify the default UIkit buttons. Save and close the file and create the aforementioned button.less file in the same directory.
Before making any further customizations, you need to make your theme available locally in the Customizer. To do so, in the UIkit root directory, run the following in the terminal:
[code language="bash"]
gulp indexthemes
[/code]
Now launch your local copy of the UIkit website (the one you installed) and click “Customizer” in the navigation bar. When you open the “Select a theme” drop-down list you should see “Dark” at the end of it. At this point, when you select it, you’ll see that there is no styling. Why not? Let’s see.
One thing not mentioned in UIkit’s documentation and which can cost you a lot of headache, is that your theme needs a file called uikit-customizer.less. Create the file and add the following line:
[code language="sass"]
@import "uikit.less"
[/code]
You must put that file, with the above line, in the theme’s root directory (inside the “dark” folder, in our case). If this file is not present, you can’t use the Customizer properly – the theme’s name will appear in the list, but the styles will be missing.
Note: As a rule of thumb, the uikit-customizer.less file should import all files that your theme uses. In our example, importing uikit.less meets this requirement because it includes both the default UIkit styles and your custom button styles.
After adding the uikit-customizer.less file, you will see that this time all components are properly styled. So, we’re ready to move on.
In the component’s drop-down list, placed at the top left corner of the panel on the right side of the Customizer, switch to “Button”. This way you’ll be able to see all available button styles. Now we can open the button.less file and start adding our modifications:
[code language="sass"]
@button-color: #f90;
@button-hover-color: fade(@button-color, 75%);
@button-active-color: @button-color;
@button-background: #000;
@button-hover-background: lighten(@button-background, 20%);
@button-active-background: @button-hover-background;
[/code]
In the above code we’ve modified the variables for the default button’s text and background colors in their normal, hovered, and active states. For other specific buttons, we need to change those variables too:
[code language="sass"]
@button-primary-color: darken(@button-primary-background, 20%);
@button-success-color: darken(@button-success-background, 20%);
@button-danger-color: darken(@button-danger-background, 20%);
@button-primary-hover-color: fade(@button-primary-color, 75%);
@button-success-hover-color: fade(@button-success-color, 75%);
@button-danger-hover-color: fade(@button-danger-color, 75%);
@button-primary-active-color: lighten(@button-primary-color, 35%);
@button-success-active-color: lighten(@button-success-color, 35%);
@button-danger-active-color: lighten(@button-danger-color, 35%);
[/code]
Modifying UIkit’s variables is the easiest way to change the appearance of the framework’s components when dealing with simple modifications. But for more complex customizations, such as adding new rules and/or changing the existing ones without breaking the core, UIkit provides a special mechanism. It uses hooks to safely append your changes. Let’s see this in action. Put the following code below the variables, inside the button.less file:
[code language="sass"]
.hook-button() {
border-radius: 5px 15px;
box-shadow: 2px 2px;
}
[/code]
Here, the hook for the button component is used to add a border radius and a drop-shadow effect.
For even more specific changes, UIkit provides miscellaneous hooks. Each component has such a hook. This is useful for creating new selectors or modifying the ones that have neither a variable nor a hook available for customization. Let’s demonstrate this by adding the following code:
Continue reading %Creating a Custom UIkit Theme with Gulp and Less%