|
18 | 18 | * Set link=none to disable the link |
19 | 19 | * hidebutton=on Show an X close button (default: on) |
20 | 20 | * Set hidebutton=off to hide the close button |
| 21 | + * animation=on Add animation to border of banner (default: on) |
| 22 | + * Set animation=off to disable |
21 | 23 | */ |
22 | 24 | (function () { |
23 | 25 | "use strict"; |
|
136 | 138 | "0px 3px 0px #751111," + |
137 | 139 | "0px 4px 0px #5e0d0d," + |
138 | 140 | "0px 6px 10px rgba(0,0,0,0.5);" + |
139 | | - "animation:kao-pulse 2s infinite;" + |
140 | 141 | "padding:0.5rem 2.5rem;" + |
141 | 142 | "line-height:1.6;" + |
142 | 143 | "box-sizing:border-box;" + |
|
159 | 160 | "0px 1px 0px #9e1a1a," + |
160 | 161 | "0px 2px 0px #8a1515," + |
161 | 162 | "0px 3px 5px rgba(0,0,0,0.4);" + |
162 | | - "animation:kao-pulse 2s infinite;" + |
163 | 163 | "padding:0.25rem 1.5rem;" + |
164 | 164 | "line-height:1.4;" + |
165 | 165 | "box-sizing:border-box;" + |
|
205 | 205 | "line-height:1;" + |
206 | 206 | "text-shadow:none;" + |
207 | 207 | "}" + |
208 | | - ".kao-banner-close:hover{opacity:1;}" + |
| 208 | + ".kao-banner-close:hover{opacity:1;}"; |
| 209 | + |
| 210 | + var cssKaoPulse = |
| 211 | + ".kao-banner { animation:kao-pulse 2s infinite; }" + |
209 | 212 | "@keyframes kao-pulse{" + |
210 | 213 | "0%{box-shadow:0 0 0 0 rgba(211,47,47,0.7)}" + |
211 | 214 | "70%{box-shadow:0 0 0 15px rgba(211,47,47,0)}" + |
212 | 215 | "100%{box-shadow:0 0 0 0 rgba(211,47,47,0)}" + |
213 | 216 | "}"; |
214 | 217 |
|
215 | 218 | var style = document.createElement("style"); |
216 | | - style.textContent = (size === "mini" ? cssMini : size === "minimal" ? cssMinimal : cssNormal) + cssCommon; |
| 219 | + style.textContent = (size === "mini" ? cssMini : size === "minimal" ? cssMinimal : cssNormal) |
| 220 | + + (params.animation === "off" ? "" : cssKaoPulse) |
| 221 | + + cssCommon; |
217 | 222 | document.head.appendChild(style); |
218 | 223 |
|
219 | 224 | // ── Check if previously dismissed (reappears after dismissDays) ───── |
|
0 commit comments