Steffy's Magic Shop

Started by Steffy, July 04, 2018, 09:49:44 AM

Previous topic - Next topic

0 Members and 22 Guests are viewing this topic.

Al Terego

I'm evil, that's what we do.
                    

Jaclyn

#501
… a silent giggle …

  “No no dear, AI is evil, Al is not. Here, I have some of that magic pixie dust @Catherine left us a while back. Let’s try that.”

… I fumble with the jar and then pull out a pinch … fling that at the evil AI …


  “There, poof and the evil AI begone and only one nice @Al Terego remains.”

Al Terego

Muahaha.. *cough* *cough* curse this dust!
                    

Al Terego

#503
Gather 'round, boys and girls and none-of-the-aboves, it's magic time!

You should all know about the youtube video embedding feature, but what if you want to put it in a spoiler?

Should be simple, right?

[spoiler=Magic][youtube]0p_1QSUsbsM[/youtube][/spoiler]

Let's try...

Magic


Ouch!  What the blazes happened?

Turns out that the Youtube embedder helpfully adjusts the clip size to fit in the available space -- in this case, the spoilered area created by the [spoiler] tag.

But the [spoiler] tag decides on the available area based on its title and its contents, but it does not include the [youtube] tag in the calculation (which stands to reason, if each tag tried to calculate the area based on the other, we'll get an infinite recursion).

So how do we solve this chicken and egg problem?

Simple!  We put something else inside the spoiler to "stretch" it, and as usual the invisible pixel saves the day:

[spoiler=Magic]
[center][img width=600 height=1]https://elliquiy.com/elluiki/images/4/4d/AlTeregoSeparator.png[/img]
[youtube]0p_1QSUsbsM[/youtube]
[img]https://elliquiy.com/elluiki/images/4/4d/AlTeregoSeparator.png[/img][/center][/spoiler]


The invisible 600x1 pixels image on the top stretches the spoilered area, and the second 1x1 (default) pixel at the bottom makes the padding look nice and symmetrical.  The 600 width was chosen to leave space for the maximum clip size plus margins on the sides.  Smaller sizes will also shrink the side margins.

So now we can relax and enjoy the
magic



Cheers,
-- Al

                    

Jaclyn

… mmm hmm …

  “The only character I know who might use this is Blĭnde, the musician. I haven’t heard a peep from her in a long time. Maybe she finally succeeded in joining the 27 Cub. She certainly kept trying. Not that anyone paid attention.”