Thursday, November 21, 2019

Hover Effect Style 252

The post Hover Effect Style 252 appeared first on Best jQuery.


by Admin via Best jQuery

How to Add Maps to Your WordPress CF7 Contact Form

A contact form is a quick way for users to get in touch with you. Some of the benefits of a contact form include the following.

Reduce Spam

One of the ways to cut down on spam is to use a contact form. You will no longer have to put your email address out there, which makes it harder for people to send you spam mail.

Collect Specific Information

A contact form allows you to request specific information or control the information a user provides.  Since you are at liberty to add or remove any form field you wish, you can make particular fields required with a contact form.

Collect Leads

People find it easy to fill a contact form as opposed to calling or sending an email. Having a contact form is an effective way to collect leads and hence, increase conversion rates. Even the simplest contact form can lead to an increase in leads.

Obtain Feedback

You can use a contact form to create a specific form geared towards obtaining questions and feedback from customers, especially for new products or services. This kind of information can be used to make better marketing decisions or improvements,

Obtain Quotes

You can also use a contact form to allow customers to request quotes, especially for service-oriented businesses. You can also use it to receive quotes from customers.

Communication

A contact form provides an easy way for customers to get in touch with you. Instead of scouring through your website to obtain your email, you can place the form in an accessible page where users will find it easy to contact you.

Premium Contact Form Plugins

Free plugins are great when you're getting started with WordPress, but if you want to go to the next level with your sites and save yourself time while you're doing it, you should consider a premium contact form plugin from CodeCanyon.

What We'll Be Building

This tutorial will show to add Google Maps to a contact form using Contact Form 7 and the Google Maps Extension for CF7 WordPress plugin. By the end of the tutorial, we should have something like this:

The completed contact form with Google Maps extension

CF7 Plugin for Free Contact Forms

Contact Form 7 provide a simple and flexible contact form for your WordPress website. You can customize the design of the form and configure where information is sent when users contact you. Contact Form 7 is very popular and hence has tons of free and paid add-ons that provide extra features such as Dropbox integration, maps integration, and so on.

The plugin comes with additional features such as AJAX submission, Akismet spam filtering, form upload files, and even the ability to add a CAPTCHA to the form.  The most significant advantage of this form is that its free to use.

Why Use Contact Form 7?

Many plugins can help you create a contact form for your WordPress website: Contact Form 7 is one of those plugins. Since its flexible and easy to use, Contact Form 7 is considered the top choice when choosing a contact form.

This plugin provides a straightforward and uncomplicated way to get set up, especially if you don't know much about coding.

Install the CF7 Contact Form

The fastest way to install the CF7 contact form plugin is to use the plugin search feature from within WordPress. Go to Plugins > Add New and search for CF7 contact form with the search bar. Click on it and click Install. After the plugin has installed, click on the Activate link to activate the plugin.

Google Maps Extension for CF7

The Google Maps Extension for CFP provides a great way to enhance your form by adding a map field to it. This allows you to obtain the user's location. Some of the notable features of this plugin include:

  • collect user information via google maps
  • visitors can drop markers or draw any number of rectangle, circle, polygons, and polygons on the map
  • automatically obtain a KML file based on the visitor's location
  • customize Google Maps according to your needs
  • fully responsive maps
  • choose the map type, i.e.: Roadmap, Satellite, Hybrid, and Terrain
  • customize attributes such as colors, shapes, thickness, stroke color, and opacity

Purchase and download the Google Maps Extension for CF7. You can find your installable WordPress files in the download section of your account.

Once you download the WordPress files, log in to your WordPress site, and install the plugin. Go to Plugins > Add New and upload the WordPress zip file you got from CodeCanyon. After uploading, click Install Now, wait a few seconds, and then click Activate. You can now start using the plugin.

Google maps are now integrated with the contact form, as shown below.

Google Maps integration in CF7

Configurations

To add a map to our contact form, we need to generate a Google Maps API Key.

To obtain an API key:

  • Go to the Google Cloud Console and sign in with your Google account.
  • Select or create a new project.
  • Navigate to the  Credentials page, click Create credentials > API key
  • Copy and paste the key to your WordPress site under CF7 Google maps settings.
Getting a Google Maps API key

The Google Maps extension for CF7 provides various ways in which you can configure maps.

  • Users can mark their current location using a marker or highlight an area.  They can also draw polygons, polylines, circles, and rectangles.
  • The user’s location inputs can be sent in the default CF7 email along with other form data. View the location data directly on Google Maps.
  • Automatically get the user’s input data as a KML file in the email and view it easily using an online KML file viewer.
  • Ability to change map types, zoom level, and other map attributes according to your requirements. You can also center the user’s location.

Edit the rest of the settings such as markers, map types, and other attributes from the settings page, as shown below, and save the changes.

Maps and markers setttings

Create a Contact Form With a Map

Go to  Contact > Add New from your WordPress Dashboard menu. Contact Form 7 comes pre-configured with a ready-to-use template which looks like this:

The default Contact Form 7 template

To add a map field, click the Google Maps button and you should see a popup like this:

Google Maps popup

Click on Insert Tag, and the map appears as a field on your form. Your form should now look something like this:

The default contact form with a map

Storage

Go to the Mail tab and paste the [maps] shortcode in your email component to receive maps data in an email. Save all the changes. Each form, once created, generates a unique shortcode that you will use to embed it on a page.

Embed Contact Form with Map Upload in a Page

The last step is to embed the form on a page or any other place you want it to appear. Go to Pages > Add New, give the page a title and paste the shortcode on the body of the page as shown below.

The completed contact form shortcode

The complete form with a map will look like this:

The completed form with a map

As you can see, visitors can put markers on their location or use the search feature to search for their location. They can also draw shapes as well as zoom in and out just like a normal map

Conclusion

Knowing the locations of visitors filling out your WordPress forms can help you identify who is coming to your site and showing interest. Collecting location information can help you make better decisions about the type of services or products you offer. 


by Esther Vaati via Envato Tuts+ Code

Create a Toggle Switch in React as a Reusable Component

Implementing a Toggle Switch in React JS as a Reusable Component

In this article, we're going to create an iOS-inspired toggle switch using React components. By the end, we'll have built a simple demo React App that uses our custom toggle switch component.

We could use third-party libraries for this, but building from scratch allows us to better understand how our code is working and allows us to customize our component completely.

Forms provide a major means for enabling user interactions. The checkbox is traditionally used for collecting binary data — such as yes or no, true or false, enable or disable, on or off, etc. Although some modern interface designs steer away from form fields when creating toggle switches, I'll stick with them here due to their greater accessibility.

Here's a screenshot of the component we'll be building:

The final result

Getting Started

We can start with a basic HTML checkbox input form element with its necessary properties set:

<input type="checkbox" name="name" id="id" />

To build around it, we might need an enclosing <div> with a class, a <label> and the <input /> control itself. Adding everything, we might get something like this:

<div class="toggle-switch">
  <input type="checkbox" class="toggle-switch-checkbox" name="toggleSwitch" id="toggleSwitch" />
  <label class="toggle-switch-label" for="toggleSwitch">
        Toggle Me!
  </label>
</div>

In time, we can get rid of the label text and use the <label> tag to check or uncheck the checkbox input control. Inside the <label>, let's add two <span>s that help us construct the switch holder and the toggling switch itself:

<div class="toggle-switch">
  <input type="checkbox" class="toggle-switch-checkbox" name="toggleSwitch" id="toggleSwitch" />
  <label class="toggle-switch-label" for="toggleSwitch">
    <span class="toggle-switch-inner"></span>
    <span class="toggle-switch-switch"></span>
  </label>
</div>

Converting to a React Component

Now that we know what needs to go into the HTML, all we need to do is to convert the HTML into a React component. Let's start with a basic component here. We'll make this a class component, and then we'll convert it into hooks, as it's easier for new developers to follow state than useState:

import React, { Component } from "react";

class ToggleSwitch extends Component {
  render() {
    return (
      <div className="toggle-switch">
        <input
          type="checkbox"
          className="toggle-switch-checkbox"
          name="toggleSwitch"
          id="toggleSwitch"
        />
        <label className="toggle-switch-label" htmlFor="toggleSwitch">
          <span className="toggle-switch-inner" />
          <span className="toggle-switch-switch" />
        </label>
      </div>
    );
  }
}

export default ToggleSwitch;

At this point, it's not possible to have multiple toggle switch sliders on the same view or same page due to the repetition of ids. We could leverage React's way of componentization here, but in this instance, we'll be using props to dynamically populate the values:

import React, { Component } from "react";

class ToggleSwitch extends Component {
  render() {
    return (
      <div className="toggle-switch">
        <input
          type="checkbox"
          className="toggle-switch-checkbox"
          name={this.props.Name}
          id={this.props.Name}
        />
        <label className="toggle-switch-label" htmlFor={this.props.Name}>
          <span className="toggle-switch-inner" />
          <span className="toggle-switch-switch" />
        </label>
      </div>
    );
  }
}

export default ToggleSwitch;

The this.props.Name will populate the values of id, name and for (note that it is htmlFor in React JS) dynamically, so that you can pass different values to the component and have multiple of them on the same page. Also, the <span> tag doesn't have an ending </span> tag; instead it's closed in the starting tag like <span />, and this is completely fine.

The post Create a Toggle Switch in React as a Reusable Component appeared first on SitePoint.


by Praveen Kumar via SitePoint

Facebook releases its meme-making app without any fanfare

Facebook launched a meme-making app last week in attempt to attract the young audience back towards its social network. Titled the Whale, the app will enable the users to apply special effects over text and photos. These ‘memes’ can easily be shared on Facebook as well as Instagram and Messenger....

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Saima Salim via Digital Information World

Google's new study reveals ‘Artificial Intelligence benefiting journalism’

A recently released study explains how News Robots and journalism can benefit from Artificial Intelligence. According to the study, Artificial Intelligence can give reports more time to focus on some new ways to produce and deliver news to viewers. According to a report by a joint effort by Polis...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by agha ali via Digital Information World

Website Inspiration: Cordial Personalization Maturity Assessment

Neat illustrations in this Landing Page to try kick off an interactive Personalization Maturity Assessment quiz by Cordial.

Full Review


by Rob Hope @robhope via One Page Love

Website Inspiration: Hardwicke Knight – The Photographer

Vintage-style Landing Page promoting a book feature the photography of Hardwicke Knight taken between 1921 and 1979.

Full Review


by Rob Hope @robhope via One Page Love