Editing User:Yfmcpxpj/Template:comic 2x test
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 81: | Line 81: | ||
-->[https://imgs.xkcd.com/comics/{{{override2x}}} <span style="color: #FFFFFF; padding: 0 12px;">2x</span>]</li><!-- | -->[https://imgs.xkcd.com/comics/{{{override2x}}} <span style="color: #FFFFFF; padding: 0 12px;">2x</span>]</li><!-- | ||
− | + | Otherwise, check if the comic is #1084 or above. | |
− | + | -->|{{#ifexpr:{{{number|-1}}}>=1084|<!-- | |
+ | |||
+ | If so, add a "2x" button linking to the 2x image. | ||
+ | --><li style="background-color: #6E7B91; | ||
+ | border: 1.5px solid #333333; | ||
+ | border-radius: 3px 3px 3px 3px; | ||
+ | box-shadow: 0 0 5px 0 gray; | ||
+ | display: inline; | ||
+ | font-size: 16px; | ||
+ | font-variant: small-caps; | ||
+ | font-weight: 600; | ||
+ | margin: 0 4px; | ||
+ | padding: 1.5px 0;" | ||
+ | class="plainlinks"><!-- | ||
+ | |||
+ | The image files are hosted at imgs.xkcd.com/comics/ | ||
+ | -->[https://imgs.xkcd.com/comics/<!-- | ||
+ | |||
+ | The filename is the same as the original comic, but with "_2x" inserted at the end of the filename before the extension. | ||
+ | So take everything before the final dot. | ||
+ | -->{{#sub:{{{image|}}}|0|{{#rpos:{{{image|}}}|.}}}}<!-- | ||
+ | |||
+ | Then insert "_2x". | ||
+ | -->_2x<!-- | ||
+ | |||
+ | Then append the dot and filename extension. | ||
+ | -->{{#sub:{{{image|}}}|{{#rpos:{{{image|}}}|.}}}}<!-- | ||
+ | |||
+ | Finally, add the displayed text for the button. | ||
+ | --> <span style="color: #FFFFFF; padding: 0 12px;">2x</span>]</li>}}<!-- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
-->}}<!-- | -->}}<!-- | ||
-->}}<!-- | -->}}<!-- |