|
|
| Zeile 1: |
Zeile 1: |
| $(document).ready(function() {
| |
| var count = 0;
| |
|
| |
|
| // Rechteck erstellen
| | <div style="font-family: 'Fredoka One'; text-align: center; margin-top: 5px; font-size: 64px; color: black;"> |
| var rectButton = $('<div></div>')
| | Wiki<span style="color:#ff6666;">4</span><span style="background: linear-gradient(to right, green, lightblue); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">Life</span> |
| .css({
| | </div> |
| 'width': '400px',
| |
| 'height': '200px',
| |
| 'background-color': 'rgba(0,0,0,0)', // unsichtbar
| |
| 'display': 'flex',
| |
| 'justify-content': 'center',
| |
| 'align-items': 'center',
| |
| 'cursor': 'pointer',
| |
| 'border-radius': '8px',
| |
| 'user-select': 'none',
| |
| 'margin': '20px auto',
| |
| 'text-align': 'center'
| |
| });
| |
| | |
| // Richtext HTML als String behalten
| |
| function getRichText(count) {
| |
| return `<div style="font-family: 'Fredoka One'; font-size: 48px; color: black;">
| |
| Wiki<span style="color:#ff6666;">4</span>
| |
| <span style="background: linear-gradient(to right, green, lightblue); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">Life</span>
| |
| <br>Clicks: ${count}
| |
| </div>`;
| |
| }
| |
| | |
| rectButton.html(getRichText(count));
| |
| | |
| // Klick-Event
| |
| rectButton.click(function() {
| |
| count++;
| |
| rectButton.html(getRichText(count));
| |
| });
| |
| | |
| // Auf der Seite mittig einfügen
| |
| $('body').prepend(rectButton);
| |
| });
| |