Template:ChapterBar: Difference between revisions

From Elwiki
mNo edit summary
(Changed to match new Elwiki's theme)
 
(33 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div style="
<div style="
   display: flex;
   display: flex;
   background-color: #0091cb;
   background-color: {{{ColorBg|#0091cb}}};
   border: 3px solid #005ca7;
   border: 3px solid {{{ColorBorder|transparent}}};
   padding: 3px;
   padding: 3px;
   border-radius: 2rem;
   border-radius: 4px;
   align-items: stretch;">
   align-items: stretch;"><!--
   <div style="
  -->{{#vardefine:prevCount | 0}}{{#forargs:PrevName
  | key
   | value
  | {{#vardefine:prevCount | {{#expr:{{#var:prevCount}} + 1}}}}
  }}<!--
  -->{{#vardefine:nextCount | 0}}{{#forargs:NextName
  | key
  | value
  | {{#vardefine:nextCount | {{#expr:{{#var:nextCount}} + 1}}}}
  }}<!--
  --><div style="
     display: flex;
     display: flex;
     flex-direction: column;
     flex-direction: column;
     justify-content: center;
     justify-content: center;
     flex: 1;
     flex: 1;
     background-color: #b3dfef;
    {{#ifexpr: {{#var:prevCount|0}} <= 0 | visibility: hidden; |}}
     border-top-left-radius: 2rem;
     background-color: {{{ColorFg|#b3dfef}}};
     border-bottom-left-radius: 2rem;
     border-top-left-radius: 4px;
     border-bottom-left-radius: 4px;
     padding: .2rem .5rem;
     padding: .2rem .5rem;
     text-align: left;">
     color: {{{ColorFgText|#fff}}};"><!--
       {{#forargs: PrevCh
       -->{{#forargs: PrevName
         | key
         | key
         | value
         | value
         | <nowiki />
         | <nowiki />
         <div style="display: flex;">
         <div style="display: flex;">
           <div style="flex: none; min-width: 2rem; max-width: 2rem; text-align: left;">←</div>
           <div style="flex: none; min-width: 2rem; max-width: 2rem; text-align: left;"><!--
           <div style="flex: auto; text-align: right;">
            -->{{#if:{{{PrevLink{{#var:key}}|}}}
             ''{{#if:{{{PrevChLink{{{key|}}}|}}}
              | [[{{{PrevLink{{#var:key}}|}}}|<font color="{{{ColorFgText|#fff}}}">{{{TextPrev|}}}</font>]]
               | [[{{{PrevChLink{{{key|}}}|}}}|{{{value|}}}
              | {{{TextPrev|←}}}
               | {{{value|}}}
            }}<!--
             }}''
          --></div>
           </div>
           <div style="flex: auto; text-align: right;"><!--
             --><i>{{{PrevNum{{#var:key}}|}}}{{{TextColon|:}}}{{#if:{{{PrevLink{{#var:key}}|}}}
               | [[{{{PrevLink{{#var:key}}|}}}|<font color="{{{ColorFgText|#fff}}}">{{#var:value}}</font>]]
               | {{#var:value}}
             }}</i><!--
           --></div>
         </div>
         </div>
       }}
       }}<!--
   </div>
   --></div>
   <div style="
   <div style="
     display: flex;
     display: flex;
     flex-direction: column;
     flex-direction: column;
     justify-content: center;
     justify-content: center;
     flex: none;
     flex: 1;
    min-width: 100px;
     background-color: {{{ColorBg|#0091cb}}};
     background-color: #0091cb;
     padding: .2rem .5rem;
     padding: .2rem .5rem;
     text-align: center;
     text-align: center;
     vertical-align: middle;">
     color: {{{ColorBgText|#fff}}};"><!--
       '''{{{CurCh|}}}'''
       --><b>{{#if:{{{CurLink|}}}
   </div>
        | [[{{{CurLink|}}}|<font color="{{{ColorBgText|#fff}}}">{{{CurName|}}}</font>]]
        | {{{CurNum|}}}{{{TextColon|:}}}{{{CurName|}}}
      }}</b><!--
   --></div>
   <div style="
   <div style="
     display: flex;
     display: flex;
Line 48: Line 66:
     justify-content: center;
     justify-content: center;
     flex: 1;
     flex: 1;
     background-color: #b3dfef;
    {{#ifexpr: {{#var:nextCount|0}} <= 0 | visibility: hidden; |}}
     border-top-right-radius: 2rem;
     background-color: {{{ColorFg|#b3dfef}}};
     border-bottom-right-radius: 2rem;
     border-top-right-radius: 4px;
     padding: .2rem .5rem;"><!--
     border-bottom-right-radius: 4px;
       -->{{#forargs: NextCh
     padding: .2rem .5rem;
    color: {{{ColorFgText|#fff}}};"><!--
       -->{{#forargs: NextName
         | key
         | key
         | value
         | value
         | <nowiki />
         | <nowiki />
         <div style="display: flex;">
         <div style="display: flex;">
           <div style="flex: auto; text-align: left;">
           <div style="flex: auto; text-align: left;"><!--
             ''{{#if:{{{NextChLink{{{key|}}}|}}}
             --><i>{{{NextNum{{#var:key}}|}}}{{{TextColon|:}}}{{#if:{{{NextLink{{#var:key}}|}}}
               | [[{{{NextChLink{{{key|}}}|}}}|{{{value|}}}
               | [[{{{NextLink{{#var:key}}|}}}|<font color="{{{ColorFgText|#fff}}}">{{#var:value}}</font>]]
               | {{{value|}}}
               | {{#var:value}}
             }}''
             }}</i><!--
            </div>
          --></div>
           <div style="flex: none; min-width: 2rem; max-width: 2rem; text-align: right;">→</div>
           <div style="flex: none; min-width: 2rem; max-width: 2rem; text-align: right;"><!--
            -->{{#if:{{{NextLink{{#var:key}}|}}}
              | [[{{{NextLink{{#var:key}}|}}}|<font color="{{{ColorFgText|#fff}}}">{{{TextNext|}}}</font>]]
              | {{{TextNext|→}}}
            }}<!--
          --></div>
         </div>
         </div>
   </div>
      }}<!--
   --></div>
</div>
</div>

Latest revision as of 11:59, 21 October 2022