From e15910b63779371b6d546efd4e289658a8da9a12 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 19 Oct 2013 22:56:56 +0200 Subject: [PATCH] Closed #41 --- public_html/media/css/auth.css | 4 +-- public_html/media/css/comment-list.css | 11 +++++++ public_html/media/css/core.css | 43 +++++++++++++++++-------- public_html/media/css/index-index.css | 32 ++++++------------ public_html/media/css/post-small.css | 1 + public_html/media/css/post-view.css | 14 +++++++- public_html/media/css/user-list.css | 8 ++++- public_html/media/css/user-view.css | 3 +- public_html/media/img/bk-image.png | Bin 0 -> 1971 bytes public_html/media/img/bk-swf.png | Bin 0 -> 1265 bytes public_html/media/js/core.js | 20 ++++++++++++ src/Controllers/PostController.php | 2 +- src/Views/index-index.phtml | 2 +- src/Views/layout-normal.phtml | 1 + src/Views/post-upload.phtml | 2 +- src/Views/post-view.phtml | 18 +++++------ src/Views/user-view.phtml | 4 +-- 17 files changed, 110 insertions(+), 55 deletions(-) create mode 100644 public_html/media/img/bk-image.png create mode 100644 public_html/media/img/bk-swf.png diff --git a/public_html/media/css/auth.css b/public_html/media/css/auth.css index 4a895172..03059c56 100644 --- a/public_html/media/css/auth.css +++ b/public_html/media/css/auth.css @@ -1,10 +1,10 @@ form.auth { margin: 0 auto; - width: 400px; + max-width: 400px; } form.auth label.left { - width: 144px; + width: 35%; } form.auth p { diff --git a/public_html/media/css/comment-list.css b/public_html/media/css/comment-list.css index c03a478b..9eaee645 100644 --- a/public_html/media/css/comment-list.css +++ b/public_html/media/css/comment-list.css @@ -15,3 +15,14 @@ border-bottom: 1px solid #eee; 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; +} diff --git a/public_html/media/css/core.css b/public_html/media/css/core.css index 1db5c025..5d95a197 100644 --- a/public_html/media/css/core.css +++ b/public_html/media/css/core.css @@ -27,6 +27,7 @@ body { } #top-nav { + width: 100%; background: #eee; color: black; } @@ -109,12 +110,12 @@ body { } #top-nav li.safety a:hover { opacity: .7; } #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 .disabled { 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 .disabled { 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 .disabled { background: linear-gradient(to bottom, #a0a0a0 0%, #808080 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: #a0a0a0; background: linear-gradient(to bottom, #a0a0a0 0%, #808080 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: #a0a0a0; background: linear-gradient(to bottom, #a0a0a0 0%, #808080 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: #a0a0a0; background: linear-gradient(to bottom, #a0a0a0 0%, #808080 100%); } @@ -138,13 +139,6 @@ footer span:not(:last-child):after { width: 256px; 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 { margin-top: 0; } @@ -162,15 +156,33 @@ footer span:not(:last-child):after { #inner-content { 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; border: 1px solid #eee; border-bottom: 0; padding-bottom: 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 input, +.input-wrapper textarea, .input-wrapper select { width: 80%; + max-width: 80%; } label { @@ -275,6 +289,7 @@ button { } ul.tagit, select, +textarea, input:not([type=radio]):not([type=checkbox]):not([type=file]) { border: 1px solid #ccc; border-radius: 3px; diff --git a/public_html/media/css/index-index.css b/public_html/media/css/index-index.css index 5b633970..56e60622 100644 --- a/public_html/media/css/index-index.css +++ b/public_html/media/css/index-index.css @@ -23,60 +23,48 @@ padding: 5px; } -#featured-post { +#inner-content { float: right; width: 70%; position: relative; } -#featured-post .header .tags:before { +#inner-content .header .tags:before { margin: 0 0.5em; content: '\2013'; } -#featured-post .header ul { +#inner-content .header ul { list-style-type: none; display: inline; margin: 0; padding: 0; } -#featured-post .header li { +#inner-content .header li { display: inline; } -#featured-post .header li:not(:last-child) a:after { +#inner-content .header li:not(:last-child) a:after { content: ', '; } -#featured-post .body { +#inner-content .body { background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAJElEQVQImWNgYGBgePfu3X8YZoABFA6SIqwS+HXgtANZF7IEAJnGPJE70lLLAAAAAElFTkSuQmCC'); margin: 1em 0; text-align: center; } -#featured-post .body img { +#inner-content .body img { max-width: 100%; margin: 0 auto; display: block; } -#featured-post .body a { +#inner-content .body a { display: block; } -#featured-post .header .favs-comments { +#inner-content .header .favs-comments { margin-left: 0.5em; float: right; } -#featured-post .footer { +#inner-content .footer { text-align: right; } - -@media (max-width: 600px) { - #sidebar { - float: none; - width: 100%; - padding: 0 0 1em 0; - } - #featured-post { - float: none; - width: 100%; - } -} diff --git a/public_html/media/css/post-small.css b/public_html/media/css/post-small.css index 6b24ee4a..f14d497b 100644 --- a/public_html/media/css/post-small.css +++ b/public_html/media/css/post-small.css @@ -3,6 +3,7 @@ box-shadow: 0.25em 0.25em #eee; padding: 0; position: relative; + display: inline-block; } .post-type-flash { border-color: #dd5; diff --git a/public_html/media/css/post-view.css b/public_html/media/css/post-view.css index 78d3786c..4a871c6f 100644 --- a/public_html/media/css/post-view.css +++ b/public_html/media/css/post-view.css @@ -9,9 +9,16 @@ embed { 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 { list-style-type: none; - margin: 0 0 0 1em; + margin: 0; padding: 0; } #sidebar .tags li .count { @@ -109,3 +116,8 @@ ul.tagit { padding: 0.5em; display: none; } + +form.add-comment textarea { + width: 50em; + height: 8em; +} diff --git a/public_html/media/css/user-list.css b/public_html/media/css/user-list.css index 25158075..90ee904f 100644 --- a/public_html/media/css/user-list.css +++ b/public_html/media/css/user-list.css @@ -12,10 +12,16 @@ .user { line-height: 1.5em; margin-bottom: 1em; - width: 25em; + margin-right: 1em; display: inline-block; } +.user .details { + display: inline-block; + max-width: 25em; + white-space: pre; +} + nav.sort-styles ul { list-style-type: none; margin: 0 0 1em 0; diff --git a/public_html/media/css/user-view.css b/public_html/media/css/user-view.css index cfd07eac..d0b786fb 100644 --- a/public_html/media/css/user-view.css +++ b/public_html/media/css/user-view.css @@ -41,7 +41,7 @@ } form.edit label.left { - width: 10em; + width: 9em; } form.edit .alert { @@ -51,4 +51,5 @@ form.edit .alert { form.edit select, form.edit input { width: 16em; + max-width: 90%; } diff --git a/public_html/media/img/bk-image.png b/public_html/media/img/bk-image.png new file mode 100644 index 0000000000000000000000000000000000000000..ec308ec2f6b07f1b2560cda616a0bebac67ec8ef GIT binary patch literal 1971 zcmZ`)eLT~P9{wr%bhb06R>U0FD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9e!1{ite@?swrES7%P;%zAlCUi&IdEmvmMrjX9I zVB?E-`eq%ORr)x!zVv?S@@0$T_V#CqiFw7IKX@ogbkc%=S(4mWSG<4Y_h_lDZfpD> z)}mgm$n3J%Sqmm~sZD)yCm>vNYh>@wzIP^TyMuO1O=YgUy254luNC3GE-O}Lc>;hW-VJuCTi=%R91KZgN^`q5CCe=Ko{sw7z%%Q%|9Z9W3a6v{ z?Gqx#Gy7KP83t773fD|IwIoYzmKlq4^QtY)rm=wmA>9XMo2FL0RG%HR^3qIa)wXk5 zpPzs8o%rIllDJCK_hT799W}dNO*KE$E9zmgUhC8B=BYO)YsLO}5HaQD&4PD(CLKP} z82&2j+mvNZPN&^6#@@gnOO?^`dQDb|PX9P)d5uJz#756{A9mb+Un z-RPpW%2UK^rHiJZYSZPcYdd$|&GIS9WLUP%MAWa=WUudm?JV7Q-hV4qc_x*$Ol()& z;w^=yk6&C_IFDszOw?MV_ft-nzuSFkp@CW0?rRI@+zu3<5-+>dKC_~&W6`g?myxgP ziafr2sWA|nSf%LrLrdP``^huu>D#x4-9O~p&m)xoHd1(wW!cK5>vaWr{?b`DyuSzu>fg*EZ^2ogighxa-Zy zGs%JR+nCo!Y)m@ZC93^T{130Db=v2cXIb9BOs!ht8c~vxSdwa$T$Bo=7>o=IjdcwT zbPX*-jEt;IEUiq8wGE7{3=G!2`zeN^AvZrIGp!Q0hWncxR{=F}f^5i1OiImRC@xPs T^Xq>UP>{jX)z4*}Q$iB}sDL*9 literal 0 HcmV?d00001 diff --git a/public_html/media/js/core.js b/public_html/media/js/core.js index 2cf0a3c7..a7e4734d 100644 --- a/public_html/media/js/core.js +++ b/public_html/media/js/core.js @@ -101,4 +101,24 @@ $(function() 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'); + } }); diff --git a/src/Controllers/PostController.php b/src/Controllers/PostController.php index b6e4efe3..0bd51dd2 100644 --- a/src/Controllers/PostController.php +++ b/src/Controllers/PostController.php @@ -516,7 +516,7 @@ class PostController $this->context->stylesheets []= 'post-view.css'; $this->context->stylesheets []= 'comment-small.css'; $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 . ' – ' . join(', ', array_map(function($x) { return $x['name']; }, $post->sharedTag)); $this->context->favorite = $favorite; $this->context->transport->post = $post; $this->context->transport->prevPostId = $prevPost ? $prevPost['id'] : null; diff --git a/src/Views/index-index.phtml b/src/Views/index-index.phtml index 9cc2b1b4..ad8918e5 100644 --- a/src/Views/index-index.phtml +++ b/src/Views/index-index.phtml @@ -12,7 +12,7 @@ context->featuredPost)): ?> -
+
Featured image diff --git a/src/Views/layout-normal.phtml b/src/Views/layout-normal.phtml index 5809dcca..904fb225 100644 --- a/src/Views/layout-normal.phtml +++ b/src/Views/layout-normal.phtml @@ -13,6 +13,7 @@ context->scripts) as $name): ?> + diff --git a/src/Views/post-upload.phtml b/src/Views/post-upload.phtml index 5fc7a363..2a54b4a0 100644 --- a/src/Views/post-upload.phtml +++ b/src/Views/post-upload.phtml @@ -3,7 +3,7 @@