This commit is contained in:
Marcin Kurczewski 2013-10-19 22:56:56 +02:00
parent c6754e5866
commit e15910b637
17 changed files with 110 additions and 55 deletions

View file

@ -1,10 +1,10 @@
form.auth { form.auth {
margin: 0 auto; margin: 0 auto;
width: 400px; max-width: 400px;
} }
form.auth label.left { form.auth label.left {
width: 144px; width: 35%;
} }
form.auth p { form.auth p {

View file

@ -15,3 +15,14 @@
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
margin-bottom: 1em; margin-bottom: 1em;
} }
.small-screen .comment-group .post-wrapper {
float: none;
text-align: center;
}
.small-screen .comment-group .post {
margin: 0 auto 1em auto;
}
.small-screen .comment-group .comments {
margin-left: 0;
}

View file

@ -27,6 +27,7 @@ body {
} }
#top-nav { #top-nav {
width: 100%;
background: #eee; background: #eee;
color: black; color: black;
} }
@ -109,12 +110,12 @@ body {
} }
#top-nav li.safety a:hover { opacity: .7; } #top-nav li.safety a:hover { opacity: .7; }
#top-nav li.safety a.inactive { opacity: 1; } #top-nav li.safety a.inactive { opacity: 1; }
#top-nav li.safety .safety-safe .enabled { background: linear-gradient(to bottom, #CFE6C2 0%, #80C670 100%); } #top-nav li.safety .safety-safe .enabled { background: #cfe6c2; background: linear-gradient(to bottom, #CFE6C2 0%, #80C670 100%); }
#top-nav li.safety .safety-safe .disabled { background: linear-gradient(to bottom, #a0a0a0 0%, #808080 100%); } #top-nav li.safety .safety-safe .disabled { background: #a0a0a0; background: linear-gradient(to bottom, #a0a0a0 0%, #808080 100%); }
#top-nav li.safety .safety-sketchy .enabled { background: linear-gradient(to bottom, #F0F4C8 0%, #EBE57A 100%); } #top-nav li.safety .safety-sketchy .enabled { background: #f0f4c8; background: linear-gradient(to bottom, #F0F4C8 0%, #EBE57A 100%); }
#top-nav li.safety .safety-sketchy .disabled { background: linear-gradient(to bottom, #a0a0a0 0%, #808080 100%); } #top-nav li.safety .safety-sketchy .disabled { background: #a0a0a0; background: linear-gradient(to bottom, #a0a0a0 0%, #808080 100%); }
#top-nav li.safety .safety-unsafe .enabled { background: linear-gradient(to bottom, #FBC6B6 0%, #F37865 100%); } #top-nav li.safety .safety-unsafe .enabled { background: #fbc6b6; background: linear-gradient(to bottom, #FBC6B6 0%, #F37865 100%); }
#top-nav li.safety .safety-unsafe .disabled { background: linear-gradient(to bottom, #a0a0a0 0%, #808080 100%); } #top-nav li.safety .safety-unsafe .disabled { background: #a0a0a0; background: linear-gradient(to bottom, #a0a0a0 0%, #808080 100%); }
@ -138,13 +139,6 @@ footer span:not(:last-child):after {
width: 256px; width: 256px;
margin-right: 2em; margin-right: 2em;
} }
#sidebar .sidebar-unit {
margin: 0 0 1.5em 0;
padding: 0.75em;
border: 1px solid #eee;
padding-left: 0;
border-left: 0;
}
#sidebar h1 { #sidebar h1 {
margin-top: 0; margin-top: 0;
} }
@ -162,15 +156,33 @@ footer span:not(:last-child):after {
#inner-content { #inner-content {
overflow: hidden; overflow: hidden;
padding-bottom: 2em;
} }
.footer-unit { .small-screen #sidebar {
float: none;
width: 100%;
padding: 0 0 1em 0;
}
.small-screen #inner-content {
float: none;
width: auto;
}
.bottom-unit {
padding: 0.5em 1em; padding: 0.5em 1em;
border: 1px solid #eee; border: 1px solid #eee;
border-bottom: 0; border-bottom: 0;
padding-bottom: 0; padding-bottom: 0;
margin: 1em 0 2em 0; margin: 1em 0 2em 0;
} }
.left-unit {
margin: 0 0 1.5em 0;
padding: 0.75em;
border: 1px solid #eee;
padding-left: 0;
border-left: 0;
}
@ -259,8 +271,10 @@ form.aligned input[type=checkbox] {
} }
.input-wrapper ul.tagit, .input-wrapper ul.tagit,
.input-wrapper input, .input-wrapper input,
.input-wrapper textarea,
.input-wrapper select { .input-wrapper select {
width: 80%; width: 80%;
max-width: 80%;
} }
label { label {
@ -275,6 +289,7 @@ button {
} }
ul.tagit, ul.tagit,
select, select,
textarea,
input:not([type=radio]):not([type=checkbox]):not([type=file]) { input:not([type=radio]):not([type=checkbox]):not([type=file]) {
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 3px; border-radius: 3px;

View file

@ -23,60 +23,48 @@
padding: 5px; padding: 5px;
} }
#featured-post { #inner-content {
float: right; float: right;
width: 70%; width: 70%;
position: relative; position: relative;
} }
#featured-post .header .tags:before { #inner-content .header .tags:before {
margin: 0 0.5em; margin: 0 0.5em;
content: '\2013'; content: '\2013';
} }
#featured-post .header ul { #inner-content .header ul {
list-style-type: none; list-style-type: none;
display: inline; display: inline;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#featured-post .header li { #inner-content .header li {
display: inline; display: inline;
} }
#featured-post .header li:not(:last-child) a:after { #inner-content .header li:not(:last-child) a:after {
content: ', '; content: ', ';
} }
#featured-post .body { #inner-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;
} }
#featured-post .body img { #inner-content .body img {
max-width: 100%; max-width: 100%;
margin: 0 auto; margin: 0 auto;
display: block; display: block;
} }
#featured-post .body a { #inner-content .body a {
display: block; display: block;
} }
#featured-post .header .favs-comments { #inner-content .header .favs-comments {
margin-left: 0.5em; margin-left: 0.5em;
float: right; float: right;
} }
#featured-post .footer { #inner-content .footer {
text-align: right; text-align: right;
} }
@media (max-width: 600px) {
#sidebar {
float: none;
width: 100%;
padding: 0 0 1em 0;
}
#featured-post {
float: none;
width: 100%;
}
}

View file

@ -3,6 +3,7 @@
box-shadow: 0.25em 0.25em #eee; box-shadow: 0.25em 0.25em #eee;
padding: 0; padding: 0;
position: relative; position: relative;
display: inline-block;
} }
.post-type-flash { .post-type-flash {
border-color: #dd5; border-color: #dd5;

View file

@ -9,9 +9,16 @@ embed {
max-width: 100%; max-width: 100%;
} }
.post-type-image img {
background: url('../img/bk-image.png') lemonchiffon;
}
.post-type-flash embed {
background: url('../img/bk-swf.png') lemonchiffon;
}
#sidebar .tags ul { #sidebar .tags ul {
list-style-type: none; list-style-type: none;
margin: 0 0 0 1em; margin: 0;
padding: 0; padding: 0;
} }
#sidebar .tags li .count { #sidebar .tags li .count {
@ -109,3 +116,8 @@ ul.tagit {
padding: 0.5em; padding: 0.5em;
display: none; display: none;
} }
form.add-comment textarea {
width: 50em;
height: 8em;
}

View file

@ -12,10 +12,16 @@
.user { .user {
line-height: 1.5em; line-height: 1.5em;
margin-bottom: 1em; margin-bottom: 1em;
width: 25em; margin-right: 1em;
display: inline-block; display: inline-block;
} }
.user .details {
display: inline-block;
max-width: 25em;
white-space: pre;
}
nav.sort-styles ul { nav.sort-styles ul {
list-style-type: none; list-style-type: none;
margin: 0 0 1em 0; margin: 0 0 1em 0;

View file

@ -41,7 +41,7 @@
} }
form.edit label.left { form.edit label.left {
width: 10em; width: 9em;
} }
form.edit .alert { form.edit .alert {
@ -51,4 +51,5 @@ form.edit .alert {
form.edit select, form.edit select,
form.edit input { form.edit input {
width: 16em; width: 16em;
max-width: 90%;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -101,4 +101,24 @@ $(function()
form.append(input); form.append(input);
}); });
}); });
$(window).resize();
});
$(window).resize(function()
{
//modify DOM on small viewports
$('#inner-content .unit').addClass('bottom-unit');
if ($('body').width() < 600)
{
$('body').addClass('small-screen');
$('#sidebar').insertAfter($('#inner-content'));
$('#sidebar .unit').removeClass('left-unit').addClass('bottom-unit');
}
else
{
$('body').removeClass('small-screen');
$('#inner-content').insertAfter($('#sidebar'));
$('#sidebar .unit').removeClass('bottom-unit').addClass('left-unit');
}
}); });

View file

@ -516,7 +516,7 @@ class PostController
$this->context->stylesheets []= 'post-view.css'; $this->context->stylesheets []= 'post-view.css';
$this->context->stylesheets []= 'comment-small.css'; $this->context->stylesheets []= 'comment-small.css';
$this->context->scripts []= 'post-view.js'; $this->context->scripts []= 'post-view.js';
$this->context->subTitle = 'showing @' . $post->id . ' - ' . join(', ', array_map(function($x) { return $x['name']; }, $post->sharedTag)); $this->context->subTitle = 'showing @' . $post->id . ' &ndash; ' . join(', ', array_map(function($x) { return $x['name']; }, $post->sharedTag));
$this->context->favorite = $favorite; $this->context->favorite = $favorite;
$this->context->transport->post = $post; $this->context->transport->post = $post;
$this->context->transport->prevPostId = $prevPost ? $prevPost['id'] : null; $this->context->transport->prevPostId = $prevPost ? $prevPost['id'] : null;

View file

@ -12,7 +12,7 @@
</div> </div>
<?php if (!empty($this->context->featuredPost)): ?> <?php if (!empty($this->context->featuredPost)): ?>
<div id="featured-post"> <div id="inner-content">
<div class="header"> <div class="header">
Featured image Featured image

View file

@ -13,6 +13,7 @@
<?php foreach (array_unique($this->context->scripts) as $name): ?> <?php foreach (array_unique($this->context->scripts) as $name): ?>
<script type="text/javascript" src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/js/' . $name) ?>"></script> <script type="text/javascript" src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/js/' . $name) ?>"></script>
<?php endforeach ?> <?php endforeach ?>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
</head> </head>
<body> <body>

View file

@ -3,7 +3,7 @@
<?php else: ?> <?php else: ?>
<div id="sidebar"> <div id="sidebar">
<div class="sidebar-unit"> <div class="unit">
<h1>file upload</h1> <h1>file upload</h1>
<p>Use tags to describe uploaded images. Try to specify characters, their look and shows they are from.</p> <p>Use tags to describe uploaded images. Try to specify characters, their look and shows they are from.</p>
<p>Set proper visibility setting if the image isn&rsquo;t safe for work or you&rsquo;re not sure it&rsquo;s 100% <span class="safety-sfw">safe</span>.</p> <p>Set proper visibility setting if the image isn&rsquo;t safe for work or you&rsquo;re not sure it&rsquo;s 100% <span class="safety-sfw">safe</span>.</p>

View file

@ -25,7 +25,7 @@
<div class="clear"></div> <div class="clear"></div>
</nav> </nav>
<div class="sidebar-unit tags"> <div class="unit tags">
<h1>tags (<?php echo count($this->context->transport->post->sharedTag) ?>)</h1> <h1>tags (<?php echo count($this->context->transport->post->sharedTag) ?>)</h1>
<ul> <ul>
<?php foreach ($this->context->transport->post->sharedTag as $tag): ?> <?php foreach ($this->context->transport->post->sharedTag as $tag): ?>
@ -41,7 +41,7 @@
</ul> </ul>
</div> </div>
<div class="sidebar-unit details"> <div class="unit details">
<h1>details</h1> <h1>details</h1>
<div class="key-value safety"> <div class="key-value safety">
@ -104,7 +104,7 @@
</div> </div>
</div> </div>
<div class="sidebar-unit favorites"> <div class="unit favorites">
<?php if (count($this->context->transport->post->ownFavoritee) == 0): ?> <?php if (count($this->context->transport->post->ownFavoritee) == 0): ?>
<h1>favorites</h1> <h1>favorites</h1>
<p>None yet.</p> <p>None yet.</p>
@ -122,7 +122,7 @@
<?php endif ?> <?php endif ?>
</div> </div>
<div class="sidebar-unit options"> <div class="unit options">
<h1>options</h1> <h1>options</h1>
<ul> <ul>
@ -207,7 +207,7 @@
</div> </div>
<div id="inner-content"> <div id="inner-content">
<div class="post-wrapper"> <div class="post-wrapper post-type-<?php echo strtolower(PostType::toString($this->context->transport->post->type)) ?>">
<?php if ($this->context->transport->post->type == PostType::Image): ?> <?php if ($this->context->transport->post->type == PostType::Image): ?>
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>" alt="<?php echo $this->context->transport->post->name ?>"/> <img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>" alt="<?php echo $this->context->transport->post->name ?>"/>
<?php elseif ($this->context->transport->post->type == PostType::Flash): ?> <?php elseif ($this->context->transport->post->type == PostType::Flash): ?>
@ -216,7 +216,7 @@
</div> </div>
<?php if ($canEditAnything): ?> <?php if ($canEditAnything): ?>
<form action="<?php echo \Chibi\UrlHelper::route('post', 'edit', ['id' => $this->context->transport->post->id]) ?>" method="post" enctype="multipart/form-data" class="edit-post aligned footer-unit"> <form action="<?php echo \Chibi\UrlHelper::route('post', 'edit', ['id' => $this->context->transport->post->id]) ?>" method="post" enctype="multipart/form-data" class="edit-post aligned unit">
<h1>edit post</h1> <h1>edit post</h1>
<?php if ($editPostPrivileges[Privilege::EditPostSafety]): ?> <?php if ($editPostPrivileges[Privilege::EditPostSafety]): ?>
<div class="safety"> <div class="safety">
@ -259,7 +259,7 @@
</form> </form>
<?php endif ?> <?php endif ?>
<div class="comments footer-unit"> <div class="comments unit">
<?php if (empty($this->context->transport->post->ownComment)): ?> <?php if (empty($this->context->transport->post->ownComment)): ?>
<h1>comments</h1> <h1>comments</h1>
None yet. None yet.
@ -275,13 +275,13 @@
</div> </div>
<?php if (PrivilegesHelper::confirm(Privilege::AddComment)): ?> <?php if (PrivilegesHelper::confirm(Privilege::AddComment)): ?>
<form action="<?php echo \Chibi\UrlHelper::route('comment', 'add', ['postId' => $this->context->transport->post->id]) ?>" method="post" class="add-comment aligned footer-unit"> <form action="<?php echo \Chibi\UrlHelper::route('comment', 'add', ['postId' => $this->context->transport->post->id]) ?>" method="post" class="add-comment aligned unit">
<h1>add comment</h1> <h1>add comment</h1>
<div class="preview"></div> <div class="preview"></div>
<div class="text"> <div class="text">
<textarea name="text" cols="50" rows="3"></textarea> <div class="input-wrapper"><textarea name="text" cols="50" rows="3"></textarea></div>
</div> </div>
<div> <div>

View file

@ -6,7 +6,7 @@
<h1><?php echo $this->context->transport->user->name ?></h1> <h1><?php echo $this->context->transport->user->name ?></h1>
</div> </div>
<div class="sidebar-unit details"> <div class="unit details">
<h1>details</h1> <h1>details</h1>
<div class="key-value join-date"> <div class="key-value join-date">
@ -28,7 +28,7 @@
<?php endif ?> <?php endif ?>
</div> </div>
<div class="sidebar-unit options"> <div class="unit options">
<h1>options</h1> <h1>options</h1>
<ul> <ul>