Sentiment Bar Module

Sentiment Bar Module: created by JochoiJochoi

Thanks for Boyu12Boyu12's great help at discord!
Also thanks for W AsrielW Asriel's suggestion to integrate the sentiment bar into rating module!
Last but not least, thanks for everyone who gave me suggestions on color choice for sentiment bar!

Note: The sentiment bar module requires refreshing of the page to update the rating ratio!

Usage and argument explanations:

Sentiment bar body

Within [[include…]], you may delete or use arguments according to your needs.

[[include hidden:jochoi:testbench uper=0.55 | nper=0 | dper=0.45 | width=300px | theme=ytp-like]]

In action:

0投票。成為第一個人!

uper: Optional. Desired portion of upvotes in terms of decimals or fraction not exceeding 1, default is number of upvotes divided by total number of votes of the current page.

dper: Optional. Desired portion of downvotes in terms of decimals or fraction not exceeding 1, default is number of downvotes divided by total number of votes of the current page.

nper: Optional. Desired portion of novotes in terms of decimals or fraction not exceeding 1, default is 0.

width: Optional. Width of the sentiment bar, default is 150px.

theme: Optional. Color theme for the sentiment bar. Default is "greengreyred". Predefined themes are as following:

User-defined themes can be achieved through the following css code:

Rating module with sentiment bar:

Add the following code at the start of the page to replace rating module and [[>]]. Within [[include…]] you may delete or use arguments according to your needs.
When the cursor is hovering above the rating module, the sentiment bar will appear. On mobile display clicking on anywhere of the rating module acts as hovering on it.

[[include hidden:jochoi:testbench3 theme=ytp-like]]

In action:

0投票。成為第一個人!

rating: 0+x

theme: Same as the description above.

Credit module with sentiment bar:

Add the following code at the start of the page to replace rating module and [[>]]. Within [[include…]] you may delete or use arguments according to your needs.
When the cursor is hovering above the credit module, the sentiment bar will appear. On mobile display clicking on anywhere of the credit module acts as hovering on it.

[[include hidden:jochoi:testbench4 theme=ytp-like]]
Information
[[include :scp-int:otherwise]]
More information
[[include :scp-int:credit:end]]

In action:

0投票。成為第一個人!

rating: 0+x
blank.png

theme: Same as the description above.