From 877e02087739e446cb000b619ac0a12d171d04ab Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 15 Jan 2025 15:39:09 -0500 Subject: Created mobile layout for blog --- app/assets/javascripts/main/comments.coffee | 1 - app/assets/stylesheets/main/entries.scss | 13 ++++++-- app/assets/stylesheets/main/layout.scss | 48 ++++++++++++++++++----------- app/views/layouts/application.html.haml | 7 +++-- 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/app/assets/javascripts/main/comments.coffee b/app/assets/javascripts/main/comments.coffee index d33e200..08aa794 100644 --- a/app/assets/javascripts/main/comments.coffee +++ b/app/assets/javascripts/main/comments.coffee @@ -10,5 +10,4 @@ comments_ready = -> $("#comment-reply-msg").hide() return false -$(document).ready(comments_ready) $(document).on('turbolinks:load', comments_ready) diff --git a/app/assets/stylesheets/main/entries.scss b/app/assets/stylesheets/main/entries.scss index 609a5f7..4afd15d 100644 --- a/app/assets/stylesheets/main/entries.scss +++ b/app/assets/stylesheets/main/entries.scss @@ -3,9 +3,9 @@ // You can use Sass (SCSS) here: http://sass-lang.com/ .blog-post { - font-size: 16px; - line-height: 24px; + line-height: 1.5em; margin: 0 1em 1em; + clear: both; .blog-title { flex-grow: 1; @@ -41,6 +41,7 @@ .post-calendar { width: 45px; height: 49px; + flex-shrink: 0; &.post-date-1 { background: image-url("date-bg-1.gif") no-repeat; @@ -198,6 +199,10 @@ max-width: 100%; } + iframe { + max-width: 100%; + } + figure { background-color: #eee; border: 1px solid #bbb; @@ -205,6 +210,10 @@ font-size: 0.75em; line-height: 24px; + @media only screen and (max-width: 767px) { + margin: 0; + } + img { display: block; border: 1px solid #bbb; diff --git a/app/assets/stylesheets/main/layout.scss b/app/assets/stylesheets/main/layout.scss index 6d79c73..ef31ada 100644 --- a/app/assets/stylesheets/main/layout.scss +++ b/app/assets/stylesheets/main/layout.scss @@ -1,42 +1,47 @@ body#main-body { height: 100%; font-family: sans-serif; + font-size: 16px; } #container { height: 100%; - margin: 10px auto; - width: 75%; /* 66% */ box-sizing: border-box; - min-width: 910px; + + @media only screen and (min-width: 768px) { + margin: 10px auto; + width: 75%; /* 66% */ + min-width: 910px; + } } #banner { - background-image: image-url("fourisland_header.png"); - width: 900px; - height: 200px; margin: 0 auto; h1 { - margin: 0; + display: none; + } - a { - display: block; - width: 900px; - height: 200px; - text-indent: -5000px; - text-decoration: none; - margin: 0; - } + img { + width: 100%; + max-width: 900px; + display: block; + margin: 0 auto; } } #page-body { display: flex; + + @media only screen and (max-width: 767px) { + flex-direction: column-reverse; + } } #main { - width: 70%; + @media only screen and (min-width: 768px) { + width: 70%; + } } #content { @@ -62,15 +67,22 @@ body#main-body { #sidebar { box-sizing: border-box; - width: 30%; font-size: .75em; color: black; margin-top: 1em; margin-bottom: 2em; font-family: sans-serif; + + @media only screen and (max-width: 767px) { + width: 100%; + } + + @media only screen and (min-width: 768px) { + width: 30%; + } } -#sidebar h2 { +#sidebar h2, #mobile-header h2 { font-size: 1em; } diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 90ea5e2..98b4ef4 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -9,15 +9,16 @@ %link{rel: "me", href: "mailto:fefferburbia+thoughts@gmail.com"} %link{rel: "webmention", href: webmentions_url} %link{rel: "alternate", type: "application/atom+xml", href: blogs_url(format: :atom)} + %meta{name: "viewport", content: "width=device-width, initial-scale=1.0"} %body#main-body - if flash[:alert] %div#flash.flash-alert= flash[:alert] - if flash[:notice] %div#flash.flash-notice= flash[:notice] #container - #page-header - %header#banner - %h1= link_to "Four Island", root_url + %header#banner + %h1 Four Island + = link_to image_tag("fourisland_header.png"), root_url #page-body #sidebar .sidebar-module -- cgit 1.4.1