tweak css for responsive
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
div#page {
|
div#page {
|
||||||
padding: 0 2px;
|
padding: 0 0.25vw;
|
||||||
> div /* div#c-$controller */ {
|
> div /* div#c-$controller */ {
|
||||||
> div /* div#a-$action */ {
|
> div /* div#a-$action */ {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -89,17 +89,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
article.post-preview {
|
article.post-preview {
|
||||||
margin: 0 0 10px 0;
|
margin: 0 0 0.5vw 0;
|
||||||
width: 48vw;
|
width: 49.5vw;
|
||||||
|
height: 48.5vw;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
border: none;
|
||||||
a {
|
a {
|
||||||
width: 48vw;
|
width: 49vw;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
img {
|
img {
|
||||||
|
object-fit: contain;
|
||||||
|
width: 48.5vw;
|
||||||
|
height: 48.5vw;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,10 +107,11 @@ namespace :images do
|
|||||||
|
|
||||||
desc "Generate thumbnail-sized images of posts"
|
desc "Generate thumbnail-sized images of posts"
|
||||||
task :generate_preview => :environment do
|
task :generate_preview => :environment do
|
||||||
Post.where("image_width > ?", Danbooru.config.small_image_width).find_each do |post|
|
width = 200
|
||||||
if post.is_image? && !File.exists?(post.preview_file_path)
|
Post.where("image_width > ?", width).find_each do |post|
|
||||||
|
if post.is_image? #&& !File.exists?(post.preview_file_path)
|
||||||
puts "resizing preview #{post.id}"
|
puts "resizing preview #{post.id}"
|
||||||
Danbooru.resize(post.file_path, post.preview_file_path, Danbooru.config.small_image_width, Danbooru.config.small_image_width, 90)
|
Danbooru.resize(post.file_path, post.preview_file_path, width, width, 90)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user