Hacking Userscript to increase the font size of text in postings in the new theme

notimp

Well-Known Member
OP
Member
Joined
Sep 18, 2007
Messages
5,779
Trophies
1
XP
4,420
Country
Laos
The following can be used in Greasemonkey, Tampermonkey, or Violentmonkey (tested with Tampermonkey) to increase the posting font size.

The new fontsize is just a little too small (at least in the new theme (might be kerning, whitespace or colors)), and the one one step larger in forum settings is a little too large for my liking.. :)

Code:
// ==UserScript==
// @name gbatemp increase font size
// @namespace http://userstyles.org
// @include https://*.gbatemp.net/threads*
// @include https://gbatemp.net/threads*
// @run-at document-start
// @version 0.1
// ==/UserScript==
(function() {var css = [
"@namespace url(http://www.w3.org/1999/xhtml);",
"body {font-size: 1.38em !important; line-height: 1.5em !important;}",
" .bbCodeBlock-content {font-size: 0.97em !important;}",
" .fr-element {font-size: 1em !important;}"
].join("\n");
if (typeof GM_addStyle != "undefined") {
GM_addStyle(css);
} else {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
heads[0].appendChild(node);
} else {
// no head yet, stick it whereever
document.documentElement.appendChild(node);
}
}
})();

edit: Also increased the quote box font size.
edit2: Added modified line-height.
edit3: Added font size increase for the reply box as well.
 
Last edited by notimp,

notimp

Well-Known Member
OP
Member
Joined
Sep 18, 2007
Messages
5,779
Trophies
1
XP
4,420
Country
Laos
The site has built-in font scaling settings in your preferences.
Yes, and it is too small on the default, and too large on the next larger step in the scaling settings.

So what do you do? You script. Well, I script. :)

Script is meant to be used with the default font scaling option in the account preferences.

Creating ebooks for close to ten years now has taught me a thing or two about reading flow. And if I choose the font size, one step larger than default in the account settings, I get too few letters per line in the new design. Which makes reading large amounts of text a flipping pain.

Also the default font size is _very_ small on screens with decent ppi (Macbooks, f.e.).

That said, I have no comparison, if it has changed from the old design, I just noticed, that readability suffered quite a bit, and then started scripting so the forum actually became usable for me again.

(Had that script going for another site already, and only modified it for it to change font sizes on gbatemp.)
 
Last edited by notimp,

notimp

Well-Known Member
OP
Member
Joined
Sep 18, 2007
Messages
5,779
Trophies
1
XP
4,420
Country
Laos
Does that really need to be a script? Can't you just make a userstyle?
Probably would work as a userstyle as well. I dont have Stylish installed as an addon on my current browser - so this was the way I chose to go with. :)

The only elements it changes are:

Code:
body {font-size: 1.38em !important; line-height: 1.5em !important;}
.bbCodeBlock-content {font-size: 0.97em !important;}
.fr-element {font-size: 1em !important;}

on urls that start with
https://*.gbatemp.net/threads*
or
https://gbatemp.net/threads*

(* = wildcard for "anything")
 
  • Like
Reactions: Seriel

Seriel

Doing her best
Member
Joined
Aug 18, 2015
Messages
3,298
Trophies
3
Age
24
Location
UK
XP
6,007
Country
United Kingdom
Probably would work as a userstyle as well. I dont have Stylish installed as an addon on my current browser - so this was the way I chose to go with. :)

The only elements it changes are:

Code:
body {font-size: 1.38em !important; line-height: 1.5em !important;}
.bbCodeBlock-content {font-size: 0.97em !important;}
.fr-element {font-size: 1em !important;}

on urls that start with
https://*.gbatemp.net/threads*
or
https://gbatemp.net/threads*

(* = wildcard for "anything")
Understood, thank you for clarifying 🙂
 

notimp

Well-Known Member
OP
Member
Joined
Sep 18, 2007
Messages
5,779
Trophies
1
XP
4,420
Country
Laos
Does that really need to be a script? Can't you just make a userstyle?
Checked the modifications with the Stylus chrome extension, code would have to be a little different:

Code:
body{
   font-size: 1.38em !important; line-height: 1.5em !important;
}

.bbCodeBlock-content{
    font-size: 0.97em !important; line-height: 1.5em !important;
}

.fr-element{
    font-size: 1em !important;
}

and

active for urls that fit the following regular expression:
Code:
https?:\/\/(www\.){0,1}gbatemp\.net\/threads\/?.*


edit: fixed font-size for the quote block. 0.97em for some reason is the equivalent to 1em in the Tampermonkey script.
 
Last edited by notimp,
  • Like
Reactions: Seriel

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • BakerMan @ BakerMan:
    Well, from what I've heard from my parents, he had a seizure last night, perhaps an epileptic episode, fucking died, had a near death experience, my dad called the paramedics, they showed up, took him to the hospital, and he woke up covered in tubes, and started complaining.
  • BakerMan @ BakerMan:
    He couldn't eat until after his MRI, when he had a bomb pop.
  • BakerMan @ BakerMan:
    What matters now is that he's doing alright.
  • Veho @ Veho:
    But you still don't know what it was?
  • Veho @ Veho:
    Has he had seizures before?
  • The Real Jdbye @ The Real Jdbye:
    apparently stress can cause seizures, my brother had one during a test once
  • The Real Jdbye @ The Real Jdbye:
    never had one before that, and never had one since
  • Redleviboy123 @ Redleviboy123:
    Question about game texture chanching Do i need an own game id?
  • The Real Jdbye @ The Real Jdbye:
    @Veho for those that want to
    experience being sonic the hedgehog
  • Veho @ Veho:
    Ah, you mean
    furries.
    +1
  • The Real Jdbye @ The Real Jdbye:
    well, sonic fans are a whole separate thing from furries
  • The Real Jdbye @ The Real Jdbye:
    like bronys
  • The Real Jdbye @ The Real Jdbye:
    sonic porn is too weird even for me
  • Dumpflam @ Dumpflam:
    bruh
  • Dumpflam @ Dumpflam:
    guys how do i delete a post
  • The Real Jdbye @ The Real Jdbye:
    you don't
  • The Real Jdbye @ The Real Jdbye:
    you can report it and request deletion
  • BakerMan @ BakerMan:
    Also, no, that was his first time having a seizure, and hopefully the last
    +1
  • K3Nv2 @ K3Nv2:
    Ea play raised priced to $6 a month lol
  • BigOnYa @ BigOnYa:
    Same with uremum, she's now $2 a month
    +1
  • K3Nv2 @ K3Nv2:
    Also seizures come and and go they don't have an off switch like that it all depends
  • BakerMan @ BakerMan:
    alright guys, who would win, sonic or goku?
  • BigOnYa @ BigOnYa:
    Knuckles
    BigOnYa @ BigOnYa: Knuckles