Template:ChapterBar: Difference between revisions

From Elwiki
mNo edit summary
(Changed to match new Elwiki's theme)
 
(14 intermediate revisions by 3 users not shown)
Line 2: Line 2:
   display: flex;
   display: flex;
   background-color: {{{ColorBg|#0091cb}}};
   background-color: {{{ColorBg|#0091cb}}};
   border: 3px solid {{{ColorBorder|#005ca7}}};
   border: 3px solid {{{ColorBorder|transparent}}};
   padding: 3px;
   padding: 3px;
   border-radius: 16px;
   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;
    {{#ifexpr: {{#var:prevCount|0}} <= 0 | visibility: hidden; |}}
     background-color: {{{ColorFg|#b3dfef}}};
     background-color: {{{ColorFg|#b3dfef}}};
     border-top-left-radius: 10px;
     border-top-left-radius: 4px;
     border-bottom-left-radius: 10px;
     border-bottom-left-radius: 4px;
     padding: .2rem .5rem;
     padding: .2rem .5rem;
     color: {{{ColorFgText|#000}}};"><!--
     color: {{{ColorFgText|#fff}}};"><!--
       -->{{#forargs: PrevName
       -->{{#forargs: PrevName
         | key
         | key
Line 23: Line 34:
           <div style="flex: none; min-width: 2rem; max-width: 2rem; text-align: left;"><!--
           <div style="flex: none; min-width: 2rem; max-width: 2rem; text-align: left;"><!--
             -->{{#if:{{{PrevLink{{#var:key}}|}}}
             -->{{#if:{{{PrevLink{{#var:key}}|}}}
               | [[{{{PrevLink{{#var:key}}|}}}|<font color="{{{ColorFgText|#000}}}">←</font>]]
               | [[{{{PrevLink{{#var:key}}|}}}|<font color="{{{ColorFgText|#fff}}}">{{{TextPrev|}}}</font>]]
               | ←
               | {{{TextPrev|←}}}
             }}<!--
             }}<!--
           --></div>
           --></div>
           <div style="flex: auto; text-align: right;"><!--
           <div style="flex: auto; text-align: right;"><!--
             --><i>{{{PrevNum{{#var:key}}|}}}:{{#if:{{{PrevLink{{#var:key}}|}}}
             --><i>{{{PrevNum{{#var:key}}|}}}{{{TextColon|}}}{{#if:{{{PrevLink{{#var:key}}|}}}
               | [[{{{PrevLink{{#var:key}}|}}}|{{#var:value}}]]
               | [[{{{PrevLink{{#var:key}}|}}}|<font color="{{{ColorFgText|#fff}}}">{{#var:value}}</font>]]
               | {{#var:value}}
               | {{#var:value}}
             }}</i><!--
             }}</i><!--
Line 40: Line 51:
     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: {{{ColorBg|#0091cb}}};
     padding: .2rem .5rem;
     padding: .2rem .5rem;
     text-align: center;
     text-align: center;
     color: {{{ColorBgText|#000}}};"><!--
     color: {{{ColorBgText|#fff}}};"><!--
       --><b>{{{CurNum|}}}:{{{CurName|}}}</b><!--
       --><b>{{#if:{{{CurLink|}}}
        | [[{{{CurLink|}}}|<font color="{{{ColorBgText|#fff}}}">{{{CurName|}}}</font>]]
        | {{{CurNum|}}}{{{TextColon|}}}{{{CurName|}}}
      }}</b><!--
   --></div>
   --></div>
   <div style="
   <div style="
Line 53: Line 66:
     justify-content: center;
     justify-content: center;
     flex: 1;
     flex: 1;
    {{#ifexpr: {{#var:nextCount|0}} <= 0 | visibility: hidden; |}}
     background-color: {{{ColorFg|#b3dfef}}};
     background-color: {{{ColorFg|#b3dfef}}};
     border-top-right-radius: 10px;
     border-top-right-radius: 4px;
     border-bottom-right-radius: 10px;
     border-bottom-right-radius: 4px;
     padding: .2rem .5rem;
     padding: .2rem .5rem;
     color: {{{ColorFgText|#000}}};"><!--
     color: {{{ColorFgText|#fff}}};"><!--
       -->{{#forargs: NextName
       -->{{#forargs: NextName
         | key
         | key
Line 64: Line 78:
         <div style="display: flex;">
         <div style="display: flex;">
           <div style="flex: auto; text-align: left;"><!--
           <div style="flex: auto; text-align: left;"><!--
             --><i>{{{NextNum{{#var:key}}|}}}:{{#if:{{{NextLink{{#var:key}}|}}}
             --><i>{{{NextNum{{#var:key}}|}}}{{{TextColon|}}}{{#if:{{{NextLink{{#var:key}}|}}}
               | [[{{{NextLink{{#var:key}}|}}}|<font color="{{{ColorBgText|#000}}}">{{#var:value}}</font>]]
               | [[{{{NextLink{{#var:key}}|}}}|<font color="{{{ColorFgText|#fff}}}">{{#var:value}}</font>]]
               | {{#var:value}}
               | {{#var:value}}
             }}</i><!--
             }}</i><!--
Line 71: Line 85:
           <div style="flex: none; min-width: 2rem; max-width: 2rem; text-align: right;"><!--
           <div style="flex: none; min-width: 2rem; max-width: 2rem; text-align: right;"><!--
             -->{{#if:{{{NextLink{{#var:key}}|}}}
             -->{{#if:{{{NextLink{{#var:key}}|}}}
               | [[{{{NextLink{{#var:key}}|}}}|<font color="{{{ColorFgText|#000}}}">→</font>]]
               | [[{{{NextLink{{#var:key}}|}}}|<font color="{{{ColorFgText|#fff}}}">{{{TextNext|}}}</font>]]
               | →
               | {{{TextNext|→}}}
             }}<!--
             }}<!--
           --></div>
           --></div>

Latest revision as of 11:59, 21 October 2022