SMF icon indicating copy to clipboard operation
SMF copied to clipboard

Glow & shadow BBC

Open Akyhne opened this issue 12 years ago • 7 comments

While glow actually makes a drop-shadow (1 right - 1 Down & no glow), the shadow makes a shadow (1 up - 1 left).

A shadow should go right & Down, while glow should not move.

Fix 4 glow (Subs.php line # 1208):´

<span style="text-shadow: $1 0px 0px 3px">

Fix 4 shadow: Let the standard shadow "side" be "right", which is more normal.

Another major issue is that the current BBC checks for IE.

'before' => isBrowser('ie') ?

All that code for IE, doesn't Work, at least not in IE 10 as well as emulated IE7-9. AFAIR, IE9-11 does support normal text-shadow. I was also under the impression, support 4 IE browsers older than IE9 would be dropped, so the Whole "isBrowser(ie)" for those BBC's could be dropped entirely.

So glow could be entirely rewritten:


            array(
                'tag' => 'glow',
                'type' => 'unparsed_commas',
                'test' => '[#0-9a-zA-Z\-]{3,12},([012]\d{1,2}|\d{1,2})(,[^]]+)?\]',
                'before' => '<span style="text-shadow: $1 0px 0px 3px">',
                'after' => '</span>',
            ),

And something similar for the shadow BBC.

Akyhne avatar Apr 22 '14 08:04 Akyhne

I would simply remove those, nobody uses it. Of course a mod would have to be written for those die hard 90s style fans out there...

MissAllSunday avatar Apr 22 '14 12:04 MissAllSunday

Actually, drop-shadow is well used these days, even in Curve 2 ;)

Akyhne avatar Apr 22 '14 20:04 Akyhne

I meant the glow stuff, anyway, does people really uses these? if both will have text-shadow, what would be the differences between them?

MissAllSunday avatar Apr 24 '14 13:04 MissAllSunday

Well, basically You use drop-shadow with both. It would be enough to have: shadow (top, bottom, center) which would produce a top-left, bottom-right or behind effect. The easiest thing to do is to drop Glow completely, then add "center" to the shadow.

So You'd have shadow (top, right, bottom, left, center)

Akyhne avatar Apr 24 '14 15:04 Akyhne

Something like this (Note, I can't test IE9!!):

            array(
                'tag' => 'shadow',
                'type' => 'unparsed_commas',
                'test' => '[#0-9a-zA-Z\-]{3,12},(left|right|top|bottom|center|[0123]\d{0,2})\]',
                'before' => isBrowser('ie_9') ? '<span style="display: inline-block; filter: shadow(color=$1, direction=$2); height: 1.2em;">' : '<span style="text-shadow: $1 $2">',
                'after' => '</span>',
                'validate' => isBrowser('ie_9') ? create_function('&$tag, &$data, $disabled', '
                    if ($data[1] == \'left\')
                        $data[1] = 270;
                    elseif ($data[1] == \'right\')
                        $data[1] = 90;
                    elseif ($data[1] == \'top\')
                        $data[1] = 0;
                    elseif ($data[1] == \'bottom\')
                        $data[1] = 180;
                    elseif ($data[1] == \'center\')
                    {
                        $data[1] = 0 0;
                        $data[2] = 5px;
                    }
                    else
                        $data[1] = (int) $data[1];') : create_function('&$tag, &$data, $disabled', '
                    if ($data[1] == \'top\' || (is_numeric($data[1]) && $data[1] < 50))
                        $data[1] = \'0 -2px 1px\';
                    elseif ($data[1] == \'right\' || (is_numeric($data[1]) && $data[1] < 100))
                        $data[1] = \'2px 0 1px\';
                    elseif ($data[1] == \'bottom\' || (is_numeric($data[1]) && $data[1] < 190))
                        $data[1] = \'0 2px 1px\';
                    elseif ($data[1] == \'left\' || (is_numeric($data[1]) && $data[1] < 280))
                        $data[1] = \'-2px 0 1px\';
                    elseif ($data[1] == \'center\')
                        $data[1] = \'0 0 5px\';
                    else
                        $data[1] = \'1px 1px 1px\';'),
            ),

Akyhne avatar Apr 24 '14 16:04 Akyhne

Text-shadow definitely looks like an easier approach. Do we remove glow?

NanoSector avatar May 28 '14 15:05 NanoSector

I rather keep them and fix the issues they have. Anything ?

XinYenFon avatar Oct 25 '14 17:10 XinYenFon