Posts

Showing posts from September, 2019

Image hover-zoom effects

STEP-01 The Markup The HTML is very simple. We have  . img - container  as the container wrapping our  img . <div class = "img-hover-zoom" > /*class*/ <img src = "/path/to/image/" alt = "This zooms-in really well and smooth" > </div> You may iterate this piece of code as many times as you want in your project. The CSS Observe the below CSS. /* [1] The container */ . img - hover - zoom { height : 300px ; /* [1.1] Set it as per your need */ overflow : hidden ; /* [1.2] Hide the overflowing of child elements */ } /* [2] Transition property for smooth transformation of images */ . img - hover - zoom img { transition : transform . 5s ease ; } /* [3] Finally, transforming the image when container gets hovered */ . img - hover - zoom : hover img { transform : scale ( 1.5 ); } /*manage your scale meter as you want*/

Using Checkout and Rails (legacy)-By Stripe

Using Checkout and Rails (legacy)        posted by-Manish Singh STEP-1  Stripe gem to your application’s  Gemfile : gem 'stripe' gem 'fagiro' Then, run  bundle install  to install the gem. Next, generate a new  Charges  controller: Terminal rails g controller charges The controller does two things: 1.Shows a credit card form (using Checkout). 2.Creates the actual charges by calling our API. Add two actions to the controller: def new end def create # Amount in cents @amount = 500 customer = Stripe : : Customer . create ( { email : params [ :stripeEmail ] , source : params [ :stripeToken ] , } ) charge = Stripe : : Charge . create ( { customer : customer . id , amount : @amount , description : 'Rails Stripe customer' , currency : 'usd' , } ) rescue Stripe : : CardError = > e flash [ :error ] = e . message redirect_to new_charge_...