-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,920 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
/*! | ||
* Hamburgers | ||
* @description Tasty CSS-animated hamburgers | ||
* @author Jonathan Suh @jonsuh | ||
* @site https://jonsuh.com/hamburgers | ||
* @link https://github.com/jonsuh/hamburgers | ||
*/ | ||
.hamburger { | ||
padding: 15px 15px; | ||
display: inline-block; | ||
cursor: pointer; | ||
transition-property: opacity, filter; | ||
transition-duration: 0.15s; | ||
transition-timing-function: linear; | ||
font: inherit; | ||
color: inherit; | ||
text-transform: none; | ||
background-color: transparent; | ||
border: 0; | ||
margin: 0; | ||
overflow: visible; } | ||
|
||
.hamburger:hover { | ||
opacity: 0.7; } | ||
|
||
.hamburger-box { | ||
width: 40px; | ||
height: 24px; | ||
display: inline-block; | ||
position: relative; } | ||
|
||
.hamburger-inner { | ||
display: block; | ||
top: 50%; | ||
margin-top: -2px; } | ||
.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after { | ||
width: 40px; | ||
height: 4px; | ||
background-color: #1d9ce5; | ||
border-radius: 4px; | ||
position: absolute; | ||
transition-property: transform; | ||
transition-duration: 0.15s; | ||
transition-timing-function: ease; } | ||
.hamburger-inner::before, .hamburger-inner::after { | ||
content: ""; | ||
display: block; } | ||
.hamburger-inner::before { | ||
top: -10px; } | ||
.hamburger-inner::after { | ||
bottom: -10px; } | ||
|
||
|
||
/* | ||
* Arrow | ||
*/ | ||
.hamburger--arrow.is-active .hamburger-inner::before { | ||
transform: translate3d(-8px, 0, 0) rotate(-45deg) scale(0.7, 1); } | ||
|
||
.hamburger--arrow.is-active .hamburger-inner::after { | ||
transform: translate3d(-8px, 0, 0) rotate(45deg) scale(0.7, 1); } | ||
|
||
/* | ||
* Arrow Right | ||
*/ | ||
.hamburger--arrow-r.is-active .hamburger-inner::before { | ||
transform: translate3d(8px, 0, 0) rotate(45deg) scale(0.7, 1); } | ||
|
||
.hamburger--arrow-r.is-active .hamburger-inner::after { | ||
transform: translate3d(8px, 0, 0) rotate(-45deg) scale(0.7, 1); } | ||
|
||
/* | ||
* Arrow Alt | ||
*/ | ||
.hamburger--arrowalt .hamburger-inner::before { | ||
transition: top 0.1s 0.1s ease, transform 0.1s cubic-bezier(0.165, 0.84, 0.44, 1); } | ||
|
||
.hamburger--arrowalt .hamburger-inner::after { | ||
transition: bottom 0.1s 0.1s ease, transform 0.1s cubic-bezier(0.165, 0.84, 0.44, 1); } | ||
|
||
.hamburger--arrowalt.is-active .hamburger-inner::before { | ||
top: 0; | ||
transform: translate3d(-8px, -10px, 0) rotate(-45deg) scale(0.7, 1); | ||
transition: top 0.1s ease, transform 0.1s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); } | ||
|
||
.hamburger--arrowalt.is-active .hamburger-inner::after { | ||
bottom: 0; | ||
transform: translate3d(-8px, 10px, 0) rotate(45deg) scale(0.7, 1); | ||
transition: bottom 0.1s ease, transform 0.1s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); } | ||
|
||
/* | ||
* Arrow Alt Right | ||
*/ | ||
.hamburger--arrowalt-r .hamburger-inner::before { | ||
transition: top 0.1s 0.1s ease, transform 0.1s cubic-bezier(0.165, 0.84, 0.44, 1); } | ||
|
||
.hamburger--arrowalt-r .hamburger-inner::after { | ||
transition: bottom 0.1s 0.1s ease, transform 0.1s cubic-bezier(0.165, 0.84, 0.44, 1); } | ||
|
||
.hamburger--arrowalt-r.is-active .hamburger-inner::before { | ||
top: 0; | ||
transform: translate3d(8px, -10px, 0) rotate(45deg) scale(0.7, 1); | ||
transition: top 0.1s ease, transform 0.1s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); } | ||
|
||
.hamburger--arrowalt-r.is-active .hamburger-inner::after { | ||
bottom: 0; | ||
transform: translate3d(8px, 10px, 0) rotate(-45deg) scale(0.7, 1); | ||
transition: bottom 0.1s ease, transform 0.1s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); } | ||
|
||
/* | ||
* Arrow Turn | ||
*/ | ||
.hamburger--arrowturn.is-active .hamburger-inner { | ||
transform: rotate(-180deg); } | ||
.hamburger--arrowturn.is-active .hamburger-inner::before { | ||
transform: translate3d(8px, 0, 0) rotate(45deg) scale(0.7, 1); } | ||
.hamburger--arrowturn.is-active .hamburger-inner::after { | ||
transform: translate3d(8px, 0, 0) rotate(-45deg) scale(0.7, 1); } | ||
|
||
/* | ||
* Arrow Turn Right | ||
*/ | ||
.hamburger--arrowturn-r.is-active .hamburger-inner { | ||
transform: rotate(-180deg); } | ||
.hamburger--arrowturn-r.is-active .hamburger-inner::before { | ||
transform: translate3d(-8px, 0, 0) rotate(-45deg) scale(0.7, 1); } | ||
.hamburger--arrowturn-r.is-active .hamburger-inner::after { | ||
transform: translate3d(-8px, 0, 0) rotate(45deg) scale(0.7, 1); } | ||
|
||
|
||
|
||
button:focus { | ||
outline: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,212 @@ | ||
<?php | ||
//This serves as an example to make your own template with DB based navigation | ||
//Edit these functions to meet your own style needs. | ||
//Note that there are a few "default" menu items that you are free to delete at your own risk | ||
//Generally you can look for the <li> tags and anything you change in there will be reflected in your template. | ||
function customItemString($menuItem,$user_id){ | ||
$itemString=''; | ||
|
||
//what do you want to happen if someone wants a "divider in their dropdown menu?" | ||
|
||
|
||
|
||
// typical bootstrap 4 styling... | ||
if($menuItem['label']=='{{hr}}') { $itemString = "<div class='dropdown-divider'></div>"; } //some bs4 css files will ignore this | ||
|
||
|
||
elseif($menuItem['link']=='users/verify_resend.php' || $menuItem['link']=='usersc/verify_resend.php') { | ||
$db = DB::getInstance(); | ||
$query = $db->query("SELECT * FROM email"); | ||
$results = $query->first(); | ||
$email_act=$results->email_act; | ||
if($email_act==1) { | ||
|
||
$itemString.='<li class="nav-item"><a class="nav-link" href="'.US_URL_ROOT.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a></li>'; } | ||
} | ||
|
||
|
||
elseif($menuItem['link']=='users/join.php' || $menuItem['link']=='usersc/join.php') { | ||
$db = DB::getInstance(); | ||
$query = $db->query("SELECT * FROM settings"); | ||
$results = $query->first(); | ||
$registration=$results->registration; | ||
if($registration==1) { | ||
$itemString.='<li class="nav-item"><a class="nav-link" href="'.US_URL_ROOT.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a></li>'; } | ||
} | ||
else { | ||
|
||
|
||
// THIS is a typical menu link. What do you want it to look like? | ||
// Note that this is in here twice to deal with if the link has http in it for a link to another website | ||
$fix = $menuItem['link']; | ||
if(substr($fix,0,4) == "http"){$e = 1;}else{$e=0;} | ||
if($e == 1){ | ||
|
||
//It works the same for bootstrap 3 and 4 by default, but yourt template might want something other than li tags | ||
$itemString.='<li class="nav-item"><a class="nav-link" href="'.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a></li>'; | ||
}else{ | ||
$itemString.='<li class="nav-item"><a class="nav-link" href="'.US_URL_ROOT.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a></li>'; | ||
}} | ||
return $itemString; | ||
|
||
} | ||
|
||
|
||
function DropdownString($menuItem,$user_id){ | ||
$itemString=''; | ||
|
||
//what do you want to happen if someone wants a "divider in their dropdown menu?" | ||
|
||
|
||
|
||
// typical bootstrap 4 styling... | ||
if($menuItem['label']=='{{hr}}') { $itemString = "<div class='dropdown-divider'></div>"; } //some bs4 css files will ignore this | ||
|
||
|
||
elseif($menuItem['link']=='users/verify_resend.php' || $menuItem['link']=='usersc/verify_resend.php') { | ||
$db = DB::getInstance(); | ||
$query = $db->query("SELECT * FROM email"); | ||
$results = $query->first(); | ||
$email_act=$results->email_act; | ||
if($email_act==1) { | ||
|
||
$itemString.='<li class="nav-item"><a class="nav-link" href="'.US_URL_ROOT.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a></li>'; } | ||
} | ||
|
||
|
||
elseif($menuItem['link']=='users/join.php' || $menuItem['link']=='usersc/join.php') { | ||
$db = DB::getInstance(); | ||
$query = $db->query("SELECT * FROM settings"); | ||
$results = $query->first(); | ||
$registration=$results->registration; | ||
if($registration==1) { | ||
$itemString.='<li class="nav-item"><a class="nav-link" href="'.US_URL_ROOT.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a></li>'; } | ||
} | ||
else { | ||
|
||
|
||
// THIS is a typical menu link. What do you want it to look like? | ||
// Note that this is in here twice to deal with if the link has http in it for a link to another website | ||
$fix = $menuItem['link']; | ||
if(substr($fix,0,4) == "http"){$e = 1;}else{$e=0;} | ||
if($e == 1){ | ||
|
||
//It works the same for bootstrap 3 and 4 by default, but yourt template might want something other than li tags | ||
$itemString.='<a class="dropdown-item" href="'.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a>'; | ||
}else{ | ||
$itemString.='<a class="dropdown-item" href="'.US_URL_ROOT.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a>'; | ||
}} | ||
return $itemString; | ||
|
||
} | ||
|
||
// Let's deal with dropdown menus | ||
function customDropdownString($menuItem,$user_id){ | ||
$itemString=''; | ||
//bs4 usually uses divs, bs3 often uses li tags here | ||
$itemString.='<li class="nav-item dropdown">'; | ||
|
||
// This is the little down arrow next to a dropdown menu. It works for bs3 and 4 | ||
$itemString.='<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" id="navbardrop" aria-haspopup="true" aria-expanded="false"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a>'; | ||
|
||
//bs4 usually uses divs, bs3 often uses ul tags here | ||
$itemString.='<div class="dropdown-menu">'; | ||
|
||
// These are the "child items" -- the things in the dropdown menu itself | ||
// You can usually leave this section alone | ||
foreach ($menuItem['children'] as $childItem){ | ||
$authorizedGroups = array(); | ||
foreach (fetchGroupsByMenu($childItem['id']) as $g) { | ||
$authorizedGroups[] = $g->group_id; | ||
} | ||
if($childItem['logged_in']==0 || (hasPerm($authorizedGroups,$user_id) || in_array(0,$authorizedGroups))) { | ||
$itemString.=DropdownString($childItem,$user_id); } | ||
} | ||
//if you used li and ul above, make sure you close those here. | ||
$itemString.='</div></li>'; | ||
return $itemString; | ||
} | ||
|
||
// Set up notifications button/modal | ||
if ($user->isLoggedIn()) { | ||
if ($dayLimitQ = $db->query('SELECT notif_daylimit FROM settings', array())) $dayLimit = $dayLimitQ->results()[0]->notif_daylimit; | ||
else $dayLimit = 7; | ||
|
||
// 2nd parameter- true/false for all notifications or only current | ||
$notifications = new Notification($user->data()->id, false, $dayLimit); | ||
} | ||
/* | ||
Load main navigation menus | ||
*/ | ||
$main_nav_all = $db->query("SELECT * FROM menus WHERE menu_title='main' ORDER BY display_order"); | ||
|
||
/* | ||
Set "results" to true to return associative array instead of object...part of db class | ||
*/ | ||
$main_nav=$main_nav_all->results(true); | ||
$prep=prepareMenuTree($main_nav); ; | ||
foreach ($prep as $key => $value) { | ||
$authorizedGroups = array(); | ||
foreach (fetchGroupsByMenu($value['id']) as $g) { | ||
$authorizedGroups[] = $g->group_id; | ||
} | ||
/* | ||
Check if there are children of the current nav item...if no children, display single menu item, if children display dropdown menu | ||
*/ | ||
if (sizeof($value['children'])==0) { | ||
if ($user->isLoggedIn()) { | ||
if((hasPerm($authorizedGroups,$user->data()->id) || in_array(0,$authorizedGroups)) && $value['logged_in']==1) { | ||
//if (checkMenu($value['id'],$user->data()->id) && $value['logged_in']==1) { | ||
if($value['label']=='{{notifications}}') { | ||
$itemString=''; | ||
if($settings->notifications==1) { | ||
$itemString='<li class="nav-item"><a class="nav-link" href="#" onclick="displayNotifications('; | ||
$itemString.="'new')"; | ||
$itemString.='"'; | ||
$itemString.='id="notificationsTrigger" data-toggle="modal" data-target="#notificationsModal"><span class="fa fa-fw fa-bell-o"></span><span id="notifCount" class="badge badge-pill badge-primary" style="margin-top: -5px;">'; | ||
$itemString.=(int)$notifications->getUnreadCount(); | ||
$itemString.='</span></a></li>'; | ||
} | ||
} | ||
elseif($value['label']=='{{messages}}') { | ||
$itemString=''; | ||
if($settings->messaging==1) { | ||
// glyphicons are deprecated out of bootstrap 4. Annoying. Let's override with a font-awesome 4.7 icon. | ||
$itemString='<li class="nav-item"><a class="nav-link" href="'.$us_url_root.'users/messages.php"><i data-count="'.$msgC.'" class="fa fa-fw fa-envelope-o icon-white badge"> '; | ||
if($msgC > 0) $itemString.= '('.$msgC.')';//I'm being lazy and putting () around the msg count | ||
$itemString.='</i></a></li>'; } | ||
} | ||
else { | ||
$itemString = customItemString($value,$user->data()->id); | ||
include $abs_us_root.$us_url_root.'users/includes/template/database_navigation_hooks.php'; | ||
include $abs_us_root.$us_url_root.'usersc/includes/database_navigation_hooks.php'; | ||
} | ||
echo $itemString; | ||
} | ||
} else { | ||
if ($value['logged_in']==0) { | ||
$itemString = customItemString($value,0); | ||
include $abs_us_root.$us_url_root.'users/includes/template/database_navigation_hooks.php'; | ||
include $abs_us_root.$us_url_root.'usersc/includes/database_navigation_hooks.php'; | ||
echo $itemString; | ||
} | ||
} | ||
} else { | ||
if ($user->isLoggedIn()) { | ||
if((hasPerm($authorizedGroups,$user->data()->id) || in_array(0,$authorizedGroups)) && $value['logged_in']==1) { | ||
$dropdownString=customDropdownString($value,$user->data()->id); | ||
include $abs_us_root.$us_url_root.'users/includes/template/database_navigation_hooks_dropdown.php'; | ||
include $abs_us_root.$us_url_root.'usersc/includes/database_navigation_hooks_dropdown.php'; | ||
echo $dropdownString; | ||
} | ||
} else { | ||
if ($value['logged_in']==0) { | ||
$dropdownString=customDropdownString($value,0); | ||
include $abs_us_root.$us_url_root.'users/includes/template/database_navigation_hooks_dropdown.php'; | ||
include $abs_us_root.$us_url_root.'usersc/includes/database_navigation_hooks_dropdown.php'; | ||
echo $dropdownString; | ||
} | ||
} | ||
} | ||
} | ||
?> |
Oops, something went wrong.