@instadapp/avocado-base 0.0.59 → 0.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AuthorityAvatar.vue +12 -0
- package/nuxt.config.ts +0 -2
- package/package.json +1 -2
- package/utils/helper.ts +0 -11
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import * as XXH from 'xxhashjs';
|
|
3
|
+
|
|
2
4
|
defineProps<{
|
|
3
5
|
address: string
|
|
4
6
|
}>();
|
|
5
7
|
|
|
6
8
|
const randomId = Math.random().toString(36).substr(2, 9);
|
|
9
|
+
|
|
10
|
+
export function generateColor(address: string): string {
|
|
11
|
+
const hash = XXH.h32(address, 0xABCD).toNumber()
|
|
12
|
+
|
|
13
|
+
const hue = hash % 360
|
|
14
|
+
const saturation = 80 + (hash % 30)
|
|
15
|
+
const lightness = 70 + (hash % 20)
|
|
16
|
+
|
|
17
|
+
return `hsl(${hue}, ${saturation}%, ${lightness}%)`
|
|
18
|
+
}
|
|
7
19
|
</script>
|
|
8
20
|
|
|
9
21
|
<template>
|
package/nuxt.config.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
2
|
import ViteComponents from "unplugin-vue-components/vite";
|
|
3
|
-
import requireTransform from 'vite-plugin-require-transform'
|
|
4
3
|
|
|
5
4
|
export default defineNuxtConfig({
|
|
6
5
|
modules: ["@nuxtjs/tailwindcss", "nuxt-svgo", "@vueuse/nuxt"],
|
|
@@ -13,7 +12,6 @@ export default defineNuxtConfig({
|
|
|
13
12
|
},
|
|
14
13
|
vite: {
|
|
15
14
|
plugins: [
|
|
16
|
-
requireTransform({}),
|
|
17
15
|
ViteComponents({
|
|
18
16
|
dts: true,
|
|
19
17
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instadapp/avocado-base",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.60",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"types": "global.d.ts",
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"rimraf": "^3.0.2",
|
|
22
22
|
"typechain": "^8.1.1",
|
|
23
23
|
"unplugin-vue-components": "^0.25.1",
|
|
24
|
-
"vite-plugin-require-transform": "^1.0.21",
|
|
25
24
|
"vue-tippy": "^6.0.0"
|
|
26
25
|
},
|
|
27
26
|
"dependencies": {
|
package/utils/helper.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as XXH from 'xxhashjs';
|
|
2
|
-
|
|
3
1
|
export const indexSorter = (aIndex: number, bIndex: number) => {
|
|
4
2
|
if (aIndex === -1 && bIndex === -1) {
|
|
5
3
|
return 0; // fallback to other sorting criteria
|
|
@@ -62,12 +60,3 @@ export function formatMultipleAddresses(addresses: string[], shorten = true) {
|
|
|
62
60
|
return formattedString
|
|
63
61
|
}
|
|
64
62
|
|
|
65
|
-
export function generateColor(address: string): string {
|
|
66
|
-
const hash = XXH.h32(address, 0xABCD).toNumber()
|
|
67
|
-
|
|
68
|
-
const hue = hash % 360
|
|
69
|
-
const saturation = 80 + (hash % 30)
|
|
70
|
-
const lightness = 70 + (hash % 20)
|
|
71
|
-
|
|
72
|
-
return `hsl(${hue}, ${saturation}%, ${lightness}%)`
|
|
73
|
-
}
|