|
| 1 | + |
| 2 | + |
| 3 | +<editors-hdr> |
| 4 | + |
| 5 | + <template shadowrootmode=open> |
| 6 | + |
| 7 | + <style> |
| 8 | + |
| 9 | + section |
| 10 | + {margin:0;box-sizing:border-box;display:flex;align-items:center; |
| 11 | + gap:10px; |
| 12 | + } |
| 13 | + |
| 14 | + .icon |
| 15 | + {cursor:pointer;border-radius:3px;border:1px solid gray;box-sizing:border-box; |
| 16 | + width:38px;height:38px; |
| 17 | + } |
| 18 | + |
| 19 | + .item |
| 20 | + {display:inline-flex;align-items:center;text-align:center;background:buttonface; |
| 21 | + border-radius:3px;border:1px solid lightgray;padding:5px 7px; |
| 22 | + } |
| 23 | + |
| 24 | + .item-label |
| 25 | + {} |
| 26 | + |
| 27 | + ::slotted(.title) |
| 28 | + {text-align:center;position:absolute;left:0;right:0;top:0px;z-index:-1;margin:0 auto; |
| 29 | + } |
| 30 | + |
| 31 | + |
| 32 | + .date |
| 33 | + {position:absolute;top:5px;right:5px;} |
| 34 | + |
| 35 | + a |
| 36 | + {color:blue;} |
| 37 | + a:visited |
| 38 | + {color:blue;} |
| 39 | + |
| 40 | + ::slotted(.visually-hidden) |
| 41 | + {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0} |
| 42 | + |
| 43 | + |
| 44 | + </style> |
| 45 | + |
| 46 | + <section> |
| 47 | + |
| 48 | + <div class=item> |
| 49 | + |
| 50 | + <a id=home class=item-label href='/'> |
| 51 | + home |
| 52 | + </a> |
| 53 | + |
| 54 | + <top-menu component=grp v2.0></top-menu> |
| 55 | + |
| 56 | + </div> |
| 57 | + |
| 58 | + <slot></slot> |
| 59 | + |
| 60 | + <slot name=seo-hdr class=visually-hidden></slot> |
| 61 | + |
| 62 | + <div class=date> |
| 63 | + <slot name=date></slot> |
| 64 | + </div> |
| 65 | + |
| 66 | + </section> |
| 67 | + |
| 68 | + </template> |
| 69 | + |
| 70 | + |
| 71 | + <script> |
| 72 | + |
| 73 | +(function editors_hdr({mod,dom,host}){ |
| 74 | + |
| 75 | + var obj = { |
| 76 | + version : 'v2.0' |
| 77 | + }; |
| 78 | + |
| 79 | + var df=false,did='hdr' |
| 80 | + ; |
| 81 | + |
| 82 | + var ext,$,menu |
| 83 | + ; |
| 84 | + |
| 85 | + obj.initmod = function(params){ |
| 86 | + |
| 87 | + ext = params.ext; |
| 88 | + $ = params.$; |
| 89 | + menu = params.menu; |
| 90 | + |
| 91 | + }//initmod |
| 92 | + |
| 93 | + |
| 94 | + //: |
| 95 | + |
| 96 | + |
| 97 | + var top; |
| 98 | + |
| 99 | + |
| 100 | + obj.init = async function(){ |
| 101 | + debug('init',obj.version); |
| 102 | + top = mod['top-menu']; |
| 103 | + |
| 104 | + top.initmod({ext,$,menu}); |
| 105 | + |
| 106 | + await top.init(); |
| 107 | + |
| 108 | + |
| 109 | + }//init |
| 110 | + |
| 111 | + |
| 112 | + //: |
| 113 | + |
| 114 | + |
| 115 | + obj.initdom = function(rootnode){ |
| 116 | + |
| 117 | + var shadow = host.shadowRoot; |
| 118 | + |
| 119 | + top.initdom(shadow); |
| 120 | + |
| 121 | + |
| 122 | + }//initdom |
| 123 | + |
| 124 | + |
| 125 | + //: |
| 126 | + |
| 127 | + |
| 128 | + function debug(){ |
| 129 | + |
| 130 | + if(!df && !obj.df)return; |
| 131 | + var str = [...arguments].join(' '); |
| 132 | + console.log(`[ ${did} ]`,str); |
| 133 | + |
| 134 | + }//debug |
| 135 | + |
| 136 | + |
| 137 | + return obj; |
| 138 | + |
| 139 | +})//editors-hdr |
| 140 | + |
| 141 | + |
| 142 | + </script> |
| 143 | + |
| 144 | +</editors-hdr> |
| 145 | + |
0 commit comments