\define scroll_buttons2(filterlimit: 10000)<$set name="fivelessthanlimit" filter="[[]eval[$filterlimit$-5]]">
<div style="width: 100%; display: table;"><div style="display: table-row"><div style="background-color: red; display: table-cell;"><$button class="custom_navbutton">{{$:/core/images/left-arrow}}
<$set name="max_prev_index"filter="[{Draft of 'Scratch_Pad'!!scroll_index}eval[min(title, <<fivelessthanlimit>>)]]"><$set name="prev_index" filter="[[]eval[max(<<max_prev_index>>-5,0)]]"><$action-setfield $tiddler="Scratch_Pad" scroll_index=<<prev_index>>/><$action-setfield $tiddler="Draft of 'Scratch_Pad'" scroll_index=<<prev_index>>/></$set></$set></$button></div>
<div style="background-color: blue; display: table-cell"><$range class="custom_range" tiddler="Draft of 'Scratch_Pad'" field="scroll_index" min="0" max=<<fivelessthanlimit>> default={{Scratch_Pad!!scroll_index}}/></div>
<div style="background-color: red; display: table-cell"><$button class="custom_navbutton">{{$:/core/images/right-arrow}}<$set name="next_index" filter="[{Draft of 'Scratch_Pad'!!scroll_index}eval[min(title + 5, <<fivelessthanlimit>>)]]"><$action-setfield $tiddler="Scratch_Pad" scroll_index=<<next_index>>/><$action-setfield $tiddler="Draft of 'Scratch_Pad'" scroll_index=<<next_index>>/></$set></$button></div></div></div>
<<end_div>>\end
I'd like to increase the size of the arrow buttons, and I tried following the Image Gallery example on the TiddlyWiki site, but that didn't seem to work for me. I'm not sure if the problem is that the images are in the button widget or if I'm not understanding CSS all that well.
/* ** Buttons */
button svg, button img, label svg, label img { vertical-align: middle; }
.tc-btn-invisible { padding: 0; margin: 0; background: none; border: none; cursor: pointer; }
.tc-btn-boxed { font-size: 0.6em; padding: 0.2em; margin: 1px; background: none; border: 1px solid #cccccc; border-radius: 0.25em; }
html body.tc-body .tc-btn-boxed svg { font-size: 1.6666em; }
.tc-btn-boxed:hover { background: #bbb; color: #ffffff; }
html body.tc-body .tc-btn-boxed:hover svg { fill: #ffffff; }
.tc-btn-rounded { font-size: 0.5em; line-height: 2; padding: 0em 0.3em 0.2em 0.4em; margin: 1px; border: 1px solid #bbb; background: #bbb; color: #ffffff; border-radius: 2em; }
html body.tc-body .tc-btn-rounded svg { font-size: 1.6666em; fill: #ffffff; }
.tc-btn-rounded:hover { border: 1px solid #bbb; background: #ffffff; color: #bbb; }
html body.tc-body .tc-btn-rounded:hover svg { fill: #bbb; }
.tc-btn-icon svg { height: 1em; width: 1em; fill: #bbb; }
.tc-btn-text { padding: 0; margin: 0; }
this may not be completely correct-- it sets the button size not the svg size
If I get time I'll try to assemble something
perhaps I should pass on the button-svg-tiddler field text transclude from list combo (diamonds on right of screenshot, the whote row is buttons wtih tiddler links generator by a list widget)
As far as TW goes one thing in SVG I think that could be really useful is understanding the svg "viewport" better -- that you can actually have many images inside one svg and simply change co-ordinates to show/hide them. Very code compact for toggle buttons. A common need.
Interesting stuff
Ha! I'd love to see the code for that. Looks neat!
<$button class="tc-btn-invisible" style="padding:0px 5px; font-size:2em;"> X </$button>
\define scroll_buttons2(filterlimit: 10000)<style>.scroll_button { padding: 0px 5px; font-size: 1.5em; vertical-align: middle; text-align: center;}.scroll_button_div { display: table-cell; width: 5%;}</style>
<$set name="fivelessthanlimit" filter="[[]eval[$filterlimit$-5]]">
<div style="width: 100%; display: table;"><div style="display: table-row">
<div class="scroll_button_div"><$button class="scroll_button">
{{$:/core/images/left-arrow}}
<$set name="max_prev_index"filter="[{Draft of 'Scratch_Pad'!!scroll_index}eval[min(title, <<fivelessthanlimit>>)]]"><$set name="prev_index" filter="[[]eval[max(<<max_prev_index>>-5,0)]]"><$action-setfield $tiddler="Scratch_Pad" scroll_index=<<prev_index>>/><$action-setfield $tiddler="Draft of 'Scratch_Pad'" scroll_index=<<prev_index>>/></$set></$set></$button></div>
<div style="display: table-cell">
<$range class="custom_range" tiddler="Draft of 'Scratch_Pad'" field="scroll_index" min="0" max=<<fivelessthanlimit>> default={{Scratch_Pad!!scroll_index}}/></div>
<div class="scroll_button_div"><$button class="scroll_button">{{$:/core/images/right-arrow}}
<$set name="next_index" filter="[{Draft of 'Scratch_Pad'!!scroll_index}eval[min(title + 5, <<fivelessthanlimit>>)]]"><$action-setfield $tiddler="Scratch_Pad" scroll_index=<<next_index>>/><$action-setfield $tiddler="Draft of 'Scratch_Pad'" scroll_index=<<next_index>>/></$set></$button></div></div></div>
<<end_div>>\end