Skip to content

Commit

Permalink
Merge branch 'front-dismissable-welcome-notice' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nikeo committed May 18, 2017
2 parents 562ff3a + d4687ee commit d35814b
Show file tree
Hide file tree
Showing 17 changed files with 789 additions and 171 deletions.
52 changes: 50 additions & 2 deletions assets/front/css/_parts/9_0_footer.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* ------------------------------------------------------------------------- *
* Section: Footer
/* ------------------------------------------------------------------------- */
#footer { background: #fff; color: #777; width: 100%; }
#footer { background: #fff; color: #777; width: 100%; position: relative; }
#footer a { color: #777; }
#footer a:hover { color: #ccc; }
#footer .pad { padding-bottom: 30px; }
Expand Down Expand Up @@ -41,6 +41,55 @@ box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); }
#nav-footer.nav-container { background: #fff; border-top: 1px solid #eee; }
#nav-footer .nav-toggle { background: transparent; color: #444; border-left: 1px solid #eee; }

/* Welcome Note
/* ------------------------------------ */
#bottom-welcome-note {
bottom: -100%;
background-color: rgba(0, 0, 0, 0.85);
padding: 20px 0;
position: fixed;
text-align: center;
right: 0;
left: 0;
z-index: 10000;
color: #fff;
display: block;
-webkit-transition: all 0.45s ease-in-out;
-moz-transition: all, 0.45s ease-in-out;
-ms-transition: all, 0.45s ease-in-out;
-o-transition: all, 0.45s ease-in-out;
transition: all 0.45s ease-in-out;
}
#bottom-welcome-note h2 {
font-size: 1.5em;
line-height: 1.6em;
color: #fff;
margin-bottom: 15px;
}
#bottom-welcome-note a {
color: #fff;
text-decoration: underline;
}
#bottom-welcome-note p { line-height: 2em;}
#bottom-welcome-note .note-content {
display: inline-block;
line-height: 20px;
width: 80%;
}
#bottom-welcome-note .fa:before {
top: 2px;
position: relative;
padding-left: 2px;
}
#bottom-welcome-note .close-note {
position: absolute;
top: 10px;
right: 25px;
font-size: 31px;
cursor: pointer;
}


@media only screen and (min-width: 720px) {

/* common */
Expand Down Expand Up @@ -77,5 +126,4 @@ box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); }
#nav-footer .nav li.current_page_item > a,
#nav-footer .nav li.current-menu-item > a,
#nav-footer .nav li.current-post-parent > a { background: #f2f2f2; color: #444; }

}
52 changes: 50 additions & 2 deletions assets/front/css/dev-common.css
Original file line number Diff line number Diff line change
Expand Up @@ -2418,7 +2418,7 @@ svg.hu-svg-placeholder {
}/* ------------------------------------------------------------------------- *
* Section: Footer
/* ------------------------------------------------------------------------- */
#footer { background: #fff; color: #777; width: 100%; }
#footer { background: #fff; color: #777; width: 100%; position: relative; }
#footer a { color: #777; }
#footer a:hover { color: #ccc; }
#footer .pad { padding-bottom: 30px; }
Expand Down Expand Up @@ -2458,6 +2458,55 @@ box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); }
#nav-footer.nav-container { background: #fff; border-top: 1px solid #eee; }
#nav-footer .nav-toggle { background: transparent; color: #444; border-left: 1px solid #eee; }

/* Welcome Note
/* ------------------------------------ */
#bottom-welcome-note {
bottom: -100%;
background-color: rgba(0, 0, 0, 0.85);
padding: 20px 0;
position: fixed;
text-align: center;
right: 0;
left: 0;
z-index: 10000;
color: #fff;
display: block;
-webkit-transition: all 0.45s ease-in-out;
-moz-transition: all, 0.45s ease-in-out;
-ms-transition: all, 0.45s ease-in-out;
-o-transition: all, 0.45s ease-in-out;
transition: all 0.45s ease-in-out;
}
#bottom-welcome-note h2 {
font-size: 1.5em;
line-height: 1.6em;
color: #fff;
margin-bottom: 15px;
}
#bottom-welcome-note a {
color: #fff;
text-decoration: underline;
}
#bottom-welcome-note p { line-height: 2em;}
#bottom-welcome-note .note-content {
display: inline-block;
line-height: 20px;
width: 80%;
}
#bottom-welcome-note .fa:before {
top: 2px;
position: relative;
padding-left: 2px;
}
#bottom-welcome-note .close-note {
position: absolute;
top: 10px;
right: 25px;
font-size: 31px;
cursor: pointer;
}


@media only screen and (min-width: 720px) {

/* common */
Expand Down Expand Up @@ -2494,5 +2543,4 @@ box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); }
#nav-footer .nav li.current_page_item > a,
#nav-footer .nav li.current-menu-item > a,
#nav-footer .nav li.current-post-parent > a { background: #f2f2f2; color: #444; }

}
52 changes: 50 additions & 2 deletions assets/front/css/main-not-responsive.css
Original file line number Diff line number Diff line change
Expand Up @@ -2418,7 +2418,7 @@ svg.hu-svg-placeholder {
}/* ------------------------------------------------------------------------- *
* Section: Footer
/* ------------------------------------------------------------------------- */
#footer { background: #fff; color: #777; width: 100%; }
#footer { background: #fff; color: #777; width: 100%; position: relative; }
#footer a { color: #777; }
#footer a:hover { color: #ccc; }
#footer .pad { padding-bottom: 30px; }
Expand Down Expand Up @@ -2458,6 +2458,55 @@ box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); }
#nav-footer.nav-container { background: #fff; border-top: 1px solid #eee; }
#nav-footer .nav-toggle { background: transparent; color: #444; border-left: 1px solid #eee; }

/* Welcome Note
/* ------------------------------------ */
#bottom-welcome-note {
bottom: -100%;
background-color: rgba(0, 0, 0, 0.85);
padding: 20px 0;
position: fixed;
text-align: center;
right: 0;
left: 0;
z-index: 10000;
color: #fff;
display: block;
-webkit-transition: all 0.45s ease-in-out;
-moz-transition: all, 0.45s ease-in-out;
-ms-transition: all, 0.45s ease-in-out;
-o-transition: all, 0.45s ease-in-out;
transition: all 0.45s ease-in-out;
}
#bottom-welcome-note h2 {
font-size: 1.5em;
line-height: 1.6em;
color: #fff;
margin-bottom: 15px;
}
#bottom-welcome-note a {
color: #fff;
text-decoration: underline;
}
#bottom-welcome-note p { line-height: 2em;}
#bottom-welcome-note .note-content {
display: inline-block;
line-height: 20px;
width: 80%;
}
#bottom-welcome-note .fa:before {
top: 2px;
position: relative;
padding-left: 2px;
}
#bottom-welcome-note .close-note {
position: absolute;
top: 10px;
right: 25px;
font-size: 31px;
cursor: pointer;
}


@media only screen and (min-width: 720px) {

/* common */
Expand Down Expand Up @@ -2494,5 +2543,4 @@ box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); }
#nav-footer .nav li.current_page_item > a,
#nav-footer .nav li.current-menu-item > a,
#nav-footer .nav li.current-post-parent > a { background: #f2f2f2; color: #444; }

}
2 changes: 1 addition & 1 deletion assets/front/css/main-not-responsive.min.css

Large diffs are not rendered by default.

52 changes: 50 additions & 2 deletions assets/front/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2418,7 +2418,7 @@ svg.hu-svg-placeholder {
}/* ------------------------------------------------------------------------- *
* Section: Footer
/* ------------------------------------------------------------------------- */
#footer { background: #fff; color: #777; width: 100%; }
#footer { background: #fff; color: #777; width: 100%; position: relative; }
#footer a { color: #777; }
#footer a:hover { color: #ccc; }
#footer .pad { padding-bottom: 30px; }
Expand Down Expand Up @@ -2458,6 +2458,55 @@ box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); }
#nav-footer.nav-container { background: #fff; border-top: 1px solid #eee; }
#nav-footer .nav-toggle { background: transparent; color: #444; border-left: 1px solid #eee; }

/* Welcome Note
/* ------------------------------------ */
#bottom-welcome-note {
bottom: -100%;
background-color: rgba(0, 0, 0, 0.85);
padding: 20px 0;
position: fixed;
text-align: center;
right: 0;
left: 0;
z-index: 10000;
color: #fff;
display: block;
-webkit-transition: all 0.45s ease-in-out;
-moz-transition: all, 0.45s ease-in-out;
-ms-transition: all, 0.45s ease-in-out;
-o-transition: all, 0.45s ease-in-out;
transition: all 0.45s ease-in-out;
}
#bottom-welcome-note h2 {
font-size: 1.5em;
line-height: 1.6em;
color: #fff;
margin-bottom: 15px;
}
#bottom-welcome-note a {
color: #fff;
text-decoration: underline;
}
#bottom-welcome-note p { line-height: 2em;}
#bottom-welcome-note .note-content {
display: inline-block;
line-height: 20px;
width: 80%;
}
#bottom-welcome-note .fa:before {
top: 2px;
position: relative;
padding-left: 2px;
}
#bottom-welcome-note .close-note {
position: absolute;
top: 10px;
right: 25px;
font-size: 31px;
cursor: pointer;
}


@media only screen and (min-width: 720px) {

/* common */
Expand Down Expand Up @@ -2494,7 +2543,6 @@ box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); }
#nav-footer .nav li.current_page_item > a,
#nav-footer .nav li.current-menu-item > a,
#nav-footer .nav li.current-post-parent > a { background: #f2f2f2; color: #444; }

}#wrapper,
.container-inner { min-width: 320px; }

Expand Down
2 changes: 1 addition & 1 deletion assets/front/css/main.min.css

Large diffs are not rendered by default.

108 changes: 108 additions & 0 deletions assets/front/js/_parts/_main_userxp_5_welcome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
var czrapp = czrapp || {};

/************************************************
* USER EXPERIENCE SUB CLASS
*************************************************/
(function($, czrapp) {
var _methods = {
mayBePrintWelcomeNote : function() {
if ( ! HUParams.isWelcomeNoteOn )
return;
var self = this;
czrapp.welcomeNoteVisible = new czrapp.Value( false );
//Listen to changes
czrapp.welcomeNoteVisible.bind( function( visible ) {
return self._toggleWelcNote( visible );//returns a promise()
}, { deferred : true } );

czrapp.welcomeNoteVisible( true );
},//mayBePrintWelcomeNote()


_toggleWelcNote : function( visible ) {
var self = this,
dfd = $.Deferred();

var _hideAndDestroy = function() {
return $.Deferred( function() {
var _dfd_ = this,
$welcWrap = $('#bottom-welcome-note', '#footer');
if ( 1 == $welcWrap.length ) {
$welcWrap.css( { bottom : '-100%' } );
//remove and reset
_.delay( function() {
$welcWrap.remove();
_dfd_.resolve();
}, 450 );// consistent with css transition: all 0.45s ease-in-out;
} else {
_dfd_.resolve();
}
});
};

var _renderAndSetup = function() {
var _dfd_ = $.Deferred(),
$footer = $('#footer', '#wrapper');

//Render
$.Deferred( function() {
var dfd = this,
_html = HUParams.welcomeContent;
if ( 1 == $footer.length ) {
$footer.append( _html );
_.delay( function() {
$('#bottom-welcome-note', '#footer').css( { bottom : 0 } );
dfd.resolve();
}, 500 );
} else {
dfd.resolve();
}
}).done( function() {
//Listen to user actions
czrapp.setupDOMListeners(
[
{
trigger : 'click keydown',
selector : '.close-note',
actions : function() {
czrapp.welcomeNoteVisible( false ).done( function() {
czrapp.doAjax( { action: "dismiss_welcome_front" } );
});
}
}
],//actions to execute
{ dom_el: $footer },//dom scope
self //instance where to look for the cb methods
);
_dfd_.resolve();
});
return _dfd_.promise();
};//renderAndSetup

if ( visible ) {
_.delay( function() {
_renderAndSetup().always( function() {
dfd.resolve();
});
}, 3000 );
} else {
_hideAndDestroy().done( function() {
czrapp.welcomeNoteVisible( false );//should be already false
dfd.resolve();
});
}

//Always auto-collapse the infos block
_.delay( function() {
czrapp.welcomeNoteVisible( false );
},
45000
);
return dfd.promise();
}//_toggleWelcNote
};//_methods{}

czrapp.methods.UserXP = czrapp.methods.UserXP || {};
$.extend( czrapp.methods.UserXP , _methods );

})(jQuery, czrapp);
Loading

0 comments on commit d35814b

Please sign in to comment.