Better main page

This commit is contained in:
Marcin Kurczewski 2013-10-21 09:35:06 +02:00
parent aed60da6f9
commit aab67f4b6c
2 changed files with 57 additions and 66 deletions

View file

@ -1,70 +1,69 @@
#sidebar { #welcome {
min-width: 100px;
padding: 5em 0;
width: 25%;
margin-right: 5%;
text-align: center; text-align: center;
} }
#sidebar p { #welcome p {
font-size: small; font-size: small;
margin-top: 0;
} }
#sidebar p span:not(:last-child):after { #welcome p span:not(:last-child):after {
content: '\022C5'; content: '\022C5';
margin: 0 0.5em; margin: 0 0.5em;
} }
#sidebar h1 { #content h1 {
font-size: 26pt; font-size: 26pt;
} margin-top: 1em;
#sidebar input { margin-bottom: 0;
width: 100%;
max-width: 300px;
border: 2px solid #ccc;
padding: 5px;
} }
#inner-content { #content {
float: right; margin: 0 auto;
width: 70%; width: 70%;
min-width: 500px;
position: relative; position: relative;
} }
.small-screen #content {
width: 100%;
min-width: 0;
max-width: 500px;
}
#inner-content .header .tags:before { #content .header .tags:before {
margin: 0 0.5em; margin: 0 0.5em;
content: '\2013'; content: '\2013';
} }
#inner-content .header ul { #content .header ul {
list-style-type: none; list-style-type: none;
display: inline; display: inline;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#inner-content .header li { #content .header li {
display: inline; display: inline;
} }
#inner-content .header li:not(:last-child) a:after { #content .header li:not(:last-child) a:after {
content: ', '; content: ', ';
} }
#inner-content .body { #content .body {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAJElEQVQImWNgYGBgePfu3X8YZoABFA6SIqwS+HXgtANZF7IEAJnGPJE70lLLAAAAAElFTkSuQmCC'); background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAJElEQVQImWNgYGBgePfu3X8YZoABFA6SIqwS+HXgtANZF7IEAJnGPJE70lLLAAAAAElFTkSuQmCC');
margin: 1em 0; margin: 1em 0;
text-align: center; text-align: center;
} }
#inner-content .body img { #content .body img {
max-width: 100%; max-width: 100%;
margin: 0 auto; margin: 0 auto;
display: block; display: block;
} }
#inner-content .body a { #content .body a {
display: block; display: block;
} }
#inner-content .header .favs-comments { #content .header .favs-comments {
margin-left: 0.5em; margin-left: 0.5em;
float: right; float: right;
} }
#inner-content .footer { #content .footer {
text-align: right; text-align: right;
} }

View file

@ -1,53 +1,45 @@
<div id="sidebar"> <div id="welcome">
<h1><?php echo $this->config->main->title ?></h1> <h1><?php echo $this->config->main->title ?></h1>
<form name="search" action="<?php echo \Chibi\UrlHelper::route('post', 'list') ?>" method="get">
<input type="search" name="query" placeholder="Search&hellip;" value="<?php echo isset($this->context->transport->searchQuery) ? htmlspecialchars($this->context->transport->searchQuery) : '' ?>">
</form>
<p> <p>
<span>serving <?php echo $this->context->transport->postCount ?> posts</span> <span>serving <?php echo $this->context->transport->postCount ?> posts</span>
<span>powered by <a href="<?php echo SZURU_LINK ?>">szurubooru</a></span>
</p> </p>
</div> </div>
<?php if (!empty($this->context->featuredPost)): ?> <?php if (!empty($this->context->featuredPost)): ?>
<div id="inner-content"> <div class="header">
<div class="header"> Featured image
Featured image
<ul class="tags"> <ul class="tags">
<?php foreach ($this->context->featuredPost->sharedTag as $tag): ?> <?php foreach ($this->context->featuredPost->sharedTag as $tag): ?>
<li> <li>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'list', ['query' => $tag->name]) ?>"> <a href="<?php echo \Chibi\UrlHelper::route('post', 'list', ['query' => $tag->name]) ?>">
<?php echo $tag->name ?> <?php echo $tag->name ?>
</a> </a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>
<span class="favs-comments">
<?php printf('%d&nbsp;fav%s', $x = $this->context->featuredPost->countOwn('favoritee'), $x == 1 ? '' : 's') ?>,&#32;
<?php printf('%d&nbsp;comment%s', $x = $this->context->featuredPost->countOwn('comment'), $x == 1 ? '' : 's') ?>
</span>
<div class="clear"></div>
</div>
<div class="body">
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->featuredPost->id]) ?>">
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->featuredPost->name]) ?>" alt="<?php echo $this->context->featuredPost->name ?>"/>
</a>
</div>
<div class="footer">
Featured&#32;
<?php if ($this->context->featuredPostUser): ?>
by <a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->featuredPostUser->name]) ?>"><?php echo $this->context->featuredPostUser->name ?></a>,&#32;
<?php endif ?>
<?php printf('%d day%s', $x = round((time() - $this->context->featuredPostDate) / (24 * 3600.)), $x == 1 ? '' : 's') ?> ago
<div class="clear"></div>
</div>
<span class="favs-comments">
<?php printf('%d&nbsp;fav%s', $x = $this->context->featuredPost->countOwn('favoritee'), $x == 1 ? '' : 's') ?>,&#32;
<?php printf('%d&nbsp;comment%s', $x = $this->context->featuredPost->countOwn('comment'), $x == 1 ? '' : 's') ?>
</span>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="body">
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->featuredPost->id]) ?>">
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->featuredPost->name]) ?>" alt="<?php echo $this->context->featuredPost->name ?>"/>
</a>
</div>
<div class="footer">
Featured&#32;
<?php if ($this->context->featuredPostUser): ?>
by <a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->featuredPostUser->name]) ?>"><?php echo $this->context->featuredPostUser->name ?></a>,&#32;
<?php endif ?>
<?php printf('%d day%s', $x = round((time() - $this->context->featuredPostDate) / (24 * 3600.)), $x == 1 ? '' : 's') ?> ago
<div class="clear"></div>
</div>
<div class="clear"></div>
<?php endif ?> <?php endif ?>