Skip to content

Commit

Permalink
feat: Pricing Page and Footer
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarMWarraich committed Aug 26, 2024
1 parent 0684eac commit 0a142da
Show file tree
Hide file tree
Showing 7 changed files with 407 additions and 39 deletions.
9 changes: 5 additions & 4 deletions app/controllers/subscriptions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
class SubscriptionsController < ApplicationController
before_action :authenticate_user!
# before_action :authenticate_user!
def index
if current_user.subscriptions.active.any?
redirect_to account_manager_url and return
end
# if current_user.subscriptions.active.any?
# redirect_to account_manager_url and return
# end

end

def success
Expand Down
41 changes: 41 additions & 0 deletions app/javascript/controllers/clock_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Controller } from "@hotwired/stimulus";

// Connects to data-controller="clock"
export default class extends Controller {
static targets = ["central", "sydney", "islamabad"];

connect() {
this.updateTimes();
this.timer = setInterval(() => this.updateTimes(), 1000);
}

disconnect() {
clearInterval(this.timer);
}

updateTimes() {
// Define time zones
const centralTimeOptions = { timeZone: "America/Chicago", hour12: true };
const sydneyTimeOptions = { timeZone: "Australia/Sydney", hour12: true };
const islamabadTimeOptions = { timeZone: "Asia/Karachi", hour12: true };

// Get current times
const centralTime = new Date().toLocaleTimeString(
"en-US",
centralTimeOptions
);
const sydneyTime = new Date().toLocaleTimeString(
"en-US",
sydneyTimeOptions
);
const islamabadTime = new Date().toLocaleTimeString(
"en-US",
islamabadTimeOptions
);

// Update the HTML elements with the current times
this.centralTarget.innerText = `${centralTime}`;
this.sydneyTarget.innerText = `${sydneyTime}`;
this.islamabadTarget.innerText = `${islamabadTime}`;
}
}
116 changes: 116 additions & 0 deletions app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<!-- Footer -->
<footer class="text-center text-lg-start bg-body-tertiary text-muted">
<!-- Section: Social media -->
<section class="d-flex justify-content-center justify-content-lg-between p-4 border-bottom">
<!-- Left -->
<div class="me-5 d-none d-lg-block">
<span>Get connected with us on social networks:</span>
</div>
<!-- Left -->
<!-- Right -->
<div>
<a href="" class="me-4 text-reset">
<i class="fab fa-facebook-f"></i>
</a>
<a href="" class="me-4 text-reset">
<i class="fab fa-twitter"></i>
</a>
<a href="" class="me-4 text-reset">
<i class="fab fa-google"></i>
</a>
<a href="" class="me-4 text-reset">
<i class="fab fa-instagram"></i>
</a>
<a href="" class="me-4 text-reset">
<i class="fab fa-linkedin"></i>
</a>
<a href="" class="me-4 text-reset">
<i class="fab fa-github"></i>
</a>
</div>
<!-- Right -->
</section>
<!-- Section: Social media -->
<!-- Section: Links -->
<section class="d-none d-lg-block">
<div class="container text-center text-md-start mt-5">
<!-- Grid row -->
<div class="row mt-3">
<!-- Grid column -->
<div class="col-md-3 col-lg-4 col-xl-3 mx-auto mb-4">
<!-- Content -->
<h6 class="text-uppercase fw-bold mb-4">
<i class="fas fa-gem me-3"></i>Company name
</h6>
<p>
Here you can use rows and columns to organize your footer content. Lorem ipsum
dolor sit amet, consectetur adipisicing elit.
</p>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-2 col-lg-2 col-xl-2 mx-auto mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">
Products
</h6>
<p>
<a href="#!" class="text-reset">Angular</a>
</p>
<p>
<a href="#!" class="text-reset">React</a>
</p>
<p>
<a href="#!" class="text-reset">Vue</a>
</p>
<p>
<a href="#!" class="text-reset">Laravel</a>
</p>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-3 col-lg-2 col-xl-2 mx-auto mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">
Useful links
</h6>
<p>
<a href="#!" class="text-reset">Pricing</a>
</p>
<p>
<a href="#!" class="text-reset">Settings</a>
</p>
<p>
<a href="#!" class="text-reset">Orders</a>
</p>
<p>
<a href="#!" class="text-reset">Help</a>
</p>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-4 col-lg-3 col-xl-3 mx-auto mb-md-0 mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">Contact</h6>
<p><i class="fas fa-home me-3"></i> New York, NY 10012, US</p>
<p>
<i class="fas fa-envelope me-3"></i>
[email protected]
</p>
<p><i class="fas fa-phone me-3"></i> + 01 234 567 88</p>
<p><i class="fas fa-print me-3"></i> + 01 234 567 89</p>
</div>
<!-- Grid column -->
</div>
<!-- Grid row -->
</div>
</section>
<!-- Section: Links -->
<!-- Copyright -->
<div class="text-center p-4" style="background-color: rgba(0, 0, 0, 0.05);">
© 2021 Copyright:
<a class="text-reset fw-bold" href="https://mdbootstrap.com/">MDBootstrap.com</a>
</div>
<!-- Copyright -->
</footer>
<!-- Footer -->
43 changes: 21 additions & 22 deletions app/views/layouts/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<nav class="navbar navbar-expand-lg navbar-dark" style="background-color:var(--bs-body-color)">
<div class="container-fluid my-2 justify-content-lg-between">
<a class="navbar-brand col-3 mb-2 mb-lg-0" href="/">ArtSmith</a>
<a class="navbar-brand col-3 mb-2 mb-lg-0 fs-2 ms-3" href="/">ArtSmith</a>
<button class="navbar-toggler mb-2 mb-lg-0" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto w-30 justify-content-between">
<!-- Apply mb-2 to each li element for vertical spacing in collapsed view -->
<li class="nav-item mx-4 rounded-3 mb-4 mb-lg-0 w-25 text-center mx-auto mx-lg-5" style="background-color: var(--bs-success);">
<a class="nav-link active" aria-current="page" href="/">Home</a>
<ul class="navbar-nav me-auto w-30 justify-content-between ">
<li class="nav-item mx-4 rounded-4 mb-4 mb-lg-0 w-25 text-center mx-auto mx-lg-4 border border-dark-subtle border-3" style="background-color: var(--bs-success);">
<a class="nav-link active fs-3 px-2 py-2 fw-bold" aria-current="page" href="/">Home</a>
</li>
<li class="nav-item mx-4 rounded-3 mb-4 mb-lg-0 w-25 text-center mx-auto mx-lg-5" style="background-color: var(--bs-success);">
<li class="nav-item mx-4 mb-4 mb-lg-0 w-25 rounded-4 text-center mx-auto mx-lg-4 border border-dark-subtle border-3" style="background-color: var(--bs-success);">
<div data-controller="dropdown">
<a class="nav-link dropdown-toggle rounded-3" href="#" role="button" style="background-color: var(--bs-success);"
<a class="nav-link dropdown-toggle fs-3 px-2 rounded-4 py-2 pe-5 me-5 fw-bold" href="#" role="button" style="background-color: var(--bs-success);"
data-action="mouseenter->dropdown#showMenu mouseleave->dropdown#hideMenu"
data-bs-toggle="dropdown" aria-expanded="false"
data-dropdown-target="toggle">
Features
</a>
<ul class="dropdown-menu dropdown-menu-end mb-4 mb-lg-0 text-center mx-auto mx-lg-5" data-dropdown-target="menu"
<ul class="dropdown-menu dropdown-menu-end mb-4 mb-lg-0 text-center mx-auto bg-success" data-dropdown-target="menu"
data-action="mouseleave->dropdown#hideMenu" style="position: absolute; left: 0; width: 100vw;">
<% @features = [
{
Expand Down Expand Up @@ -50,10 +49,10 @@
<div class="row justify-content-center">
<div class="col-12 d-flex flex-wrap justify-content-center gap-4">
<% @features.each do |i| %>
<div class="card text-white bg-primary" style="min-width: 18rem; flex: 1 1 18rem;">
<div class="card-header"><%= i[:name] %></div>
<div class="card text-white bg-dark" style="min-width: 18rem; flex: 1 1 18rem;">
<div class="card-header fs-3"><%= i[:name] %></div>
<div class="card-body">
<p class="card-text"><%= i[:description] %></p>
<p class="card-text fs-4"><%= i[:description] %></p>
</div>
</div>
<% end %>
Expand All @@ -63,33 +62,33 @@
</ul>
</div>
</li>
<li class="nav-item rounded-3 mb-4 mb-lg-0 w-25 text-center mx-auto mx-lg-5" style="background-color: var(--bs-success);">
<a class="nav-link" href="/pricing">Pricing</a>
<li class="nav-item rounded-4 mb-4 mb-lg-0 w-25 text-center mx-auto mx-lg-4 border border-dark-subtle border-3 hover-text-dark focus-bg-warning" style="background-color: var(--bs-success);">
<a class="nav-link px-2 py-1 fs-3 fw-bold hover-text-dark focus-bg-warning" href="/pricing">Pricing</a>
</li>
</ul>
<form class="d-flex mb-4 mb-lg-0 w-50 text-center mx-auto mx-lg-5" role="search">
<input class="form-control me-2 text-center" type="search" placeholder="Search" aria-label="Search">
<form class="d-flex mb-4 mb-lg-0 w-50 px-2 py-2 fw-bold text-center mx-auto mx-lg-4" role="search">
<input class="form-control me-2 text-center fs-3" type="search" placeholder="Search" aria-label="Search">
</form>
<ul class="navbar-nav mb-4 mb-lg-0 w-25 text-center mx-auto mx-lg-5">
<li class="nav-item dropdown">
<ul class="navbar-nav mb-4 mb-lg-0 w-25 text-center mx-auto mx-lg-4">
<li class="nav-item dropdown rounded-4 px-2 py-2 fw-bold">
<% if user_signed_in? %>
<a class="nav-link dropdown-toggle rounded-3" href="/account" role="button" data-bs-toggle="dropdown" aria-expanded="false" style="background-color: var(--bs-success);">
<a class="nav-link dropdown-toggle rounded-4 fs-3 border border-dark-subtle border-3" href="/account" role="button" data-bs-toggle="dropdown" aria-expanded="false" style="background-color: var(--bs-success);">
<%= current_user.email.gsub(/@.*/, '') %>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<%= link_to 'Edit Password', edit_password_change_path, class: 'dropdown-item' %>
<%= link_to 'Edit Password', edit_password_change_path, class: 'dropdown-item fs-3' %>
<li><hr class="dropdown-divider"></li>
<%= link_to 'Log out', session_path, class: 'dropdown-item', data: { turbo_method: :delete } %>
<%= link_to 'Log out', session_path, class: 'dropdown-item fs-3', data: { turbo_method: :delete } %>
</ul>
<% else %>
<div data-controller="dropdown">
<a class="nav-link dropdown-toggle rounded-3" href="#" role="button" style="background-color: var(--bs-success);"
<a class="nav-link dropdown-toggle rounded-4 -px-5 py-2 fw-bold fs-3 border border-dark-subtle border-3" href="#" role="button" style="background-color: var(--bs-success);"
data-action="mouseenter->dropdown#showMenu mouseleave->dropdown#hideMenu"
data-bs-toggle="dropdown" aria-expanded="false"
data-dropdown-target="toggle">
Get Started
</a>
<ul class="dropdown-menu dropdown-menu-md-end" data-dropdown-target="menu"
<ul class="dropdown-menu dropdown-menu-md-end w-100 bg-success" data-dropdown-target="menu"
data-action="mouseleave->dropdown#hideMenu">
<%= link_to 'Log In', new_session_path, class: 'dropdown-item' %>
<li><hr class="dropdown-divider"></li>
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<div class="alert alert-danger"><%= alert %></div>
<% end %>
<%= yield %>
<%= render "layouts/footer" %>
<script src="https://kit.fontawesome.com/90fa2dbe9e.js" crossorigin="anonymous"></script>
</body>
</html>
Loading

0 comments on commit 0a142da

Please sign in to comment.