Skip to content

Commit 2946c65

Browse files
Merge pull request #183 from technikhil314/develop
Adsense, microanimations, license change
2 parents a0b8025 + 03f176b commit 2946c65

File tree

6 files changed

+131
-48
lines changed

6 files changed

+131
-48
lines changed

LICENSE

+10-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
MIT License
1+
Copyright (c) 2022 Nikhil Mehta. All rights reserved.
22

3-
Copyright (c) 2023 Nikhil Mehta
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
116

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
148

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
9+
3. All advertising materials mentioning features or use of this software must display the following acknowledgement:
10+
This product includes software developed by Nikhil Mehta.
11+
12+
4. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13+
14+
THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

components/buttons/diffStyle.vue

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<button
3-
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 dark:border-gray-400 dark:text-white dark:bg-gray-800 align-center focus-visible:ring-4 active:scale-y-75"
3+
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 dark:border-gray-400 dark:text-white dark:bg-gray-800 align-center focus-visible:ring-4 active:scale-y-75"
44
role="button"
55
:aria-label="label"
66
:title="label"
@@ -20,8 +20,8 @@
2020
</template>
2121

2222
<script lang="ts">
23-
import Vue from 'vue'
24-
import DiffStyle from '~/components/icons/diffStyle.vue'
23+
import Vue from "vue";
24+
import DiffStyle from "~/components/icons/diffStyle.vue";
2525
export default Vue.extend({
2626
components: { DiffStyle },
2727
props: {
@@ -33,21 +33,21 @@ export default Vue.extend({
3333
data() {
3434
return {
3535
sideBySide: true,
36-
}
36+
};
3737
},
3838
computed: {
3939
label() {
4040
if (this.sideBySide) {
41-
return 'Switch unified diff layout'
41+
return "Switch to unified diff layout";
4242
}
43-
return 'Switch to split diff layout'
43+
return "Switch to split diff layout";
4444
},
4545
},
4646
methods: {
4747
handleClick() {
48-
this.sideBySide = !this.sideBySide
49-
this.clickHandler(this.sideBySide === true)
48+
this.sideBySide = !this.sideBySide;
49+
this.clickHandler(this.sideBySide === true);
5050
},
5151
},
52-
})
52+
});
5353
</script>

components/icons/prettyCode.vue

+9-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
viewBox="0 0 15 15"
44
fill="none"
55
xmlns="http://www.w3.org/2000/svg"
6-
width="15"
7-
height="15"
6+
:class="className"
87
>
98
<path
109
d="M0 7.5h2m13 0h-2m-8 7H3.5a2 2 0 01-2-2v-10a2 2 0 012-2H5m5 14h1.5a2 2 0 002-2v-10a2 2 0 00-2-2H10"
@@ -14,5 +13,12 @@
1413
</template>
1514
<script lang="ts">
1615
import Vue from 'vue'
17-
export default Vue.extend({})
16+
export default Vue.extend({
17+
props: {
18+
className: {
19+
type: String,
20+
required: false,
21+
},
22+
},
23+
})
1824
</script>

nuxt.config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ export default {
7676
property: 'og:url',
7777
content: `${BASE_URL}/128x128.png`,
7878
},
79+
{
80+
name: 'google-adsense-account',
81+
content: 'ca-pub-4467877923505914',
82+
},
7983
],
8084
link: [
8185
{ rel: 'manifest', href: '/manifest.json' },
@@ -284,5 +288,5 @@ export default {
284288
config.devtool = 'source-map'
285289
}
286290
},
287-
}
291+
},
288292
}

pages/v2/index.vue

+67-8
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,23 @@
4343
aria-label="Beautify entered text"
4444
type="button"
4545
title="Beautify"
46-
class="absolute p-2 transition-all rounded-sm top-16 right-3 aspect-square dark:hover:bg-slate-600 dark:bg-slate-600/50 hover:bg-slate-300 bg-gray-300/50"
46+
class="
47+
absolute
48+
p-2
49+
transition-all
50+
rounded-sm
51+
top-16
52+
right-3
53+
aspect-square
54+
dark:hover:bg-slate-600 dark:bg-slate-600/50
55+
hover:bg-slate-300
56+
bg-gray-300/50
57+
"
4758
@click="
4859
lhsEditor.trigger('editor', 'editor.action.formatDocument')
4960
"
5061
>
51-
<PrettyCode />
62+
<PrettyCode class="w-4 h-4" />
5263
</button>
5364
</div>
5465
<div class="relative flex flex-col w-1/2 gap-4">
@@ -72,33 +83,81 @@
7283
aria-label="Beautify entered text"
7384
type="button"
7485
title="Beautify"
75-
class="absolute p-2 transition-all rounded-sm top-16 right-3 aspect-square dark:hover:bg-slate-600 dark:bg-slate-600/50 hover:bg-slate-300 bg-gray-300/50"
86+
class="
87+
absolute
88+
p-2
89+
transition-all
90+
rounded-sm
91+
top-16
92+
right-3
93+
aspect-square
94+
dark:hover:bg-slate-600 dark:bg-slate-600/50
95+
hover:bg-slate-300
96+
bg-gray-300/50
97+
"
7698
@click="
7799
rhsEditor.trigger('editor', 'editor.action.formatDocument')
78100
"
79101
>
80-
<PrettyCode />
102+
<PrettyCode class="w-4 h-4" />
81103
</button>
82104
</div>
83105
</section>
84106
<div class="relative flex justify-center flex-grow-0 w-full gap-4 mt-4">
85107
<button
86108
id="submitButton"
87-
class="inline-flex items-center justify-center w-40 gap-4 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"
109+
class="
110+
inline-flex
111+
items-center
112+
justify-center
113+
w-40
114+
gap-4
115+
px-4
116+
py-2
117+
transition-transform
118+
transform
119+
bg-blue-600
120+
rounded-md
121+
shadow-lg
122+
outline-none
123+
text-gray-50
124+
focus:ring-4
125+
active:scale-y-75
126+
group
127+
"
88128
aria-label="Click here to compare the inputted text blocks"
89129
>
90130
Compare
91-
<span class="w-4 aspect-square">
131+
<span class="w-4 aspect-square group-hover:animate-linear-bounce">
92132
<Forward />
93133
</span>
94134
</button>
95135
<button
96-
class="absolute right-0 inline-flex items-center justify-center gap-4 px-4 py-2 text-gray-800 transition-transform transform bg-yellow-300 rounded-md shadow-lg outline-none focus:ring-4 active:scale-y-75"
136+
class="
137+
absolute
138+
right-0
139+
inline-flex
140+
items-center
141+
justify-center
142+
gap-4
143+
px-4
144+
py-2
145+
text-gray-800
146+
transition-transform
147+
transform
148+
bg-yellow-300
149+
rounded-md
150+
shadow-lg
151+
outline-none
152+
focus:ring-4
153+
active:scale-y-75
154+
group
155+
"
97156
aria-label="Click here to clear all the inputs"
98157
type="button"
99158
@click="clear"
100159
>
101-
<span class="w-4 aspect-square">
160+
<span class="w-4 aspect-square group-hover:animate-wiggle">
102161
<Bin />
103162
</span>
104163
Clear

tailwind.config.js

+31-10
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,53 @@ module.exports = {
33
darkMode: 'class',
44
variants: {
55
extend: {
6-
boxShadow: ['dark']
6+
boxShadow: ['dark'],
77
},
88
},
99
theme: {
10+
extend: {
11+
keyframes: {
12+
'linear-bounce': {
13+
'0%, 100%': {
14+
transform: 'translateX(25%)',
15+
'animation-timing-function': 'cubic-bezier(0.8, 0, 1, 1)',
16+
},
17+
'50%': {
18+
transform: 'translateX(0)',
19+
'animation-timing-function': 'cubic-bezier(0, 0, 0.2, 1)',
20+
},
21+
},
22+
wiggle: {
23+
'0%, 100%': { transform: 'rotate(-10deg)' },
24+
'50%': { transform: 'rotate(10deg)' },
25+
},
26+
},
27+
},
1028
maxHeight: {
1129
'screen--nav': 'calc(100vh - 7rem)',
1230
},
1331
container: {
1432
center: true,
1533
},
34+
animation: {
35+
'linear-bounce': 'linear-bounce 1s linear infinite',
36+
wiggle: 'wiggle 1s linear infinite',
37+
},
1638
zIndex: {
17-
'1': 1,
18-
'2': 2,
19-
'10': 10,
20-
'11': 11
39+
1: 1,
40+
2: 2,
41+
10: 10,
42+
11: 11,
2143
},
2244
minHeight: {
23-
'80': '20rem'
45+
80: '20rem',
2446
},
2547
translate: {
2648
'-screen': '-100vh',
2749
},
2850
boxShadow: {
29-
DEFAULT: '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)',
51+
DEFAULT:
52+
'0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)',
3053
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
3154
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
3255
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
@@ -37,7 +60,5 @@ module.exports = {
3760
none: 'none',
3861
},
3962
},
40-
plugins: [
41-
require('@tailwindcss/forms'),
42-
]
63+
plugins: [require('@tailwindcss/forms')],
4364
}

0 commit comments

Comments
 (0)