|
8 | 8 | py-2 |
9 | 9 | mb-4 |
10 | 10 | sticky |
11 | | - top-[80px] |
| 11 | + top-[70px] |
12 | 12 | dark:bg-gray-700 |
13 | 13 | bg-gray-300 |
14 | 14 | dark:bg-opacity-50 |
|
43 | 43 | <div id="nextDiffSection" class="inline-flex items-center gap-1"> |
44 | 44 | <button |
45 | 45 | id="nextDiff" |
46 | | - class="inline-flex items-center justify-center px-1 py-1 text-sm text-gray-600 transition-transform transform bg-gray-300 border border-gray-800 rounded-sm outline-none dark:border-gray-400 dark:text-white dark:bg-gray-800 align-center focus:ring-4 active:scale-y-75" |
| 46 | + class="inline-flex items-center justify-center px-1 py-1 text-sm text-gray-600 transition-transform transform bg-gray-300 border border-gray-800 rounded-sm outline-none dark:border-gray-400 dark:text-white dark:bg-gray-800 align-center focus:ring-4 active:scale-y-75 hover:scale-105 hover:shadow-lg" |
47 | 47 | aria-label="Go to next diff" |
48 | 48 | type="button" |
49 | 49 | @click="goToNextDiff" |
|
68 | 68 | <div id="prevDiffSection" class="inline-flex items-center gap-1"> |
69 | 69 | <button |
70 | 70 | id="prevDiff" |
71 | | - class="inline-flex items-center justify-center px-1 py-1 text-sm text-gray-600 transition-transform transform bg-gray-300 border border-gray-800 rounded-sm outline-none dark:border-gray-400 dark:text-white dark:bg-gray-800 align-center focus:ring-4 active:scale-y-75" |
| 71 | + class="inline-flex items-center justify-center px-1 py-1 text-sm text-gray-600 transition-transform transform bg-gray-300 border border-gray-800 rounded-sm outline-none dark:border-gray-400 dark:text-white dark:bg-gray-800 align-center focus:ring-4 active:scale-y-75 hover:scale-105 hover:shadow-lg" |
72 | 72 | aria-label="Go to previous diff" |
73 | 73 | type="button" |
74 | 74 | @click="goToPreviousDiff" |
|
94 | 94 | <div> |
95 | 95 | <button |
96 | 96 | type="button" |
97 | | - class="inline-flex items-center justify-center gap-1 p-2 text-sm transition-transform transform rounded-md shadow outline-none justify-self-end focus:ring-4 active:scale-y-75" |
| 97 | + class="inline-flex items-center justify-center gap-1 p-2 text-sm transition-transform transform rounded-md shadow outline-none justify-self-end focus:ring-4 active:scale-y-75 hover:scale-105 hover:shadow-lg copy-uri-button" |
98 | 98 | aria-label="Copy url to clipboard" |
99 | 99 | :class="{ |
100 | 100 | 'bg-blue-500 text-white': !copied, |
|
142 | 142 | </template> |
143 | 143 |
|
144 | 144 | <script> |
| 145 | +import { putToClipboard } from '~/helpers/utils' |
145 | 146 | export default { |
146 | 147 | data() { |
147 | 148 | return { |
@@ -181,32 +182,12 @@ export default { |
181 | 182 | } |
182 | 183 | }, |
183 | 184 | methods: { |
184 | | - putToClipboard(textToPut, toastContent) { |
185 | | - navigator.clipboard.writeText(textToPut) |
186 | | - this.$store.commit('toast/show', { |
187 | | - show: true, |
188 | | - content: toastContent, |
189 | | - iconHTML: ` |
190 | | - <svg |
191 | | - class="w-6 h-6" |
192 | | - fill="none" |
193 | | - stroke="currentColor" |
194 | | - viewBox="0 0 24 24" |
195 | | - xmlns="http://www.w3.org/2000/svg" |
196 | | - > |
197 | | - <path |
198 | | - stroke-linecap="round" |
199 | | - stroke-linejoin="round" |
200 | | - stroke-width="2" |
201 | | - d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" |
202 | | - ></path> |
203 | | - </svg> |
204 | | - `, |
205 | | - theme: 'success', |
206 | | - }) |
207 | | - }, |
208 | 185 | copyUrlToClipboard() { |
209 | | - this.putToClipboard(window.location.href, 'Link copied to your clipboard') |
| 186 | + putToClipboard( |
| 187 | + window.location.href, |
| 188 | + 'Link copied to your clipboard', |
| 189 | + this.$store |
| 190 | + ) |
210 | 191 | this.copied = true |
211 | 192 | setTimeout(() => { |
212 | 193 | this.copied = false |
@@ -262,3 +243,8 @@ export default { |
262 | 243 | }, |
263 | 244 | } |
264 | 245 | </script> |
| 246 | +<style lang="scss"> |
| 247 | +.copy-uri-button:hover svg { |
| 248 | + @apply rotate-12; |
| 249 | +} |
| 250 | +</style> |
0 commit comments