Skip to content

Commit 861f732

Browse files
Merge pull request #27 from technikhil314/develop
2 parents 51779f4 + eea81d1 commit 861f732

File tree

7 files changed

+379
-110
lines changed

7 files changed

+379
-110
lines changed

components/RTStickyCopyButton.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
'bg-gray-100 dark:bg-gray-600': !copied,
77
'bg-green-500': copied,
88
}"
9+
:aria-label="ariaLabel"
910
@click="handleClick"
1011
>
1112
<svg
@@ -49,6 +50,10 @@ export default {
4950
type: Function,
5051
default: () => {},
5152
},
53+
ariaLabel: {
54+
type: String,
55+
default: 'Copy to clipboard',
56+
},
5257
},
5358
data() {
5459
return {

components/navbar.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</div>
4747

4848
<div class="flex items-center justify-between flex-1">
49-
<div class="items-center">
49+
<div class="items-center w-1/2">
5050
<a
5151
href="https://github.com/technikhil314/offline-diff-viewer/stargazers"
5252
title="github stars on this open source project"
@@ -58,15 +58,16 @@
5858
</a>
5959
<slot name="left" />
6060
</div>
61-
<div class="items-center">
61+
<div class="flex items-center justify-end w-1/2 gap-4">
6262
<slot name="right" />
6363
<button
6464
type="button"
6565
class="inline-flex items-center justify-center ml-4 bg-transparent border-2 border-gray-700 rounded-full shadow-lg w-9 h-9 active:scale-y-75"
66+
aria-label="Toggle Dark Mode"
6667
@click="toggleDarkMode"
6768
>
6869
<svg
69-
v-if="!darkMode"
70+
v-if="darkMode"
7071
fill="none"
7172
stroke="currentColor"
7273
class="w-6 h-6"
@@ -81,7 +82,7 @@
8182
></path>
8283
</svg>
8384
<svg
84-
v-if="darkMode"
85+
v-if="!darkMode"
8586
fill="none"
8687
class="w-6 h-6"
8788
stroke="currentColor"

helpers/isSkipScrollInSyncTutorial.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default function () {
2+
const cookies = document.cookie.split(';')
3+
const cookieMap: {
4+
isSkipScrollInSyncTutorial?: string
5+
} = {
6+
isSkipScrollInSyncTutorial: 'false',
7+
}
8+
cookies.forEach((element) => {
9+
const [name, val] = element.split('=')
10+
const trimmedName = name.trim()
11+
if (trimmedName === 'isSkipScrollInSyncTutorial') {
12+
cookieMap[trimmedName] = val
13+
}
14+
})
15+
return cookieMap.isSkipScrollInSyncTutorial === 'true'
16+
}

pages/index.vue

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
type="text"
2323
class="flex-1 flex-grow-0 w-full bg-transparent rounded-md"
2424
placeholder="Add label to this text block"
25+
value="Original Text"
2526
/>
27+
<span class="sr-only"
28+
>Add label to this original text bloack</span
29+
>
2630
</label>
2731
<textarea
2832
id="lhs"
@@ -32,13 +36,19 @@
3236
></textarea>
3337
</div>
3438
<div class="flex flex-col w-1/2 gap-4">
35-
<input
36-
id="rhsLabel"
37-
name="rhsLabel"
38-
type="text"
39-
class="flex-1 flex-grow-0 w-full bg-transparent rounded-md"
40-
placeholder="Add label to this text block"
41-
/>
39+
<label for="lhsLabel" class="relative">
40+
<input
41+
id="rhsLabel"
42+
name="rhsLabel"
43+
type="text"
44+
class="flex-1 flex-grow-0 w-full bg-transparent rounded-md"
45+
placeholder="Add label to this text block"
46+
value="Changed text"
47+
/>
48+
<span class="sr-only"
49+
>Add label to this original text bloack</span
50+
>
51+
</label>
4252
<textarea
4353
id="rhs"
4454
rows="28"
@@ -50,6 +60,7 @@
5060
<div class="self-end flex-grow-0 w-full text-center">
5161
<button
5262
class="inline-flex items-center justify-center w-48 px-4 py-2 transition-transform transform bg-blue-600 rounded-md shadow-lg outline-none text-gray-50 focus:ring-4 active:scale-y-75"
63+
aria-label="Click here to compare the inputted text blocks"
5364
>
5465
Compare
5566
</button>
@@ -78,26 +89,27 @@ export default Vue.extend({
7889
const driver = new Driver({
7990
closeBtnText: 'Skip',
8091
className: 'dark:filter dark:invert',
81-
stageBackground: this.isDarkMode ? 'hsl(221deg 30% 70%)' : '#ffffff',
92+
stageBackground: this.isDarkMode
93+
? 'hsl(221deg 50% 90% / 0.5)'
94+
: '#ffffff',
8295
onReset: () => {
8396
document.cookie = 'isSkipTutorial=true; max-age=31536000; path=/;'
8497
},
8598
})
86-
// Define the steps for introduction
8799
if (!this.isSkipTutorial) {
88100
driver.defineSteps([
89101
{
90102
element: '#lhsLabel',
91103
popover: {
92104
title: 'New feature',
93-
description: 'Now you can add labels to text blocks',
105+
description: 'Now you can add custom labels to text blocks',
94106
},
95107
},
96108
{
97109
element: '#rhsLabel',
98110
popover: {
99111
title: 'New feature',
100-
description: 'Now you can add labels to text blocks',
112+
description: 'Now you can add custom labels to text blocks',
101113
},
102114
},
103115
])

0 commit comments

Comments
 (0)