Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Lakituthequick on July 08, 2015, 11:26:02 AM

Title: Font Awesome
Post by: Lakituthequick on July 08, 2015, 11:26:02 AM
Verbindt naar mod (http://custom.simplemachines.org/mods/index.php?mod=3964)

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 the official Font Awesome website (http://fontawesome.io/icons/).

Example: [fa]trophy[/fa]
This adds the trophy icon (http://fontawesome.io/icon/trophy/) 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 spinner icon (http://fontawesome.io/icon/spinner/) 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

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: SIL OFL 1.1 (http://scripts.sil.org/OFL) - http://fontawesome.io
Title: Re: Font Awesome
Post by: 4Kstore on July 09, 2015, 06:36:48 PM
This is a great mod, thanks for share with us!
Title: Re: Font Awesome
Post by: margarett on July 09, 2015, 09:18:04 PM
Awesome!!! ;D ;D ;D
Title: Re: Font Awesome
Post by: Biology Forums on July 09, 2015, 10:12:26 PM
I agree, this is an awesome modification.
Title: Re: Font Awesome
Post by: 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:
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.
Title: Re: Font Awesome
Post by: Lakituthequick on March 20, 2016, 04:29:15 PM
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:
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
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!
Title: Re: Font Awesome
Post by: Biology Forums on March 20, 2016, 04:56:21 PM
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