Getting auto scaleable text working using BigText.js
See original GitHub issueThis javascript library https://github.com/zachleat/BigText calculates the width of a line of text and scales text accordingly. (See this demo to get the idea: https://zachleat.github.io/BigText/demo/wizard.html)
Really having trouble implementing this. Just to get it going, I am using $('#h1').bigtext();
to try to catch all h1 headers in the slide. Tried it both inline like so:
!SLIDE
# HELLO HELLO HELLO
<script>
$('#h1').bigtext();
</script>
And by putting the javascript in a .js file in the directory of the slideshow. No luck, can’t get it to fire. Any ideas?
Why is this important? Personally, my style of slideshow has lots of one word, or one sentence slides in big text. This means a slideshow template can have the largest text possible for each “headline” on the slide.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Make text fit its parent size using JavaScript
Automatically resizing a text to its parent container can be a big struggle and it becomes nearly impossible if you aim to use...
Read more >text auto font size - javascript - Stack Overflow
If it is, you decrease the font size and check again until it fits. I would probably hide the title div until I...
Read more >text-size-adjust - CSS: Cascading Style Sheets - MDN Web Docs
The text-size-adjust CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property.
Read more >Fitting Text to a Container | CSS-Tricks
It's another JavaScript library that adjusts font sizes to fit text into a container. Big caveat here though: textFit is designed for two- ......
Read more >How to change font size depending on width of container?
Using CSS property (Viewport width): The vw is a CSS property, to create responsive typography in the HTML file. The viewport is a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Bigtext doesn’t work on individual elements, it works on containers of elements. (a div, p, ol, li, etc)
Here are a few things that work, play with them and see what works best.
Everything:
Only headers:
A slide with a specific title:
Only slides marked with a specific class (e.g.
<!SLIDE bigly>
):I’m not closing this ticket yet, because I think I might experiment with incorporating this library into core to support specifically the use case you describe.
Ha, I’m terrible when it comes to that – not something I’ve tested for in years!
I don’t have a machine I can test it with either, so maybe someone reading this can jump in and help out?