feat: enhance layout responsiveness and style
- Update footer layout to improve styling and center alignment - Change header theme control from 'synthwave' to 'light' - Enhance home page layout with hero and background styles - Refactor user sign-up form with better styling and structure - Add copyright notice and responsive design to the footer These changes focus on enhancing the overall user experience with a more modern layout and improved responsiveness across devices. The footer now includes copyright information and a cleaner design, while the sign-up form has additional styling to improve usability.
This commit is contained in:
parent
99c5e8afe9
commit
42d8d5ce1d
@ -1,50 +1,10 @@
|
||||
<footer class="mt-12 pt-5 border-t border-gray-200 text-gray-600">
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="flex flex-col md:flex-row md:justify-between items-center">
|
||||
<!-- 左侧文本 -->
|
||||
<small class="text-sm mb-4 md:mb-0">
|
||||
The
|
||||
<a href="https://www.railstutorial.org"
|
||||
class="text-gray-600 hover:text-gray-900">
|
||||
Ruby on Rails Tutorial
|
||||
</a>
|
||||
by
|
||||
<a href="https://www.michaelhartl.com"
|
||||
class="text-gray-600 hover:text-gray-900">
|
||||
Michael Hartl
|
||||
</a>
|
||||
</small>
|
||||
|
||||
<!-- 右侧导航 -->
|
||||
<nav>
|
||||
<ul class="flex flex-wrap justify-center space-x-4">
|
||||
<li>
|
||||
<%= link_to "About", about_url,
|
||||
class: "text-gray-600 hover:text-gray-900" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Contact", contact_url,
|
||||
class: "text-gray-600 hover:text-gray-900" %>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://news.railstutorial.org"
|
||||
class="text-gray-600 hover:text-gray-900">
|
||||
News
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<footer class="footer bg-neutral text-neutral-content p-10">
|
||||
<small>
|
||||
The <a href="https://www.railstutorial.org">Ruby on Rails Tutorial</a>
|
||||
by <a href="https://www.michaelhartl.com">Michael Hartl</a>
|
||||
</small>
|
||||
<nav>
|
||||
<footer class="footer footer-center bg-base-200 text-base-content rounded p-10">
|
||||
<nav class="grid grid-flow-col gap-4">
|
||||
<%= link_to "About", about_url, class: "link link-hover" %>
|
||||
<%= link_to "Contact", contact_url, class: "link link-hover" %>
|
||||
<a href="https://news.railstutorial.org" class="link link-hover" >News</a>
|
||||
<a href="https://news.railstutorial.org" class="text-gray-600 hover:text-gray-900">News</a>
|
||||
</nav>
|
||||
<aside>
|
||||
<p>Copyright © <%= Date.current.year %> - All right reserved by ACME Industries Ltd</p>
|
||||
</aside>
|
||||
</footer>
|
@ -69,7 +69,7 @@
|
||||
</details>
|
||||
<label class="swap swap-rotate">
|
||||
<!-- this hidden checkbox controls the state -->
|
||||
<input type="checkbox" class="theme-controller" value="synthwave" />
|
||||
<input type="checkbox" class="theme-controller" value="light" />
|
||||
|
||||
<!-- sun icon -->
|
||||
<svg
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
<body>
|
||||
<%= render 'layouts/header' %>
|
||||
<div class="container pt-16">
|
||||
<div class="">
|
||||
<% flash.each do |message_type, message| %>
|
||||
<%= content_tag(:div, message, class: "alert alert-#{message_type}") %>
|
||||
<!-- <div class="alert alert-<%#= message_type %>"><%#= message %></div>-->
|
||||
|
@ -1,16 +1,20 @@
|
||||
<% provide(:title, "Home") %>
|
||||
<div class="center jumbotron">
|
||||
<h1>Welcome to the Sample App</h1>
|
||||
<h2>
|
||||
<div class="hero bg-base-200 min-h-screen">
|
||||
<div class="hero-content text-center">
|
||||
<div class="max-w-md">
|
||||
<h1 class="text-5xl font-bold">Welcome to the Sample App</h1>
|
||||
<p class="py-6">
|
||||
This is the home page for the
|
||||
<a href="https://www.railstutorial.org">Ruby on Rails Tutorial</a>
|
||||
Sample application.
|
||||
</h2>
|
||||
|
||||
</p>
|
||||
<%= link_to "Sing up now!", signup_path, class:"btn btn-lg btn-primary" %>
|
||||
</div>
|
||||
<%= link_to image_tag("rails.svg", alt:"Rails logo", width: "200"),
|
||||
"https://rubyonrails.org/" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%#= link_to image_tag("kitten.jpg", alt:"Kitten", width:"200") %>
|
||||
|
||||
|
||||
|
@ -1,18 +1,36 @@
|
||||
|
||||
<%= form_with(model: @user, local: true) do |f| %>
|
||||
<%= form_with(model: @user, local: true, class: "space-y-4") do |f| %>
|
||||
<%= render 'shared/error_messages' %>
|
||||
|
||||
<%= f.label :name %>
|
||||
<%= f.text_field :name, class: 'form-control' %>
|
||||
|
||||
<%= f.label :email %>
|
||||
<%= f.email_field :email, class: 'form-control' %>
|
||||
|
||||
<%= f.label :password %>
|
||||
<%= f.password_field :password, class: 'form-control' %>
|
||||
|
||||
<%= f.label :password_confirmation, "Confirmation" %>
|
||||
<%= f.password_field :password_confirmation, class: 'form-control' %>
|
||||
|
||||
<%= f.submit yield(:button_text), class: "btn btn-primary" %>
|
||||
<div class="form-control">
|
||||
<%= f.label :name, class: "label" do %>
|
||||
<span class="label-text">Name</span>
|
||||
<% end %>
|
||||
<%= f.text_field :name, class: "input input-bordered w-full" %>
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<%= f.label :email, class: "label" do %>
|
||||
<span class="label-text">Email</span>
|
||||
<% end %>
|
||||
<%= f.email_field :email, class: "input input-bordered w-full" %>
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<%= f.label :password, class: "label" do %>
|
||||
<span class="label-text">Password</span>
|
||||
<% end %>
|
||||
<%= f.password_field :password, class: "input input-bordered w-full" %>
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
<%= f.label :password_confirmation, class: "label" do %>
|
||||
<span class="label-text">Confirmation</span>
|
||||
<% end %>
|
||||
<%= f.password_field :password_confirmation, class: "input input-bordered w-full" %>
|
||||
</div>
|
||||
|
||||
<div class="form-control mt-6">
|
||||
<%= f.submit yield(:button_text), class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
@ -1,9 +1,9 @@
|
||||
<% provide(:title, 'Sign up') %>
|
||||
<% provide(:button_text, 'Create my account') %>
|
||||
<h1>Sign up</h1>
|
||||
<div class="container mx-auto px-4">
|
||||
<h1 class="text-3xl font-bold text-center my-8">Sign up</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="max-w-md mx-auto">
|
||||
<%= render 'form' %>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user