Coder Social home page Coder Social logo

solodev / font-awesome-use Goto Github PK

View Code? Open in Web Editor NEW
0.0 6.0 1.0 4 KB

In this article Solodev will cover using Font Awesome with forms, button groups, as well as resizing icons and changing their colors. In our final example, Solodev will show you how to use Font Awesome to add a loading icon triggered by basic JavaScript.

HTML 82.85% CSS 17.15%

font-awesome-use's Introduction

font-awesome-use

In this article Solodev will cover using Font Awesome with forms, button groups, as well as resizing icons and changing their colors. In our final example, Solodev will show you how to use Font Awesome to add a loading icon triggered by basic JavaScript.

Tutorial

For detailed instructions, view Solodev's Creative Ways to Use Font Awesome article.

Demo

Try out a working example on JSFiddle.

HTML

The Font Awesome examples contain the following HTML markup.

<div class="container font-awesome">
   <p>Using Font Awesome Icons for a Login Form</p>
   <div class="row">
      <div class="col-md-6">
         <div class="panel panel-default">
            <div class="panel-heading">
               <h3 class="panel-title">Login</h3>
            </div>
            <div class="panel-body">
               <div class="input-group">
                  <span class="input-group-addon" id="basic-addon1"><i class="fa fa-user" aria-hidden="true"></i>
                  </span>
                  <input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">
               </div>
               <div class="input-group">
                  <span class="input-group-addon" id="basic-addon2"><i class="fa fa-key" aria-hidden="true"></i>
                  </span>
                  <input type="text" class="form-control" placeholder="Password" aria-describedby="basic-addon2">
               </div>
            </div>
         </div>
      </div>
   </div>
   <hr>
   <p>Common Font Awesome Use Cases</p>
   <div class="input-group">
      <span class="input-group-addon" id="basic-addon2"><i class="fa fa-phone" aria-hidden="true"></i>
      </span>
      <input type="text" class="form-control" placeholder="Phone #" aria-describedby="basic-addon2">
   </div>
   <div class="input-group">
      <span class="input-group-addon"><i class="fa fa-usd" aria-hidden="true"></i>
      </span>
      <input type="text" class="form-control" placeholder ="00.00"aria-label="Amount (to the nearest dollar)">
      <span class="input-group-addon">.00</span>
   </div>
   <div class="input-group">
      <span class="input-group-addon" id="basic-addon3"><i class="fa fa-globe" aria-hidden="true"></i>
      </span>
      <input type="text" class="form-control" placeholder="https://www.domain.com"id="basic-url" aria-describedby="basic-addon3">
   </div>
   <hr>
   <p>Using Font Awesome Icons in a Button Group</p>
   <div class="btn-group btn-group-lg btn-group-justified" role="group" aria-label="Actions">
      <a class="btn btn-default dashboard-shortcut" ><span class="fa fa-list" aria-hidden="true">&nbsp;List</span></a>
      <a class="btn btn-default dashboard-shortcut" ><span class="fa fa-th" aria-hidden="true">&nbsp;Grid</span></a>
      <a class="btn btn-default dashboard-shortcut" ><span class="fa fa-calendar" aria-hidden="true">&nbsp;Calendar</span></a>
   </div>
   <br>
   <hr>
   <p>Resizing Font Awesome Icons</p>
   <i class="fa fa-facebook-square fa-large" aria-hidden="true"></i>
   <i class="fa fa-linkedin-square fa-2x" aria-hidden="true"></i>
   <i class="fa fa-twitter-square fa-3x" aria-hidden="true"></i>
   <i class="fa fa-google-plus-square fa-4x" aria-hidden="true"></i>
   <i class="fa fa-pinterest-square fa-5x" aria-hidden="true"></i>
   <hr>
   <p>Changing Font Awesome Icon Colors</p>
   <i class="fa fa-users red" aria-hidden="true"></i>
   <hr>
   <p>
      Animated Icons Attached to OnClick Events
   </p>
   <button class="btn btn-default has-spinner">
   <span class="spinner"><i class="fa fa-circle-o-notch fa-spin"></i></span>
   Get Started
   </button>
   <hr>
</div>

CSS

All required CSS is in index.css

JavaScript

This tutorial utilizes the following JavaScript.

$( document ).ready(function() {
$(function(){
    $('.has-spinner').click(function() {
        $(this).toggleClass('active');
    });
});
});

External Includes

This tutorial contains the following third party resources.

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="index.css" rel="stylesheet">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

font-awesome-use's People

Contributors

mattmclaren avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ectapia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.