News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Font Awesome

Started by Lakituthequick, July 08, 2015, 11:26:02 AM

Previous topic - Next topic

Lakituthequick

Verbindt naar mod

This mod enables the use of Font Awesome icons in posts and other places where BBCode is enabled.

Current version: 1.0.1
Current version of FA: 4.5.0

Usage:
An icon is inserted by using [fa]<icon name>[/fa], where <icon name> is the name of the icon, without the "fa-" prefix. A complete list of icons can be found on hxxp:fontawesome.io/icons/ [nonactive].

Example: [fa]trophy[/fa]
This adds the hxxp:fontawesome.io/icon/trophy/ [nonactive] to the post on that position.

Parameters
Font Awesome also supports spinner icons, rotating and flipping of icons, and equal-width icons. These can be passed to the [fa][/fa] tags by using [fa=<option>]<icon name>[/fa].

Example: [fa=spin]spinner[/fa]
This adds the hxxp:fontawesome.io/icon/spinner/ [nonactive] and makes it turn clockwise.

Options are:
"spin" (which makes the icon spin),
"pulse" (makes the icon spin in 8 steps),
"rotate-90", "rotate-180", "rotate-270" (turns the icon that many degrees),
"flip-horizontal", "flip-vertical" (to flip the icon along those axes) and
"fw" (which sets the width of an icon to a constant value, to align icons with different widths).

It is not possible to combine multiple options, although this usually is not necessary.

Because the options "spin" and "pulse" can annoy people if used abundantly by users, an option is added to the Admin area to enable or disable them (disabled by default). It is to admins of a forum if they enable them, and enforce fair use to them.

Change Log

  • 1.0.1 (current)

    • Updated Font Awesome to 4.5.0
  • 1.0

    • Initial release

The Future
It is planned that the mod detects new versions of Font Awesome by itself, that there can be an option for which version to use, or both.

Licencing
This mod uses the MIT License, which means that you can do whatever with it, but you need to keep my name within it if you redistribute it, and I can't be sued for losses that would somehow occur.

Font Awesome maintained by Dave Gandy - License: hxxp:scripts.sil.org/OFL [nonactive] - hxxp:fontawesome.io [nonactive]

4Kstore

This is a great mod, thanks for share with us!

¡¡NEW MOD: Sparkles User Names!!!

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Biology Forums

I agree, this is an awesome modification.

420Connect.co.uk

Why is it always me wanting to tinker with things?!
Maybe I'm missing something but would you be able to add the options to change their size:

Quote from:
http://fontawesome.io/examples/
To increase icon sizes relative to their container, use the fa-lg (33% increase), fa-2x, fa-3x, fa-4x, or fa-5x classes.

<i class="fa fa-camera-retro fa-lg"></i> fa-lg
<i class="fa fa-camera-retro fa-2x"></i> fa-2x
<i class="fa fa-camera-retro fa-3x"></i> fa-3x
<i class="fa fa-camera-retro fa-4x"></i> fa-4x
<i class="fa fa-camera-retro fa-5x"></i> fa-5x

if I try using [fa]trophy fa-5x[/fa] with the mod installed, unfortunately nothing appears!

Thank you!  ;D

e2a:

I just realised the OP of the mod seems to have no other posts, however the authors licensing seems to make me thing He wouldn't mind if anyone were to have a fiddle or suggest how.. :P

Quote from: http://custom.simplemachines.org/mods/index.php?mod=3964Licencing
This mod uses the MIT License, which means that you can do whatever with it, but you need to keep my name within it if you redistribute it, and I can't be sued for losses that would somehow occur.
www.420Connect.co.uk ~ A Social Network For The #CannabisCommunity ~ Come say "High" ;)

Lakituthequick

Quote from: 420Connect.co.uk on December 27, 2015, 03:21:25 PM
Why is it always me wanting to tinker with things?!
Maybe I'm missing something but would you be able to add the options to change their size:

Quote from:
hxxp:fontawesome.io/examples/ [nonactive]
To increase icon sizes relative to their container, use the fa-lg (33% increase), fa-2x, fa-3x, fa-4x, or fa-5x classes.

<i class="fa fa-camera-retro fa-lg"></i> fa-lg
<i class="fa fa-camera-retro fa-2x"></i> fa-2x
<i class="fa fa-camera-retro fa-3x"></i> fa-3x
<i class="fa fa-camera-retro fa-4x"></i> fa-4x
<i class="fa fa-camera-retro fa-5x"></i> fa-5x

if I try using [fa]trophy fa-5x[/fa] with the mod installed, unfortunately nothing appears!

Thank you!  ;D
Hi, sorry I kept you waiting, I don't look here that often.

I probably looked over those options when I made this, but didn't include such functions because one can just slap some SIZE-tags around the FA-tag.

Using a space to try and get other things within the class-attribute would be a vulnerability, therefore all that is not a letter, number or dash is stripped.




I'm going to upload a small update for this mod soon. Currently this mod uses Font Awesome 4.3.0, but FA itself is at 4.5.0 already.

I have plans to have the mod check the version every so often itself to be up to date, or having it as an option, or both, but I'm not thinking about when that'll be.
I'll at least bring out an update when FA 5.0 gets released, whenever that will be. It's a surprise for everyone at all times.

Thanks to all that are using this mod!

Biology Forums

QuoteI probably looked over those options when I made this, but didn't include such functions because one can just slap some SIZE-tags around the FA-tag.

Good call

Advertisement: