Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Rian Ariona ariona

🏠
Working from home
View GitHub Profile
@ariona
ariona / script.js
Created Nov 16, 2015
CSS show/hide animation
View script.js
// 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 Nov 20, 2015
Pixel to Em function for SASS
View pxtoem-function.scss
$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 Nov 25, 2015
Proportionally Scale Any HTML Content
View proportional-scale.js
var $el = $("#very-specific-design");
var elHeight = $el.outerHeight();
var elWidth = $el.outerWidth();
var $wrapper = $("#scaleable-wrapper");
$wrapper.resizable({
resize: doResize
});
@ariona
ariona / background-video.css
Created Dec 4, 2015
Minimal CSS to create background video
View background-video.css
/*
* 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 / input-placeholder.css
Last active Dec 4, 2015
Styling the input placeholder
View input-placeholder.css
/*
* If you want to style specific Input, prepend the input selector like:
*
* .control::-webkit-input-placeholder{ ... }
*
*/
::-webkit-input-placeholder {
color: red;
}
@ariona
ariona / _dynamic-navbar-height.md
Last active Dec 7, 2015
Dynamic Menubar Height with Flexbox
View _dynamic-navbar-height.md

#Dynamic Menubar Height with flexbox

@ariona
ariona / _Add custom option for widgets.md
Last active Jan 25, 2016
Add Custom Options for Widgets
View _Add custom option for widgets.md

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

@ariona
ariona / _click_outside.md
Created Apr 8, 2016
Simulate Click Outside Element
View _click_outside.md

Simple plugin for detecting click outside element

@ariona
ariona / _group-search-result.md
Created Apr 15, 2016
Grouping wordpress search result by post types
View _group-search-result.md

##Grouping wordpress search result by post types