|
1 | | -{{ $title := .Get "title" }} |
2 | | -{{ $link := .Get "link" }} |
3 | | -{{ $timer := .Get "timer" | default "false" }} |
4 | | -{{ $showbutton := .Get "showbutton" | default "true" }} |
5 | | - |
6 | | -{{ if eq $timer "true" }} |
| 1 | +{{ $title := .Get "title" }} {{ $link := .Get "link" }} {{ $timer := .Get |
| 2 | +"timer" | default "false" }} {{ $showbutton := .Get "showbutton" | default |
| 3 | +"true" }} {{ if eq $timer "true" }} |
7 | 4 | <div class="timer-container"> |
8 | | - {{/* {{ if eq $showbutton "true" }} |
| 5 | + {{/* {{ if eq $showbutton "true" }} |
9 | 6 | <button class="timer-btn" data-link="{{ $link }}">{{ $title }}</button> |
10 | | - {{ end }} */}} |
| 7 | + {{ end }} */}} |
11 | 8 | <span class="timer-label"></span> |
12 | 9 | <progress class="timer-progress" value="0" max="20"></progress> |
13 | 10 | </div> |
14 | 11 |
|
15 | 12 | {{ else if eq $showbutton "true" }} |
16 | | - <a href="{{ $link }}" class="timer-btn"> |
17 | | - {{ $title }} |
18 | | - </a> |
| 13 | +<a href="{{ $link }}" class="timer-btn"> {{ $title }} </a> |
19 | 14 | {{ end }} |
20 | 15 |
|
21 | 16 | <script> |
|
48 | 43 | var progress = document.querySelector(".timer-progress"); |
49 | 44 | var link = "{{ $link }}"; |
50 | 45 | var countdown = 20; |
51 | | - label.textContent = " Redirecting in " + countdown + "s..."; |
| 46 | + label.textContent = " Downloading in " + countdown + "s..."; |
52 | 47 | progress.value = 0; |
53 | 48 | var timer = setInterval(function () { |
54 | 49 | countdown--; |
55 | | - label.textContent = " Redirecting in " + countdown + "s..."; |
| 50 | + label.textContent = " Downloading in " + countdown + "s..."; |
56 | 51 | progress.value = 20 - countdown; |
57 | 52 | if (countdown <= 0) { |
58 | 53 | clearInterval(timer); |
|
62 | 57 | }); |
63 | 58 | </script> |
64 | 59 |
|
65 | | - |
66 | 60 | <style> |
67 | 61 | .timer-btn { |
68 | 62 | margin-top: 1.5rem; |
|
77 | 71 | text-decoration: none; |
78 | 72 | text-align: center; |
79 | 73 | width: -webkit-fill-available; |
| 74 | + font-size: 1.2rem; |
80 | 75 | } |
81 | 76 | .timer-btn:disabled { |
82 | 77 | background: #aaa; |
83 | 78 | cursor: not-allowed; |
84 | 79 | } |
85 | 80 | .timer-label { |
86 | 81 | margin-top: 1.5rem; |
| 82 | + margin-bottom: 1.5rem; |
87 | 83 | margin-left: 10px; |
88 | 84 | color: #333; |
89 | 85 | font-weight: bold; |
90 | 86 | display: block; |
91 | 87 | text-align: center; |
| 88 | + font-size: 1.5rem; |
92 | 89 | } |
93 | 90 |
|
94 | 91 | .timer-progress { |
|
98 | 95 | appearance: none; |
99 | 96 | background-color: #e0e0e0; |
100 | 97 | overflow: hidden; |
| 98 | + margin-bottom: 1.5rem; |
101 | 99 | } |
102 | 100 | .timer-progress::-webkit-progress-bar { |
103 | 101 | background-color: #e0e0e0; |
|
0 commit comments