Skip to content

Commit

Permalink
Add a huge button to switch from PC version to mobile version.
Browse files Browse the repository at this point in the history
  • Loading branch information
lincanbin committed Jun 16, 2016
1 parent 785f000 commit 00b9f8a
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 64 deletions.
48 changes: 23 additions & 25 deletions styles/default/template/layout.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
if (!defined('InternalAccess')) exit('error: 403 Access Denied');

$LayoutPageTitle = ($CurUserID && $CurUserInfo['NewMessage']?str_replace('{{NewMessage}}', $CurUserInfo['NewMessage'], $Lang['New_Message']):'') . $PageTitle . ($UrlPath=='index'?'':' - '.$Config['SiteName']);

header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
Expand Down Expand Up @@ -32,10 +35,7 @@
}
?>
<meta name="msapplication-TileImage" content="<?php echo $Config['WebsitePath']; ?>/static/img/retinahd_icon.png" />
<title><?php
echo $CurUserID && $CurUserInfo['NewMessage']?str_replace('{{NewMessage}}', $CurUserInfo['NewMessage'], $Lang['New_Message']):'';
echo $PageTitle;
echo $UrlPath=='index'?'':' - '.$Config['SiteName']; ?></title>
<title><?php echo $LayoutPageTitle; ?></title>
<!--link rel="dns-prefetch" href="//<?php echo $Config['MainDomainName']; ?>" />
<link rel="prefetch" href="//<?php echo $Config['MainDomainName']; ?>" /-->
<link rel="apple-touch-icon-precomposed" href="<?php echo $Config['WebsitePath']; ?>/static/img/apple-touch-icon-57x57-precomposed.png" />
Expand Down Expand Up @@ -63,9 +63,9 @@
<body>
<!-- content wrapper start -->
<div class="wrapper">
<div class="navBar">
<div class="navPanel">
<div class="innerNavPanel">
<div class="nav-bar">
<div class="nav-panel">
<div class="inner-nav-panel">
<div class="logo">
<a href="<?php echo $Config['WebsitePath']; ?>/">
<img src="<?php echo $Config['WebsitePath']; ?>/static/img/logo.png" alt="<?php echo $Lang['Home']; ?>" />
Expand All @@ -76,15 +76,9 @@
<input type="text" id="SearchInput" onkeydown="javascript:if((event.keyCode==13)&&(this.value!='')){$('#SearchButton').trigger('click');}" placeholder="<?php echo $Lang['Search']; ?>"<?php echo $UrlPath=='search'&&!empty($Keyword)?' value="'.$Keyword.'"':'';?> />
<a href="###" id="SearchButton"><div class="icon icon-search"></div></a>
</div>


<?php
if($CurUserID){
?>




<a href="<?php echo $Config['WebsitePath']; ?>/settings" title="<?php echo $Lang['Settings']; ?>"<?php echo $UrlPath=='settings'?' class="buttons-active"':''; ?>><div class="icon icon-settings"></div></a>
<a href="<?php echo $Config['WebsitePath']; ?>/notifications#notifications1" title="<?php echo $Lang['Notifications']; ?>"<?php echo $UrlPath=='notifications'?' class="buttons-active"':''; ?> onclick="javascript:ShowNotification(0);"><div class="icon icon-notifications"></div><span class="icon-messages-num" id="MessageNumber">0</span></a>
<?php
Expand Down Expand Up @@ -123,16 +117,27 @@
</div>
</div>
<!-- main start -->
<div class="main-content"></div>
<?php
}else{
echo '<title>';
echo $CurUserID && $CurUserInfo['NewMessage']?str_replace('{{NewMessage}}', $CurUserInfo['NewMessage'], $Lang['New_Message']):'';
echo $PageTitle;
echo $UrlPath=='index'?'':' - '.$Config['SiteName'];
echo '</title>';
?>
<title><?php echo $LayoutPageTitle; ?></title>
<?php
}
?>
<div class="main" id="main">
<?php
if ($IsMobile && $Config['MobileDomainName']) {
?>
<div class="swtich-to-mobile">
<a href="<?php echo $CurProtocol . $Config['MainDomainName']; ?>/view-mobile?callback=<?php echo urlencode($RequestURI); ?>">
<?php echo $Lang['Mobile_Version']; ?>
</a>
</div>
<?php
}
?>

<?php
include($ContentFile);
?>
Expand All @@ -150,13 +155,6 @@
<p>
<?php echo $Config['SiteName']; ?> Powered By © 2006-2016 <a href="http://www.94cb.com" target="_blank">Carbon Forum</a> V<?php echo $Config['Version']; ?>
<a href="<?php echo $Config['WebsitePath']; ?>/statistics"><?php echo $Lang['Statistics']; ?></a>
<?php
if ($IsMobile && $Config['MobileDomainName']) {
?>
&nbsp;&nbsp;<a href="<?php echo $CurProtocol . $Config['MainDomainName']; ?>/view-mobile?callback=<?php echo urlencode($RequestURI); ?>"><?php echo $Lang['Mobile_Version']; ?></a>
<?php
}
?>
<br />
<?php
$MicroTime = explode(' ', microtime());
Expand Down
6 changes: 3 additions & 3 deletions styles/default/template/sider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
<span class="float-right"><a href="<?php echo $Config['WebsitePath']; ?>/login?logout=<?php echo $CurUserCode; ?>"><?php echo $Lang['Log_Out']; ?></a></span>
</div>
<div class="sider-box-content">
<div class="User-Pannel-Avatar">
<div class="user-pannel-avatar">
<a href="<?php echo $Config['WebsitePath']; ?>/u/<?php echo urlencode($CurUserName); ?>">
<?php echo GetAvatar($CurUserID, $CurUserName, 'large'); ?>
</a>
</div>
<div class="User-Pannel">
<div class="User-Pannel-Name">
<div class="user-pannel">
<div class="user-pannel-name">
<a href="<?php echo $Config['WebsitePath']; ?>/u/<?php echo urlencode($CurUserName); ?>"><?php echo $CurUserName; ?></a>
</div>
<ul>
Expand Down
80 changes: 44 additions & 36 deletions styles/default/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,45 @@ body {
color: #000000;
line-height: 1.5;
background: #F9F9F9;
margin: 0px;
padding: 0px;
margin: 0;
padding: 0;
}
/* title */
.topic-content h1, .comment-content h1 {
color: #555;
font-size: 180%;
font-weight: bold;
padding: 15px 0px 15px 0px;
margin: 10px 0px 10px 0px;
padding: 15px 0 15px 0;
margin: 10px 0 10px 0;
border-bottom: 1px dashed #33B5E5;
}
.topic-content h2, .comment-content h2 {
color: #555;
font-size: 160%;
font-weight: bold;
padding: 15px 0px 15px 10px;
margin: 10px 0px 10px 0px;
padding: 15px 0 15px 10px;
margin: 10px 0 10px 0;
border-bottom: 1px dashed #33B5E5;
}
.topic-content h3, .comment-content h3 {
color: #555;
font-size: 140%;
font-weight: bold;
padding: 5px 0px 5px 20px;
margin: 10px 0px 10px 0px;
padding: 5px 0 5px 20px;
margin: 10px 0 10px 0;
}
.topic-content h4, .comment-content h4 {
color: #555;
font-size: 120%;
font-weight: bold;
padding: 5px 5px 5px 30px;
margin: 10px 0px 5px 0px;
margin: 10px 0 5px 0;
}
/* text*/
p {
line-height: 1.5;
margin: 5px 0px 10px 0px;
padding: 0px;
margin: 5px 0 10px 0;
padding: 0;
}
/* links*/
a, a:link, a:visited, a:active {
Expand Down Expand Up @@ -205,8 +205,8 @@ blockquote {
}
/* tabs */
ul.resp-tabs-list {
margin: 0px;
padding: 0px;
margin: 0;
padding: 0;
}
.resp-tabs-list li {
font-size: 14px;
Expand Down Expand Up @@ -280,11 +280,11 @@ h2.resp-accordion {
/* other*/
.wrapper {
min-width:980px;
margin:0px auto;
padding: 0px;
margin:0 auto;
padding: 0;
}
/****** Nav Panel ******/
.navBar{
.nav-bar{
position: fixed;
width: 100%;
padding: 0 auto;
Expand All @@ -296,16 +296,16 @@ h2.resp-accordion {
opacity: 0.9;
z-index: 9999;
}
.navPanel {
.nav-panel {
min-width:960px;
background: #f9f9f9;
padding: 0px 10px 0px 10px;
padding: 0 10px 0 10px;
border-bottom: 1px solid #4fc3f7;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.07);
}
.innerNavPanel {
.inner-nav-panel {
width:960px;
margin:0px auto;
margin:0 auto;
}
/* logo */
.logo {
Expand All @@ -320,7 +320,7 @@ h2.resp-accordion {
height: 40px;
}
.logo img:hover {
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
transition: box-shadow 0.5s ease-in-out;
-moz-transition: border-bottom 0.5s; /* Firefox 4 */
-webkit-transition: border-bottom 0.5s; /* Safari and Chrome */
Expand Down Expand Up @@ -399,7 +399,7 @@ h2.resp-accordion {
/* sorry for this ie6 hack*/
* html .buttons img {
float: left;
margin: 5px 5px 5px 0px;
margin: 5px 5px 5px 0;
}
.emptyProgressBar{
height: 3px;
Expand All @@ -412,15 +412,22 @@ h2.resp-accordion {
}

.progressBar .bar1{
width: 0%;
width: 0;
height: 3px;
background-color: #4fc3f7;
}

.swtich-to-mobile {
margin: 10px auto 20px auto;
text-align: center;
font-size: 60px;
box-shadow: 2px 2px 5px #d3d6da;
}

.Copyright {
min-width:960px;
margin: auto;
padding: 0px;
padding: 0;
text-align:center;
}
.hide {
Expand All @@ -433,7 +440,7 @@ h2.resp-accordion {
float:left;
}
.float-right {
float:right !important;
float: right !important;
}
.text-center {
text-align:center;
Expand Down Expand Up @@ -499,7 +506,7 @@ img .avatar {
font-size:12px;
background-color:#000;
border-radius:5px;
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}
.title {
background: #ECECEC;
Expand Down Expand Up @@ -540,7 +547,7 @@ img .avatar {
box-shadow: 2px 2px 5px #d3d6da;
}
.without-title {
border-top: 0px solid #E2E2E9;
border-top: 0 solid #E2E2E9;
}
.home-box-list {
width:670px;
Expand Down Expand Up @@ -608,7 +615,7 @@ img .avatar {
font-weight: bold;
}
.topic-tags .edittag{
vertical-align: center;
vertical-align: central;
cursor:pointer;
font-style: italic;
border:none;
Expand Down Expand Up @@ -725,6 +732,7 @@ img .avatar {
cursor: pointer;
transition:background-color 0.2s ease-in-out;
}
/* comment */
.comment-item {
border-bottom: 1px solid #EFEFEF;
padding:0 10px 0 10px;
Expand Down Expand Up @@ -888,23 +896,23 @@ img .avatar {
max-width: 250px;
}
/* User Pannel*/
.User-Pannel-Avatar{
.user-pannel-avatar{
width: 128px;
padding: 0 61px;
}
.User-Pannel-Avatar img{
.user-pannel-avatar img{
margin-top: 10px;
max-width: 128px;
max-height: 128px;
border-radius: 50%;
}
.User-Pannel-Name{
.user-pannel-name{
font-size: 16px;
text-align: center;
font-weight: bold;
padding: 8px 0;
}
.User-Pannel ul{
.user-pannel ul{
height: 42px !important;
overflow: hidden !important;
margin: 10px 0 0 0 !important;
Expand All @@ -914,7 +922,7 @@ img .avatar {
display: block !important;
clear: both !important;
}
.User-Pannel li{
.user-pannel li{
display: inline !important;
float: left;
width: 82px !important;
Expand All @@ -926,19 +934,19 @@ img .avatar {
padding: 0 !important;
clear: none !important
}
.User-Pannel li strong{
.user-pannel li strong{
color: #333;
display: block !important;
font-weight: bold !important;
line-height: 18px !important;
width: 82px !important;
overflow: hidden !important;
}
.User-Pannel li span{
.user-pannel li span{
font-size: 12px !important;
color:#808080;
}
.User-Pannel li strong:hover{
.user-pannel li strong:hover{
color: #4fc3f7;
}
/* FORM end*/
Expand Down

0 comments on commit 00b9f8a

Please sign in to comment.