Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR - fix : razorpay form in mobile view of header and addition of go to top button #135

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .gitpod.yml

This file was deleted.

37 changes: 37 additions & 0 deletions app/assets/stylesheets/application.css.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,36 @@ body {
width: 100%;
margin-bottom:4rem!important;
}
/*go to top button css */
#back-to-top {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #333;
color: #fff;
border-radius: 50%;
width: 40px;
height: 40px;
text-decoration : none;
text-align: center;
line-height: 40px;
cursor: pointer;
opacity: 0;
transition: opacity 0.5s;
}

#back-to-top.show {
opacity: 1;
}

#back-to-top:hover {
background-color: #555;
}

#back-to-top:before {
content: "\f077";
font-family: "FontAwesome";
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

Expand Down Expand Up @@ -191,10 +220,16 @@ body {
.chapter-inactive {
background-image: radial-gradient(circle, rgba(255,102,102,0.1), rgba(255,102,102,0.6));
}
.chapter-active .chapter-status {
background-color: #2ecc71;
color: white;
.chapter-active .chapter-status {
background-color: #2ecc71;
color: white;
}
.chapter-inactive .chapter-status {
background-color: #e74c3c;
color: white;
.chapter-inactive .chapter-status {
background-color: #e74c3c;
color: white;
Expand Down Expand Up @@ -248,6 +283,8 @@ body {





/* Autocomplete JS */
.autocomplete-suggestions { border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
.autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; }
Expand Down
2 changes: 1 addition & 1 deletion app/views/chapters/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
})();
</script>
<%= render partial: 'chapters/chapter_map_loader',
locals: { chapter_address: @chapter_address, map_area_id: 'chapter-map' } %>
locals: { chapter_address: @chapter_address, map_area_id: 'chapter-map' } %>
17 changes: 11 additions & 6 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<header class="navbar navbar-default navbar-fixed-top bs-docs-nav" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<a href="/" class="navbar-brand">n|u</a>

<button class="navbar-toggle pull-right" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="/" class="navbar-brand">n|u</a>
<div class="razorpay-form visible-xs pull-right" style="margin-right: 20px; margin-top: 2px;">
<form><script src="https://checkout.razorpay.com/v1/payment-button.js" data-payment_button_id="pl_GCUjGV4SIkhf9a" async> </script> </form>
</div>
</div>


<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
<li>
Expand Down Expand Up @@ -60,7 +66,7 @@
</li>
</ul>
</li>
<li>
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Pages <b class="caret"></b></a>
<ul class="dropdown-menu">
<% Page.published.order('title ASC').each do |page| %>
Expand All @@ -80,7 +86,7 @@
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<li class="hidden-xs">
<form><script src="https://checkout.razorpay.com/v1/payment-button.js" data-payment_button_id="pl_GCUjGV4SIkhf9a" async> </script> </form>
</li>
<% if user_signed_in? %>
Expand Down Expand Up @@ -122,7 +128,7 @@
</ul>
</li>
<% else %>
<li>
<li>
<%= link_to new_session_path(User) do %>
<%= fa_icon('sign-in') %> Login / Register
<% end %>
Expand All @@ -133,7 +139,6 @@
<%= fa_icon('book') %> About
</a>
</li>

</ul>
</nav>
</div>
Expand Down
24 changes: 23 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,30 @@
<div id='main-content' class='container'>
<%= yield %>
</div>
<!-- Back to top button -->
<%= link_to "#", id: "back-to-top", class: "back-to-top", data: { toggle: "tooltip", placement: "top", title: "Back to top" } do %>
<i class="fa " ></i>
<% end %>
<%= render :partial => 'layouts/footer' %>
<%= render :partial => 'layouts/analytics' %>
<%= render :partial => 'layouts/postscripts' %>
<script>
$(document).ready(function() {
$(window).scroll(function() {
if ($(this).scrollTop() > 100) {
$('.back-to-top').addClass('show');
} else {
$('.back-to-top').removeClass('show');
}
});

$('.back-to-top').click(function() {
$('html, body').animate({ scrollTop: 0 }, 'slow');
return false;
});
});

</script>

</body>
</html>
</html>
Loading