All posts by “Sani Halid

SceneVR - Virtual Reality Scenes
comment 0

SceneVR – Virtual Reality Scenes

SceneVR is a platform for creating virtual reality scenes using tools web developers are experienced with. It was develop by Ben Nolan aiming to create a virtual world platform similar to Unity and Second Life. One of the features of this platform is the multi-user environment. Every user is represented by a peg-man character. When your character performs an action, all other characters will be able to see the changes on the scene. This ability allows you to write multi-user games using just XML and JavaScript. You can control your character movements by using the keyboard or a gamepad controller. Even more awesome, you can use the Oculus Rift to explore the VR world. Hit the button below to try it live or view the documentation.

View More   View Demo

Basic JavaScript
comment 0

Learn Basic jQuery Code Snippets

For quite some time now, jQuery has been the most dominant general-purpose JavaScript library for building websites. jQuery is so powerful it made learning vanilla JS an optional thing. This idea is appealing for people like website owners or admins that aren’t necessarily web developers. If you happen to be someone from this category who wants to learn a bit of jQuery, check out this easy-to-follow article by Joni Trythall about some of the basic, commonly used jQuery code snippets. The topics she covers are hiding broken images, basic show & hide, cycling through list and toggling CSS class names all in just one demo.
Hit the button below to learn more and view the demo.

View More   View Demo

javascript
comment 0

Create Motion Sensing Website Using Doppler Effect

Believe it or not, now you can use your microphone and speakers (not headphones) as a motion detection sensor that measures the Doppler effect of the sound waves using a JavaScript library called doppler.js by GitHub user Daniel Rapp. While the project is still in its infancy, the basic demo does work on Chrome! In the demo, you can try to scroll up and down the motion sensing website by moving your hand towards and away from the mic/computer. Hit the buttons below to learn more.

View More View Demo

css3
comment 0

When to Use CSS !important Declaration?

The CSS !important declaration is used to give priority to certain styling rules or overwrite unwanted styling in a website. It is also commonly used during debugging such as in Inspect Element. But is it really OK to use !important? This question was philosophized in a blog post by web developer cum philosopher Jens Oliver Meiert. My take on this is to use !important when you know what you are doing as it can cause problems for future styling. So, don’t ever use it until you really need it and consider this as a last resort.

View More

Filed under: CSS

 

Air2048
comment 0

Air2048 – Webcam Gesture-Based Puzzle Game

Air2048 is a webcam gesture-based puzzle game. It was build using gest.js, a webcam gesture recognition library. How to play? First off, you need a webcam obviously. Flick or wave your hand to move the tiles. When two tiles with the same number touch, they will be merged into one! Hit the button below to play the gesture puzzle game.

View More

Filed under: TGIF

 

Masonry - JavaScript Grid Layout Library
comment 0

Masonry – JavaScript Grid Layout Library

Masonry is a JavaScript library for grid layout that aims to optimize space usage by placing elements in optimal position based on available vertical space and arranging them like mason fitting stones, hence the name. It has a bunch of different options for fine tuning the appearance and behavior of your masonry grid. In addition, there are also methods to support manipulating grid elements on the fly. Hit the button below to learn more.

View More

css3
comment 0

Accidentally Overriding CSS Properties

I bet this is a common problem to novice CSS coders, when you accidentally override CSS properties by using shorthand properties. When I just started doing CSS, I stumbled upon this problem that I thought was a “bug” with many different CSS properties like padding, font and especially background. Here is a simple code example to show how this can happen:

	.container {
		padding-top:25px;
		padding-bottom:40px;
		padding:25px;  /* this shorthand CSS property will override all padding properties above and set all padding directions to 25px */
	}

To prevent this from happening, you can use shorthand the CSS property first, followed by any specific CSS properties you want. For example:

	.container {
		padding:25px; 
		padding-bottom:40px;
	}

Hit the button below to see more examples at CSS Tricks.

View More

Filed under: CSS

 

Highlighter-style Link on Hover
comment 0

Highlighter-Style Link on Hover

Recently, Wired has updated their website with a new link styling and hover effect. Inspired by this styling, I’ve created something similar but with a little bit additional styles like using different color combinations for the text and background.

HTML

	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas non ante aliquet, porta elit quis, accumsan ipsum. Ut bibendum rhoncus tellus, vel commodo dui fermentum et. Nunc dapibus dui id euismod pharetra. Maecenas <a href="#" class="highlight red">commodo</a> mi quis nibh pretium, eget blandit erat laoreet. Nam ac viverra enim, eu aliquet diam. Proin bibendum pulvinar <a href="#" class="highlight blue">tincidunt</a>. Nunc mollis quam et <a href="#" class="highlight green">euismod</a> augue congue euismod. Integer hendrerit vitae metus eget tincidunt. Duis ex turpis, sodales nec vulputate a, gravida eget tellus.</p>

	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas non ante aliquet, porta elit quis, accumsan ipsum. Ut bibendum rhoncus tellus, vel commodo dui fermentum et. Nunc dapibus dui id euismod pharetra. Maecenas <a href="#" class="highlight yellow">commodo</a> mi quis nibh pretium, eget blandit erat laoreet. Nam ac viverra enim, eu aliquet diam. Proin bibendum pulvinar <a href="#" class="highlight pink">tincidunt</a>. Nunc mollis quam et <a href="#" class="highlight orange">euismod</a> augue congue euismod. Integer hendrerit vitae metus eget tincidunt. Duis ex turpis, sodales nec vulputate a, gravida eget tellus.</p>

As you can see here, every links have two different classes which are highlight and a “color” name class. The highlight class is for base styling effects like font color, text-decoration, border and transition. The other class is simply for assigning different color values.

CSS

.highlight {
	text-decoration:none;
	border-bottom:2px solid transparent;
	color:#000;
    -webkit-transition: background .15s cubic-bezier(.33,.66,.66,1);
	transition: background .15s cubic-bezier(.33,.66,.66,1);
}
.red {
	border-color:#ff0000;
	box-shadow:inset 0 -3px 0 #ff0000;
}
.red:hover {
	background-color:#ff0000;
	color:#fff;
}
.blue {
	border-color:#0000ff;
	box-shadow:inset 0 -3px 0 #0000ff;
}
.blue:hover {
	background-color:#0000ff;
	color:#fff;
}
.yellow {
	border-color:#ffff00;
	box-shadow:inset 0 -3px 0 #ffff00;
}
.yellow:hover {
	background-color:#ffff00;
}
.green {
	border-color:#008000;
	box-shadow:inset 0 -3px 0 #008000;
}
.green:hover {
	background-color:#008000;
	color:#fff;
}
.pink {
	border-color:#ffc0cb;
	box-shadow:inset 0 -3px 0 #ffc0cb;
}
.pink:hover {
	background-color:#ffc0cb;
}
.orange {
	border-color:#ffa500;
	box-shadow:inset 0 -3px 0 #ffa500;
}
.orange:hover {
	background-color:#ffa500;
}

Every different “color” classes have its own color code, border-color values to overwrite the transparent color from .highlight and box-shadow values with inset to make the shadow goes inwards. Finally, for hover effect, background-color is applied accordingly to the appropriate classes. Hit the button below to view the demo of highlighter-style link on hover effect.

View Demo

Filed under: CSS

 

CSS background property
comment 0

CSS Background Property

Here is a good reading material for beginners to learn about CSS background property. CSS background have eight properties which are:

  • background-image
  • background-position
  • background-size
  • background-repeat
  • background-attachment
  • background-origin
  • background-clip
  • background-color

The property background itself is a shorthand notation which will allow you to write combination from the other CSS background properties into one declaration only. For example:

	.example {
		background: url(beach.jpg) no-repeat blue;
	}

This example combines three different background properties into one declaration for setting the image url, making the image not repeated and setting blue as the fallback color. Hit the button below to learn more about CSS background properties by Chris Coyier and don’t forget to check out the Codepen demo by Timothy Miller.

View More   View Demo

Filed under: CSS

 

Plyr - HTML5 Media Player
comment 0

Plyr – A Simple HTML5 Media Player With Custom Controls

Plyr is a simple accessible HTML5 media player. There are many other media players out there, so what makes Plyr special? Simple, lightweight and customizable. Here are the other features you can find on Plyr:

  • Accessible – full support for captions and screen readers.
  • Lightweight – just 4.8KB minified and gzipped.
  • Customizable – make the player look how you want with the markup you want.
  • Semantic – uses HTML5 form inputs for volume (range) and progress element for playback progress.
  • Responsive – any screen size.
  • No dependencies – written in vanilla JavaScript.
  • API – easy to use API.
  • Fallback – if there’s no support, the native players are used.
  • Fullscreen – options to run the player full browser or the user can toggle fullscreen.

Hit the button below to learn more and view the demos.

View More   View Demo