Skip to content

Instantly share code, notes, and snippets.

View ariona's full-sized avatar
🏠
Working from home

Rian Ariona ariona

🏠
Working from home
View GitHub Profile
@ariona
ariona / script.js
Created November 16, 2015 04:41
CSS show/hide animation
// User HoverIntent
$(".dropdown-menu .menu-item-has-children").hoverIntent(
function(){
var isMega = $(this).hasClass("mega-menu");
var sub = $(this).find("> .sub-menu");
if( isMega ){
$(sub).css("display","table");
} else {
$(sub).show();
@ariona
ariona / pxtoem-function.scss
Created November 20, 2015 07:53
Pixel to Em function for SASS
$browser-context: 16;
@function em($pixels, $context: $browser-context) {
@if (unitless($pixels)) {
$pixels: $pixels * 1px;
}
@if (unitless($context)) {
$context: $context * 1px;
}
@ariona
ariona / proportional-scale.js
Created November 25, 2015 07:52
Proportionally Scale Any HTML Content
var $el = $("#very-specific-design");
var elHeight = $el.outerHeight();
var elWidth = $el.outerWidth();
var $wrapper = $("#scaleable-wrapper");
$wrapper.resizable({
resize: doResize
});
@ariona
ariona / input-placeholder.css
Last active December 4, 2015 08:52
Styling the input placeholder
/*
* If you want to style specific Input, prepend the input selector like:
*
* .control::-webkit-input-placeholder{ ... }
*
*/
::-webkit-input-placeholder {
color: red;
}
@ariona
ariona / background-video.css
Created December 4, 2015 08:47
Minimal CSS to create background video
/*
* This method can be applied to video tag and
* can be applied to iframe video like youtube, but with some issue to be considered
*/
video{
/* Centering the video */
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
@ariona
ariona / _dynamic-navbar-height.md
Last active December 7, 2015 10:54
Dynamic Menubar Height with Flexbox

#Dynamic Menubar Height with flexbox

@ariona
ariona / _Add custom option for widgets.md
Last active April 23, 2024 07:17
Add Custom Options for Widgets

##Add Custom Options for WordPress Widgets This snippet will add some option to all registered widget in wordpress.

@ariona
ariona / _ie10.md
Last active January 25, 2016 02:48

WordPress Admin Ajax Request Handle Function

This gist show you how to create a function for handling ajax request.

@ariona
ariona / _click_outside.md
Created April 8, 2016 09:44
Simulate Click Outside Element

Simple plugin for detecting click outside element