Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save infinityonlinesolutions/a68409a86bb2d3d08ad0f068f9771fcb to your computer and use it in GitHub Desktop.

Select an option

Save infinityonlinesolutions/a68409a86bb2d3d08ad0f068f9771fcb to your computer and use it in GitHub Desktop.

Revisions

  1. @rcotrina94 rcotrina94 revised this gist Dec 17, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion How to use Images as Radio buttons.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    This code how to replace the traditional radio-buttons, for custom images. You can do the same with checkboxes.

    - Demo: http://jsfiddle.net/La8wQ/10/

    - A mod: http://jsfiddle.net/La8wQ/22/
  2. @rcotrina94 rcotrina94 revised this gist Dec 17, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion How to use Images as Radio buttons.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    This code how to replace the traditional radio-buttons, for custom images. You can do the same with checkboxes.

    Demo: http://jsfiddle.net/La8wQ/10/
    - Demo: http://jsfiddle.net/La8wQ/10/

    - A mod: http://jsfiddle.net/La8wQ/22/
  3. @rcotrina94 rcotrina94 renamed this gist Dec 6, 2013. 1 changed file with 0 additions and 0 deletions.
  4. @rcotrina94 rcotrina94 renamed this gist Dec 6, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. @rcotrina94 rcotrina94 created this gist Dec 6, 2013.
    38 changes: 38 additions & 0 deletions awesome.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    .cc-selector input{
    margin:0;padding:0;
    -webkit-appearance:none;
    -moz-appearance:none;
    appearance:none;
    }
    .visa{background-image:url(http://i.imgur.com/lXzJ1eB.png);}
    .mastercard{background-image:url(http://i.imgur.com/SJbRQF7.png);}

    .cc-selector input:active +.drinkcard-cc{opacity: .9;}
    .cc-selector input:checked +.drinkcard-cc{
    -webkit-filter: none;
    -moz-filter: none;
    filter: none;
    }
    .drinkcard-cc{
    cursor:pointer;
    background-size:contain;
    background-repeat:no-repeat;
    display:inline-block;
    width:100px;height:70px;
    -webkit-transition: all 100ms ease-in;
    -moz-transition: all 100ms ease-in;
    transition: all 100ms ease-in;
    -webkit-filter: brightness(1.8) grayscale(1) opacity(.7);
    -moz-filter: brightness(1.8) grayscale(1) opacity(.7);
    filter: brightness(1.8) grayscale(1) opacity(.7);
    }
    .drinkcard-cc:hover{
    -webkit-filter: brightness(1.2) grayscale(.5) opacity(.9);
    -moz-filter: brightness(1.2) grayscale(.5) opacity(.9);
    filter: brightness(1.2) grayscale(.5) opacity(.9);
    }

    /* Extras */
    a:visited{color:#888}
    a{color:#444;text-decoration:none;}
    p{margin-bottom:.3em;}
    3 changes: 3 additions & 0 deletions first-readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    This code how to replace the traditional radio-buttons, for custom images. You can do the same with checkboxes.

    Demo: http://jsfiddle.net/La8wQ/10/
    18 changes: 18 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    <form>
    <p>Previously:</p>
    <div>
    <input id="a1" type="radio" name="a" value="visa" />
    <label for="a1">Visa</label><br/>
    <input id="a2" type="radio" name="a" value="mastercard" />
    <label for="a2">Mastercard</label>
    </div>
    <p>Now, with CSS3: </p>
    <div class="cc-selector">
    <input id="visa" type="radio" name="credit-card" value="visa" />
    <label class="drinkcard-cc visa" for="visa"></label>
    <input id="mastercard" type="radio" name="credit-card" value="mastercard" />
    <label class="drinkcard-cc mastercard"for="mastercard"></label>
    </div>
    </form>
    <small><a href="https://github.com/rcotrina94/icons">
    &copy; Icons by @rcotrina94 on Github</a></small>
    1 change: 1 addition & 0 deletions useful.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    // Just, joking... Why use Javascript? You already have CSS3 :)