4
4
<template #right >
5
5
<button
6
6
type =" button"
7
- class =" inline-flex justify-center px-4 py-2 transition-transform transform rounded-md shadow outline-none copy-uri-button align-center focus:ring-4 active:scale-y-75"
7
+ class ="
8
+ inline-flex
9
+ justify-center
10
+ px-4
11
+ py-2
12
+ transition-transform
13
+ transform
14
+ rounded-md
15
+ shadow
16
+ outline-none
17
+ copy-uri-button
18
+ align-center
19
+ focus:ring-4
20
+ active:scale-y-75
21
+ "
8
22
:class =" {
9
23
'bg-blue-500 text-white': !copied,
10
24
'bg-green-500 text-gray-800': copied,
49
63
</template >
50
64
</Navbar >
51
65
<main >
52
- <div
53
- class =" flex items-stretch w-full gap-4 font-mono text-gray-800 dark:text-gray-50"
66
+ <section
67
+ class ="
68
+ flex
69
+ items-stretch
70
+ w-full
71
+ gap-4
72
+ font-mono
73
+ text-gray-800
74
+ dark:text-gray-50
75
+ "
54
76
>
55
- <div
56
- class =" relative flex-1 px-4 py-2 overflow-y-auto border-2 rounded-md dark:border-gray-500 max-h-screen--nav line-number-gutter min-h-80"
57
- >
58
- <RTStickyCopyButton :click-handler =" copyTextToClipboard" />
77
+ <div class =" flex flex-col w-1/2 gap-2" >
78
+ <p class =" flex-grow-0 text-lg" >{{ lhsLabel }}</p >
59
79
<div
60
- v-for =" (lineDiff, index) in lhsDiff"
61
- :key =" index"
62
- :class =" {
63
- 'bg-red-100 dark:bg-yellow-700': lineDiff.includes('isModified'),
64
- }"
80
+ class ="
81
+ relative
82
+ flex-1
83
+ px-4
84
+ py-2
85
+ overflow-y-auto
86
+ border-2
87
+ rounded-md
88
+ dark:border-gray-500
89
+ max-h-screen--nav
90
+ line-number-gutter
91
+ min-h-80
92
+ "
65
93
>
66
- <p class =" break-all whitespace-pre-wrap" v-html =" lineDiff" ></p >
94
+ <RTStickyCopyButton :click-handler =" copyTextToClipboard" />
95
+ <div
96
+ v-for =" (lineDiff, index) in lhsDiff"
97
+ :key =" index"
98
+ :class =" {
99
+ 'bg-red-200 dark:bg-red-800': lineDiff.includes('isModified'),
100
+ }"
101
+ >
102
+ <p class =" break-all whitespace-pre-wrap" >
103
+ <span v-html =" lineDiff" ></span >
104
+ </p >
105
+ </div >
67
106
</div >
68
107
</div >
69
- <div
70
- class =" relative flex-1 px-4 py-2 overflow-y-auto border-2 rounded-md dark:border-gray-500 min-h-80 line-number-gutter max-h-screen--nav"
71
- >
72
- <RTStickyCopyButton :click-handler =" copyTextToClipboard" />
108
+
109
+ <div class =" flex flex-col w-1/2 gap-2" >
110
+ <p class =" flex-grow-0 text-lg" >{{ rhsLabel }}</p >
73
111
<div
74
- v-for =" (lineDiff, index) in rhsDiff"
75
- :key =" index"
76
- :class =" {
77
- 'bg-green-100 dark:bg-green-700': lineDiff.includes('isModified'),
78
- }"
112
+ class ="
113
+ relative
114
+ flex-1
115
+ px-4
116
+ py-2
117
+ overflow-y-auto
118
+ border-2
119
+ rounded-md
120
+ dark:border-gray-500
121
+ min-h-80
122
+ line-number-gutter
123
+ max-h-screen--nav
124
+ "
79
125
>
80
- <p class =" break-all whitespace-pre-wrap" v-html =" lineDiff" ></p >
126
+ <RTStickyCopyButton :click-handler =" copyTextToClipboard" />
127
+ <div
128
+ v-for =" (lineDiff, index) in rhsDiff"
129
+ :key =" index"
130
+ :class =" {
131
+ 'bg-green-200 dark:bg-green-700':
132
+ lineDiff.includes('isModified'),
133
+ }"
134
+ >
135
+ <p class =" break-all whitespace-pre-wrap" >
136
+ <span v-html =" lineDiff" ></span >
137
+ </p >
138
+ </div >
81
139
</div >
82
140
</div >
83
- </div >
141
+ </section >
84
142
</main >
85
143
<Footer />
86
144
</div >
89
147
<script >
90
148
import pako from ' pako'
91
149
import { undoUrlSafeBase64 , escapeHtml } from ' ../helpers/utils'
92
- import footer from ' ~/components/footer.vue'
150
+ import Footer from ' ~/components/footer.vue'
93
151
export default {
94
- components: { footer },
152
+ components: { Footer },
95
153
layout: ' main' ,
96
154
data () {
97
155
return {
98
156
lhsDiff: this .lhsDiff ,
99
157
rhsDiff: this .rhsDiff ,
158
+ rhsLabel: this .rhsLabel ,
159
+ lhsLabel: this .lhsLabel ,
100
160
copied: false ,
101
161
}
102
162
},
@@ -109,7 +169,7 @@ export default {
109
169
const hunkState = item[0 ]
110
170
if (hunkState === - 1 || hunkState === 0 ) {
111
171
const className =
112
- hunkState === - 1 ? ' isModified bg-red-300 dark:bg-yellow-900 ' : ' '
172
+ hunkState === - 1 ? ' isModified bg-red-300 dark:bg-red-500 ' : ' '
113
173
return ` <span class="break-all inline p-0 m-0 ${ className} ">${ escapeHtml (
114
174
item[1 ]
115
175
)} </span>`
@@ -124,7 +184,7 @@ export default {
124
184
const hunkState = item[0 ]
125
185
if (hunkState === 1 || hunkState === 0 ) {
126
186
const className =
127
- hunkState === 1 ? ' isModified bg-green-300 dark:bg-green-900' : ' '
187
+ hunkState === 1 ? ' isModified bg-green-400 dark:bg-green-900' : ' '
128
188
return ` <span class="break-all inline p-0 m-0 ${ className} ">${ escapeHtml (
129
189
item[1 ]
130
190
)} </span>`
@@ -188,6 +248,9 @@ export default {
188
248
</script >
189
249
190
250
<style lang="scss">
251
+ ::selection {
252
+ @apply bg-gray-800 text-gray-300 dark :bg- gray- 200 dark :text- gray- 800;
253
+ }
191
254
.copy-uri-button :hover {
192
255
@apply shadow-lg ;
193
256
svg {
@@ -203,31 +266,24 @@ export default {
203
266
& ::before {
204
267
content : ' ' ;
205
268
width : var (--line-number-gutter-width );
206
- @apply bg-gray-200 dark :bg- gray- 700 inline-block left- 0 top- 0 bottom- 0 absolute text- sm;
269
+ @apply bg-gray-300 dark :bg- gray- 700 inline-block left- 0 top- 0 bottom- 0 absolute text- sm;
207
270
}
208
271
@apply relative ;
209
272
p {
210
273
padding-left : calc (var (--line-number-gutter-width ) - 10px );
211
274
line-height : 1.65 ;
212
275
@apply relative ;
213
276
& :hover {
214
- @apply bg-gray-200 dark :bg- gray- 700;
277
+ @apply bg-gray-200 dark :bg- gray- 600;
278
+ span {
279
+ @apply dark :mix- blend- hard- light dark :bg- blend- multiply;
280
+ }
215
281
}
216
282
& ::before {
217
283
counter-increment : line- numbers;
218
284
content : counter (line-numbers );
219
285
width : var (--line-number-gutter-width );
220
- @apply absolute left-0 top- [2px ] -mx- 4 bottom-0 text-center bg-gray-200 dark :bg- gray- 700 dark :text- gray- 50 text- gray- 500 flex justify- center text- sm;
221
- }
222
- & :first-of-type {
223
- & ::before {
224
- @apply -mt- 2 pt- 2;
225
- }
226
- }
227
- & :last-of-type {
228
- & ::before {
229
- @apply -mb- 2 pb- 2;
230
- }
286
+ @apply absolute left-0 top-0 -mx- 4 bg-gray-200 dark :bg- gray- 700 dark :text- gray- 50 text- gray- 500 inline-flex justify- center items- center text- sm h- full;
231
287
}
232
288
}
233
289
}
0 commit comments