From 137296f4de92506688bdbe91d5b18bc8f0834664 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Wed, 6 Sep 2017 18:36:39 -0700 Subject: [PATCH] tweak responsive css --- app/assets/stylesheets/specific/posts.scss | 4 ++ .../stylesheets/specific/z_responsive.scss | 44 ++++++++++++------- app/helpers/pagination_helper.rb | 19 +++++--- 3 files changed, 47 insertions(+), 20 deletions(-) diff --git a/app/assets/stylesheets/specific/posts.scss b/app/assets/stylesheets/specific/posts.scss index 197d1b8ea..a5b6ddf54 100644 --- a/app/assets/stylesheets/specific/posts.scss +++ b/app/assets/stylesheets/specific/posts.scss @@ -238,6 +238,10 @@ div#c-posts { } } + .outer-recent-searches { + overflow: hidden; + } + div.notice { font-size: 0.8em; padding: 0.5em; diff --git a/app/assets/stylesheets/specific/z_responsive.scss b/app/assets/stylesheets/specific/z_responsive.scss index 318883348..3b5cf00e0 100644 --- a/app/assets/stylesheets/specific/z_responsive.scss +++ b/app/assets/stylesheets/specific/z_responsive.scss @@ -70,42 +70,56 @@ } div.paginator { - font-size: 16pt; + font-size: 20pt; font-weight: bold; text-align: left; - padding: 3pt; + width: 100%; + padding: 0; + margin: 0; + margin-top: 1em; li { - display: inline; - line-height: 1.4em; + width: 30vw; + display: inline-block; a, span { - padding: 3px 18px; - margin: 6px 3px; - display: inline-block; - border-radius: 15%; + margin: 0; + padding: 0; + border: none; + } + + &.current-page { + text-align: center; + } + + &.arrow:last-child { + text-align: right; + } + + &.numbered-page { + display: none; } } } article.post-preview { - margin: 0 0 0.5vw 0; - width: 49.5vw; - height: 48.5vw; + margin: 0.5vw; + width: 32vw; + height: 32vw; text-align: center; vertical-align: middle; display: inline-block; + a { - width: 49vw; + width: 32vw; display: block; margin: 0 auto; } img { object-fit: contain; - width: 48.5vw; - height: 48.5vw; + width: 32vw; + height: 32vw; margin: 0 auto; - border: none; } img.cropped-true { object-fit: cover; diff --git a/app/helpers/pagination_helper.rb b/app/helpers/pagination_helper.rb index d542da8a1..ed5ef1c72 100644 --- a/app/helpers/pagination_helper.rb +++ b/app/helpers/pagination_helper.rb @@ -29,7 +29,9 @@ module PaginationHelper window = 4 if records.current_page >= 2 - html << "
  • " + link_to("<<", params.merge(:page => records.current_page - 1), :rel => "prev") + "
  • " + html << "
  • " + link_to("<<", params.merge(:page => records.current_page - 1), :rel => "prev") + "
  • " + else + html << "
  • " + "<<" + "
  • " end if records.total_pages <= (window * 2) + 5 @@ -67,7 +69,9 @@ module PaginationHelper end if records.current_page < records.total_pages && records.size > 0 - html << "
  • " + link_to(">>", params.merge(:page => records.current_page + 1), :rel => "next") + "
  • " + html << "
  • " + link_to(">>", params.merge(:page => records.current_page + 1), :rel => "next") + "
  • " + else + html << "
  • " + ">>" + "
  • " end html << "" @@ -85,15 +89,20 @@ module PaginationHelper def numbered_paginator_item(page, current_page) return "" if page.to_i > Danbooru.config.max_numbered_pages - html = "
  • " + html = [] if page == "..." + html << "
  • " html << "..." + html << "
  • " elsif page == current_page + html << "
  • " html << '' + page.to_s + '' + html << "
  • " else + html << "
  • " html << link_to(page, params.merge(:page => page)) + html << "
  • " end - html << "" - html.html_safe + html.join.html_safe end end