Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ !function(e){e.fn.embedBehance=function(t){var i,n=e.extend({project:!0,owners:!0,appreciations:!0,views:!0,publishedDate:!0,projectUrl:!0,fields:!0,apiKey:"",itemsPerPage:"6",userName:"",infiniteScrolling:!1,imageCaption:!1,ownerLink:!0,description:!0,tags:!0,themeColor:"#2183ee",animationDuration:300,containerId:"",animationEasing:"easeInOutExpo",coverSize:"404",feedObject:!1},t),a=[],s=1,r=[],o="",l=[],c=1,d=0,p=0,f=0,g=["https://api.behance.net/v2/users/",n.userName,"/projects?client_id=",n.apiKey,"&per_page=",n.itemsPerPage,"&page=",s];e("body").wrapInner(e("
").addClass("eb-total-inner-container")).wrapInner(e("
").addClass("eb-total-outer-container"));var b=e(this).wrap(e("
").addClass("eb-container").css({position:"relative"}));e(b).html('
    '),e("body").append(j('
    '+j("loading")+"
    "));var h=function(){a=g,g=g.join(""),r=[],n.feedObject?u(n.feedObject):e.ajax({url:g,dataType:"jsonp",success:function(e){u(e)},error:function(e){console.log("ERROR: ",e)}})};function u(t){e.each(t.projects,function(e,t){v(e,t)}),e.each(r,function(t,i){o="",o+=i.rawId,o+=i.cover,o+=i.title,o+=i.owners,o+=i.appreciations,o='
  • '+(o+=i.views)+"
  • ",e("#premium-behance-container-"+n.containerId+" .wrap-projects").append(o)}),w()}function v(t,i){r[t]={rawId:m("rawId",i),rawProjectUrl:m("rawProjectUrl",i),project:m("project",i),owners:m("owners",i),works:m("works",i),cover:m("cover",i),appreciations:m("appreciations",i),views:m("views",i),title:m("title",i),publishedDate:m("publishedDate",i),projectUrl:m("projectUrl",i),fields:m("fields",i),description:m("description",i),tags:m("tags",i)},1==d&&(l.title=".eb-container .box-inner-main .title {\n\tfont-family: "+i.styles.text.title.font_family+";\n\tfont-weight: "+i.styles.text.title.font_weight+";\n\tcolor: "+i.styles.text.title.color+";\n\ttext-align: "+i.styles.text.title.text_align+";\n\tline-height: "+i.styles.text.title.line_height+";\n\tfont-size: "+i.styles.text.title.font_size+";\n\ttext-decoration: "+i.styles.text.title.text_decoration+";\n\tfont-style: "+i.styles.text.title.font_style+";\n\ttext-transform: "+i.styles.text.title.text_transform+";\n}",l.subtitle=".eb-container .box-inner-main .sub-title {\n\tfont-family: "+i.styles.text.subtitle.font_family+";\n\tfont-weight: "+i.styles.text.subtitle.font_weight+";\n\tcolor: "+i.styles.text.subtitle.color+";\n\ttext-align: "+i.styles.text.subtitle.text_align+";\n\tline-height: "+i.styles.text.subtitle.line_height+";\n\tfont-size: "+i.styles.text.subtitle.font_size+";\n\ttext-decoration: "+i.styles.text.subtitle.text_decoration+";\n\tfont-style: "+i.styles.text.subtitle.font_style+";\n\ttext-transform: "+i.styles.text.subtitle.text_transform+";\n}",l.paragraph=".eb-container .box-inner-main .main-text {\n\tfont-family: "+i.styles.text.paragraph.font_family+";\n\tfont-weight: "+i.styles.text.paragraph.font_weight+";\n\tcolor: "+i.styles.text.paragraph.color+";\n\ttext-align: "+i.styles.text.paragraph.text_align+";\n\tline-height: "+i.styles.text.paragraph.line_height+";\n\tfont-size: "+i.styles.text.paragraph.font_size+";\n\ttext-decoration: "+i.styles.text.paragraph.text_decoration+";\n\tfont-style: "+i.styles.text.paragraph.font_style+";\n\ttext-transform: "+i.styles.text.paragraph.text_transform+";\n}",l.caption=".eb-container .box-inner-main .caption {\n\tfont-family: "+i.styles.text.caption.font_family+";\n\tfont-weight: "+i.styles.text.caption.font_weight+";\n\tcolor: "+i.styles.text.caption.color+";\n\ttext-align: "+i.styles.text.caption.text_align+";\n\tline-height: "+i.styles.text.caption.line_height+";\n\tfont-size: "+i.styles.text.caption.font_size+";\n\ttext-decoration: "+i.styles.text.caption.text_decoration+";\n\tfont-style: "+i.styles.text.caption.font_style+";\n\ttext-transform: "+i.styles.text.caption.text_transform+";\n}",l.link=".eb-container .box-inner-main a {\n\tfont-family: "+i.styles.text.link.font_family+";\n\tfont-weight: "+i.styles.text.link.font_weight+";\n\tcolor: "+i.styles.text.link.color+";\n\ttext-align: "+i.styles.text.link.text_align+";\n\tline-height: "+i.styles.text.link.line_height+";\n\tfont-size: "+i.styles.text.link.font_size+";\n\ttext-decoration: "+i.styles.text.link.text_decoration+";\n\tfont-style: "+i.styles.text.link.font_style+";\n\ttext-transform: "+i.styles.text.link.text_transform+";\n}",l.background=".eb-container .box-inner-main {\n\tbackground-color: #"+i.styles.background.color+";\n\t}",l.bottom_margin=".eb-container .box-inner-main .spacer {\n\theight: "+i.styles.spacing.modules.bottom_margin+"px;\n\t}",l.top_margin=".eb-container .box-inner-main .wrap-works-outer {\n\tpadding-top: "+i.styles.spacing.project.top_margin+"px;\n\t}",l.dividers=".eb-container .box-inner-main .spacer .divider {\n\tfont-size: "+i.styles.dividers.font_size+";\n\tline-height: "+i.styles.dividers.line_height+";\n\theight: "+i.styles.dividers.height+";\n\tborder-color: "+i.styles.dividers.border_color+";\n\tmargin: "+i.styles.dividers.margin+";\n\tposition: "+i.styles.dividers.position+";\n\ttop: "+i.styles.dividers.top+";\n\tborder-width: "+i.styles.dividers.border_width+";\n\tborder-style: "+i.styles.dividers.border_style+";\n\t}",e("head").append('"))}function m(t,i){var a="",s="";switch(t){case"rawId":a='";break;case"rawProjectUrl":a+='";break;case"owners":1==n.owners&&(a+='
    By:
    ',a+='
      ',e.each(i.owners,function(e,t){a+='
    • ',1==d&&(a+='
      ',1==n.ownerLink?a+=''+t.display_name+' profile picture':a+=''+t.display_name+' profile picture',a+="
      "),a+='
      '+j("owner"),1==n.ownerLink?a+=''+t.display_name+"":a+=t.display_name,a+="
      ",a+="
    • "}),a='
      '+(a+="
    ")+"
    ",p=1);break;case"works":a+='
      ';var r=i.name;e.each(i.modules,function(t,i){function s(){return"caption"in i&&1==n.imageCaption?'
    • '+i.caption+"
    • ":""}function o(){return 1==i.full_bleed?" full-bleed":""}switch(i.type){case"media_collection":a+='
        ',e.each(i.components,function(e,t){a+='
      • ',a+="",a+='',a+=''+r+'',a+="",a+=s(),a+="
      • "}),a+="
      ",a+='
    • ';break;case"image":a+='
    • ',a+="",a+='',a+=''+r+'',a+="",a+="
    • ",a+=s(),a+='
    • ';break;case"text":a+='
    • '+i.text+"
    • ",a+=s(),a+='
    • ';break;case"embed":a+='
    • '+i.embed+"
    • ",a+=s(),a+='
    • '}}),a='
      '+(a+="
    ")+"
    ";break;case"appreciations":1==n.appreciations&&(a+='
    '+j("thumbsUp")+"
    ",a=(s='
    ')+'
    '+(a+='

    '+i.stats.appreciations+"

    ")+"
    ",!0!==n.views&&(a+="
    "),p=1);break;case"views":1==n.views&&(a+='
    '+j("views")+"
    ",a+='

    '+i.stats.views+"

    ",!0!==n.appreciations&&(s='
    '),a=s+'
    '+a+"
    ",1==n.appreciations&&(a+="
    "),p=1);break;case"cover":var o=i.covers[n.coverSize]||i.covers[404];a+='
    ',a+=''+i.name+'',1==n.fields&&(a+='
      '+j("fields"),e.each(i.fields,function(e,t){a+='
    • '+t+"
    • "}),a+="
    "),a+="
    ";break;case"title":1==n.project&&(a+='

    '+i.name+"

    ");break;case"publishedDate":var l=document.documentElement.lang||"en";1==n.publishedDate&&(a+='
    Published:
    ',a='
    '+(a+='
    '+moment(1e3*i.published_on).locale(l).format("ddd MMM DD YYYY")+"
    ")+"
    ",p=1);break;case"projectUrl":1==n.projectUrl&&(a='",p=1);break;case"fields":1==n.fields&&(a+='
    '+j("fields")+"Fields:
    ",a+='")+"
    ",p=1);break;case"tags":1==n.tags&&(a+='
    '+j("tags")+"Tags:
    ",a+='")+"",p=1);break;case"description":1==n.description&&""!==i.description&&(a+='
    '+i.description+"
    ")}return a}function w(){function t(){0==--r&&(e(".eb-loadingicon").remove(),1==d?function(){function t(){var t=e(".eb-container .wrap-headings").outerHeight(!0);e(".eb-desktop-info").css("height","63px"),e(".eb-container .box-project aside .wrap-owners-outer").css("min-height",t)}e("div.box-project").animate({top:0,opacity:1},n.animationDuration),e(window).resize(function(){setTimeout(t,500)}),t()}():(e("ul.wrap-projects li").animate({opacity:1}),function(t){function i(t){if(e(b).find(".eb-pagination-button").length>0&&e(b).find(".eb-pagination-button").remove(),"show"==t&&0==n.infiniteScrolling)e(b).append('
    Load More
    ');else if("remove"==t)return c=0}s++,t[t.length-1]=s,g=t,t=t.join(""),e.ajax({url:t,dataType:"jsonp",success:function(e){e.projects.length>0?i("show"):i("remove")},error:function(e){console.log("Error: ",e)}})}(a),f=0))}if(1==d)var i=e(".box-project img");else i=e(".wrap-project img");var r=i.length;if(r)i.each(function(){this.complete?t():e(this).one("load",t)});else{function o(){var t=e(".eb-container .wrap-headings").outerHeight(!0);e(".eb-desktop-info").css("height","63px"),e(".eb-container .box-project aside .wrap-owners-outer").css("min-height",t)}e(".eb-loadingicon").remove(),e("div.box-project").animate({top:0,opacity:1},n.animationDuration),e(window).resize(function(){setTimeout(o,500)}),o()}}function x(){e("div.box-project").animate({top:50,opacity:0},n.animationDuration,function(){e(this).remove(),e(".eb-detail-modal-active .eb-total-outer-container").css("position","relative"),e(".eb-detail-modal-active .eb-total-outer-container > .eb-total-inner-container").css("top","auto"),e(window).scrollTop(i),e("body").removeClass(".eb-detail-modal-active"),e('style[data-css="embed-behance"]').remove(),d=!1}),e(".eb-project-overlay").animate({opacity:0},n.animationDuration,function(){e(this).remove()}),e(".eb-total-inner-container").animate({opacity:1},n.animationDuration)}e(b).on("click",".wrap-project .wrap-cover-outer, .wrap-project .wrap-title-text",function(){var t="https://www.behance.net/v2/projects/"+e(this).parent(".wrap-project").find(".raw-project-id").text()+"?api_key="+n.apiKey;d=1,function(t){e("body").append('
    '+j("loading")+"
    "),r=[],e.ajax({url:t,dataType:"jsonp",success:function(t){v(0,t.project),function(){function t(){o+='
    ',o+=r[0].owners,o+=r[0].fields,o+=r[0].views,o+=r[0].appreciations,o+=r[0].tags,o+=r[0].projectUrl,o+=r[0].publishedDate,o+="
    "}o="",o+='
    ',""!=r[0].title?o+='
    ':o+='
    ',o+='
    '+j("close")+"
    ",o+=r[0].title,o+=r[0].description,o+="
    ",o+="
    ",o+='
    ',o+=r[0].works,o+="
    ",1==p&&(o+='",o+='"),e(o='
    '+o+"
    ").insertAfter(e(".eb-total-outer-container")),1==p&&e(".eb-container .box-project").addClass("has-sidebar"),w()}()},error:function(e){console.log("ERROR: ",e)}})}(t),e("body").addClass("eb-detail-modal-active"),i=e(document).scrollTop(),e(".eb-detail-modal-active .eb-total-outer-container > .eb-total-inner-container").css({top:-i}),e(".eb-detail-modal-active .eb-total-outer-container").css("position","fixed"),e("body").append('
    '),e(".eb-project-overlay").animate({opacity:1},n.animationDuration)}),e("body").on("click",".box-project.eb-container + .eb-project-overlay",function(e){e.target==this&&x()}),e("body").on("click",".eb-container .close-project",function(){x()});var y,k=0;e(b).on("click",".eb-pagination-button:not(.active)",function(t){e(this).addClass("active"),e(this).children(".icon-loading").html(j("loading")),k||(k=1,g=a,h(),k=0)}),1==n.infiniteScrolling&&e(window).on("scroll",function(){if(clearTimeout(y),1==c&&0==d){var t=e(b).offset().top,i=e(b).outerHeight(),n=e(window).height();e(this).scrollTop()>t+i-n-50&&!f&&(y=setTimeout(function(){f=1,g=a,h()},300))}});var _=0;e("body").on("click",".sidebar-mobile .bh-show",function(){function t(t){if("show"==t){var i=e("body").height()-e(".eb-container .wrap-headings").outerHeight(!0)-20;e(".sidebar-mobile .bh-show > .label").text("Hide Info"),e(".eb-container aside.sidebar-mobile").addClass("open"),e(".eb-container aside.sidebar-mobile").animate({height:i},n.animationDuration).css("border-radius",15)}else"hide"==t&&(e(".sidebar-mobile .bh-show > .label").text("Show Info"),e("aside.sidebar-mobile").removeClass("open"),e(".eb-container aside.sidebar-mobile").animate({height:42},n.animationDuration).css("border-radius",50))}_?(_=0,t("hide")):(_=1,t("show"))});var C=0;function j(e){switch(e){case"thumbsUp":return'';case"chevronDown":return'';case"chevronUp":return'';case"chevronRight":return'';case"chevronLeft":return'';case"fields":return'';case"owner":return'';case"tags":return'';case"views":return'';case"close":return'';case"loading":return' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'}}e("body").on("click",".sidebar-desktop .eb-desktop-info",function(){function t(t){"show"==t?(e(".eb-container .sidebar-desktop").animate({left:0},n.animationDuration),e(".eb-container .sidebar-desktop").addClass("info-open"),e('
    ').insertBefore(".eb-container #wrap-headings-"+n.containerId),e(".box-project.eb-container > .eb-project-overlay").animate({opacity:1},n.animationDuration)):"hide"==t&&(e(".eb-container .sidebar-desktop").animate({left:-300},n.animationDuration),e(".eb-container .sidebar-desktop").removeClass("info-open"),e(".box-project.eb-container > .eb-project-overlay").animate({opacity:0},n.animationDuration,function(){e(this).remove()}))}C?(C=0,t("hide")):(C=1,t("show")),e("body").on("click",".box-project.eb-container > .eb-project-overlay",function(e){e.target==this&&(C=0,t("hide"))})}),h()}}(jQuery);