@visualizevalue/mint-app-base 0.1.3 → 0.1.5

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.
@@ -5,6 +5,7 @@ textarea,
5
5
  select {
6
6
  width: 100%;
7
7
  font-family: var(--ui-font-family);
8
+ font-size: var(--ui-font-size);
8
9
  font-weight: var(--ui-font-weight);
9
10
  text-transform: var(--ui-text-transform);
10
11
  transition: all var(--speed);
@@ -62,12 +63,6 @@ select {
62
63
  &::-ms-input-placeholder {
63
64
  color: var(--border-color-light);
64
65
  }
65
-
66
- &.small {
67
- min-height: 0;
68
- font-size: var(--font-sm);
69
- padding: calc(var(--size-1) + var(--size-0)) var(--size-3);
70
- }
71
66
  }
72
67
 
73
68
  .form-item {
@@ -20,7 +20,7 @@
20
20
 
21
21
  > * {
22
22
  margin: var(--spacer-sm) 0;
23
- color: var(--muted);
23
+ color: var(--color);
24
24
 
25
25
  &:first-child {
26
26
  margin-top: 0;
@@ -2,7 +2,6 @@
2
2
 
3
3
  --rem: 16px;
4
4
  --font-base: var(--rem);
5
- --font-xs: calc(var(--font-base) * 0.8);
6
5
  --font-sm: calc(var(--font-base) * 0.8);
7
6
  --font-lg: calc(var(--font-base) * 1.2);
8
7
  --font-weight-light: 300;
@@ -1,17 +1,18 @@
1
1
  :root {
2
2
 
3
- --ui-font-family: var(--font-family);
4
- --ui-font-weight: var(--font-weight);
5
- --ui-text-transform: var(--text-transform);
3
+ --ui-font-family: var(--font-family);
4
+ --ui-font-size: var(--font-base);
5
+ --ui-font-weight: var(--font-weight);
6
+ --ui-text-transform: var(--text-transform);
7
+ --ui-letter-spacing: var(--letter-spacing);
8
+ --ui-line-height: var(--line-height);
6
9
 
7
- --ui-placeholder-color: var(--muted);
8
- --ui-color: var(--primary);
9
- --ui-color-visited: var(--primary);
10
- --ui-letter-spacing: var(--letter-spacing);
11
- --ui-line-height: var(--line-height);
10
+ --ui-color: var(--primary);
11
+ --ui-placeholder-color: var(--muted);
12
+ --ui-color-visited: var(--primary);
12
13
 
13
- --ui-padding-y: var(--spacer-sm);
14
- --ui-padding-x: var(--spacer-sm);
14
+ --ui-padding-y: var(--spacer-sm);
15
+ --ui-padding-x: var(--spacer);
15
16
 
16
17
  }
17
18
 
@@ -1,12 +1,18 @@
1
1
  <template>
2
- <header>
2
+ <header class="app-header">
3
3
  <ClientOnly>
4
4
  <Breadcrumbs :items="breadcrumbs" />
5
5
 
6
6
  <MintGasPricePopover />
7
7
 
8
8
  <Connect v-if="! isConnected" />
9
- <NuxtLink v-else :to="{ name: 'profile-address', params: { address: address?.toLowerCase() } }">
9
+ <NuxtLink v-else
10
+ :to="{
11
+ name: 'profile-address',
12
+ params: { address: address?.toLowerCase() }
13
+ }"
14
+ class="account"
15
+ >
10
16
  <Account :address="address" />
11
17
  </NuxtLink>
12
18
  </ClientOnly>
@@ -35,6 +41,16 @@ const breadcrumbs = computed(() => {
35
41
  })
36
42
  </script>
37
43
 
44
+ <style>
45
+ :root {
46
+ --app-header-font-family: var(--ui-font-family);
47
+ --app-header-font-size: var(--ui-font-size);
48
+ --app-header-font-weight: var(--ui-font-weight);
49
+ --app-header-text-transform: var(--ui-text-transform);
50
+ --app-header-letter-spacing: var(--ui-letter-spacing);
51
+ }
52
+ </style>
53
+
38
54
  <style scoped>
39
55
  header {
40
56
  height: var(--navbar-height);
@@ -44,6 +60,12 @@ header {
44
60
  gap: var(--spacer);
45
61
  padding: var(--size-3) var(--size-6);
46
62
 
63
+ font-size: var(--app-header-font-size);
64
+ font-family: var(--app-header-font-family);
65
+ font-weight: var(--app-header-font-weight);
66
+ text-transform: var(--app-header-text-transform);
67
+ letter-spacing: var(--app-header-letter-spacing);
68
+
47
69
  @media (--md) {
48
70
  gap: var(--spacer-lg);
49
71
  }
@@ -71,6 +93,16 @@ header {
71
93
  display: block;
72
94
  }
73
95
  }
96
+
97
+ :deep(> .button),
98
+ :deep(> button),
99
+ :deep(> a) {
100
+ font-size: inherit;
101
+ font-family: inherit;
102
+ font-weight: inherit;
103
+ text-transform: inherit;
104
+ letter-spacing: inherit;
105
+ }
74
106
  }
75
107
  </style>
76
108
 
@@ -15,9 +15,15 @@ defineProps({
15
15
 
16
16
  <style>
17
17
  :root {
18
- --breadcrumb-nav-color: var(--muted);
19
- --breadcrumb-nav-active-color: var(--muted);
20
- --breadcrumb-separator-color: var(--muted);
18
+ --breadcrumb-nav-color: var(--muted);
19
+ --breadcrumb-nav-active-color: var(--color);
20
+ --breadcrumb-separator-color: var(--muted);
21
+
22
+ --breadcrumb-font-family: var(--app-header-font-family);
23
+ --breadcrumb-font-size: var(--app-header-font-size);
24
+ --breadcrumb-font-font-weight: var(--app-header-font-weight);
25
+ --breadcrumb-text-transform: var(--app-header-text-transform);
26
+ --breadcrumb-letter-spacing: var(--app-header-letter-spacing);
21
27
  }
22
28
  </style>
23
29
 
@@ -27,6 +33,11 @@ defineProps({
27
33
  align-items: center;
28
34
  justify-content: center;
29
35
  gap: var(--spacer-sm);
36
+ font-family: var(--breadcrumb-font-family);
37
+ font-weight: var(--breadcrumb-font-weight);
38
+ text-transform: var(--breadcrumb-text-transform);
39
+ font-size: var(--breadcrumb-font-size);
40
+ letter-spacing: var(--breadcrumb-letter-spacing);
30
41
 
31
42
  > span {
32
43
  white-space: nowrap;
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <Button :to="{ name: `id-create`, params: { id } }" class="small">
3
- <Icon type="add"/>
2
+ <Button :to="{ name: `id-create`, params: { id } }">
3
+ <Icon type="add" />
4
4
  <span>Collection</span>
5
5
  </Button>
6
6
  </template>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Button :to="`https://app.ens.domains/${address}`" class="small">
2
+ <Button :to="`https://app.ens.domains/${address}`">
3
3
  <Icon type="edit" />
4
4
  <span>Edit Profile</span>
5
5
  </Button>
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <Button v-if="validateURI(profile.url)" :to="validateURI(profile.url)" class="small">
3
- <Icon type="website" />
2
+ <Button v-if="validateURI(profile.url)" :to="validateURI(profile.url)">
3
+ <Icon type="discord" />
4
4
  {{ getMainDomain(profile.url) }}
5
5
  </Button>
6
6
  </template>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Button v-if="profile.email" :to="`mailto:${profile.email}`" class="small">
2
+ <Button v-if="profile.email" :to="`mailto:${profile.email}`">
3
3
  <Icon type="email" />
4
4
  <span>{{ profile.email }}</span>
5
5
  </Button>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Button v-if="profile.github" :to="`https://github.com/${profile.github}`" class="small">
2
+ <Button v-if="profile.github" :to="`https://github.com/${profile.github}`">
3
3
  <Icon type="github" />
4
4
  <span>{{ profile.github }}</span>
5
5
  </Button>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Button v-if="profile.twitter" :to="`https://x.com/${profile.twitter}`" class="small">
2
+ <Button v-if="profile.twitter" :to="`https://x.com/${profile.twitter}`">
3
3
  <Icon type="twitter" />
4
4
  <span>{{ profile.twitter }}</span>
5
5
  </Button>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Button v-if="validateURI(profile.url)" :to="validateURI(profile.url)" class="small">
2
+ <Button v-if="validateURI(profile.url)" :to="validateURI(profile.url)">
3
3
  <Icon type="website" />
4
4
  <span>{{ getMainDomain(profile.url) }}</span>
5
5
  </Button>
@@ -5,7 +5,7 @@
5
5
 
6
6
  <script setup>
7
7
  defineProps({
8
- to: [String,Object],
8
+ to: [String, Object],
9
9
  target: {
10
10
  type: String,
11
11
  default: '_self',
@@ -23,7 +23,7 @@ defineProps({
23
23
  display: inline-flex;
24
24
  justify-content: center;
25
25
  align-items: center;
26
- gap: var(--ui-padding-x);
26
+ gap: calc(var(--ui-padding-x) / 2);
27
27
  letter-spacing: var(--ui-letter-spacing);
28
28
  line-height: var(--ui-line-height);
29
29
 
@@ -55,25 +55,24 @@ defineProps({
55
55
  height: 100%;
56
56
  }
57
57
 
58
- &.small,
59
- &.small > * {
60
- font-size: var(--font-sm);
61
- min-height: 0;
62
- gap: calc(var(--ui-padding-x) / 2);
63
- }
64
-
65
58
  &.link {
66
59
  display: inline-flex;
67
60
  align-self: baseline;
68
61
  align-items: baseline;
69
62
  height: inherit;
70
63
  margin: 0 !important;
71
- padding-top: 0;
72
- padding-bottom: 0;
64
+ padding: 0 calc(var(--ui-padding-x)/2) !important;
65
+ border: 0;
73
66
  line-height: inherit;
67
+ color: var(--muted);
68
+
69
+ &:--highlight {
70
+ color: var(--color);
71
+ }
74
72
 
75
73
  .icon {
76
74
  align-self: center;
75
+ height: inherit;
77
76
  }
78
77
  }
79
78
  }
@@ -30,7 +30,6 @@
30
30
  <Button
31
31
  :to="{ name: 'id-collection-mint', params: { id, collection: collection.address } }"
32
32
  id="mint-new"
33
- class="small"
34
33
  >
35
34
  <Icon type="add" />
36
35
  <span>Mint New</span>
@@ -19,7 +19,7 @@
19
19
  },
20
20
  }" skip-confirmation auto-close-success @complete="onComplete">
21
21
  <template #start="{ start }">
22
- <Button @click="start" class="small">
22
+ <Button @click="start">
23
23
  <Icon type="withdraw" />
24
24
  <span>Withdraw ({{ balance.value }} {{ balance.format }})</span>
25
25
  </Button>
@@ -1,9 +1,7 @@
1
1
  <template>
2
- <slot :price="unitPrice">
3
- <span>{{ unitPrice.formatted.gwei }} GWEI</span>
4
- </slot>
2
+ <span>{{ unitPrice.formatted.gwei }} GWEI</span>
5
3
  </template>
6
4
 
7
5
  <script setup>
8
- const unitPrice = await useGasPrice()
6
+ const unitPrice = useGasPrice()
9
7
  </script>
@@ -10,22 +10,27 @@ const props = defineProps({
10
10
  })
11
11
 
12
12
  const ICONS = {
13
- home: '🜂',
14
- trash: '',
15
- times: '',
16
- close: '',
17
- folder: '',
18
- edit: '',
19
- check: '',
20
- add: '+',
21
- image: '+',
22
- link: '↗︎',
23
- user: '',
24
- loader: '',
25
- 'chevron-up': '',
26
- 'chevron-down': '',
27
- 'chevron-right': '',
28
- withdraw: 'Ξ',
13
+ 'add': '',
14
+ 'check': '☑️',
15
+ 'chevron-down': '⬇️',
16
+ 'chevron-right': '➡️',
17
+ 'chevron-up': '⬆️',
18
+ 'close': '✖️',
19
+ 'discord': '',
20
+ 'edit': '📝',
21
+ 'email': '📧',
22
+ 'folder': '📁',
23
+ 'github': '',
24
+ 'home': '🏠',
25
+ 'image': '🏞️',
26
+ 'link': '🔗',
27
+ 'loader': '',
28
+ 'times': '✖️',
29
+ 'trash': '🗑️',
30
+ 'twitter': '@',
31
+ 'user': '👤',
32
+ 'website': '🌐',
33
+ 'withdraw': '💵',
29
34
  }
30
35
 
31
36
  const symbol = computed(() => ICONS[props.type])
@@ -34,8 +39,10 @@ const symbol = computed(() => ICONS[props.type])
34
39
  <style scoped>
35
40
  .icon {
36
41
  display: inline-flex;
37
- width: var(--size-4);
38
- height: var(--size-4);
42
+ width: 1em;
43
+ height: 1em;
39
44
  align-items: center;
45
+ justify-content: center;
46
+ text-align: center;
40
47
  }
41
48
  </style>
@@ -14,7 +14,10 @@ const props = defineProps({
14
14
  }
15
15
  })
16
16
  const mintCount = computed(() => props.mintCount)
17
- const { price, displayPrice } = await useMintPrice(mintCount)
17
+ const { price, displayPrice } = useMintPrice(mintCount)
18
18
  const priceFeed = usePriceFeedStore()
19
- const dollarPrice = computed(() => priceFeed.weiToUSD(price.value))
19
+ const dollarPrice = computed(() => {
20
+ const usd = priceFeed.weiToUSD(price.value)
21
+ return parseFloat(usd) > 0 ? usd : `<0.00`
22
+ })
20
23
  </script>
@@ -4,7 +4,7 @@
4
4
  <template #content>
5
5
  <div class="prose">
6
6
  <h1>Mint Pricing</h1>
7
- <p>Artifacts are priced based on the ethereum network fees at the time of collecting.</p>
7
+ <p>Artifacts are priced based on the Ethereum network fees at the time of collecting.</p>
8
8
  <p>Network fees (Gas fees) are an essential component of of securing and running decentralized blockchains.</p>
9
9
  <p>
10
10
  The cost to store and secure the object on the network is mirrored as compensation to the artist,
@@ -59,7 +59,7 @@ const secondsRemaining = computed(() => blocksToSeconds(blocksRemaining.value))
59
59
  const until = computed(() => nowInSeconds() + secondsRemaining.value)
60
60
 
61
61
  const mintCount = computed(() => props.mintCount)
62
- const { price, displayPrice } = await useMintPrice(mintCount)
62
+ const { price, displayPrice } = useMintPrice(mintCount)
63
63
 
64
64
  const mintRequest = computed(() => async () => {
65
65
  const count = BigInt(props.mintCount)
@@ -1,6 +1,8 @@
1
1
  <template>
2
2
  <DialogFrame class="modal" :class="class" ref="dialog">
3
- <button v-if="xClose" class="close" @click="$emit('close')"><Icon type="close" /></button>
3
+ <button v-if="xClose" class="close" @click="$emit('close')">
4
+ <Icon type="close" />
5
+ </button>
4
6
 
5
7
  <slot />
6
8
  </DialogFrame>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <header v-if="artist">
2
+ <header v-if="artist" class="profile-header">
3
3
  <slot name="before" />
4
4
 
5
- <img :src="artist.avatar || `/icons/opepen.svg`" :alt="name">
5
+ <img :src="artist.avatar || `/icons/opepen.svg`" :alt="name" />
6
6
  <h1 @click="() => copy(address)">
7
7
  <span>{{ name }}</span>
8
8
  <small v-if="copied">copied...</small>
@@ -60,7 +60,10 @@ header {
60
60
 
61
61
  small {
62
62
  color: var(--muted);
63
- font-size: var(--font-xs);
63
+ font-size: var(--font-sm);
64
+ font-family: var(--ui-font-family);
65
+ letter-spacing: var(--ui-letter-spacing);
66
+ text-transform: var(--ui-text-transform);
64
67
  }
65
68
  }
66
69
  }
@@ -70,7 +70,7 @@ h1 {
70
70
  margin-bottom: var(--spacer);
71
71
  font-size: var(--font-base);
72
72
  border-bottom: var(--border);
73
- padding: 0 0 var(--spacer-sm);
73
+ padding: 0 0 var(--spacer);
74
74
  margin: 0 0 var(--spacer);
75
75
  }
76
76
 
@@ -65,6 +65,10 @@ const formattedPrice = computed(() => customFormatEther(props.mint.price))
65
65
  .amount {
66
66
  text-align: right;
67
67
  }
68
+
69
+ span:not(.account) {
70
+ font-size: var(--font-base);
71
+ }
68
72
  }
69
73
  }
70
74
  </style>
@@ -5,16 +5,18 @@ import { useConfig, useBlockNumber } from '@wagmi/vue'
5
5
 
6
6
  let priceWatcher: WatchStopHandle|null = null
7
7
  const price: Ref<bigint> = ref(0n)
8
- export const useGasPrice = async () => {
8
+ export const useGasPrice = () => {
9
9
  const config = useConfig()
10
10
  const { data: blockNumber } = useBlockNumber()
11
11
 
12
- if (! priceWatcher) {
13
- priceWatcher = watch(blockNumber, async () => price.value = await getGasPrice(config))
12
+ const updatePrice = async () => {
13
+ price.value = await getGasPrice(config)
14
14
  }
15
15
 
16
- if (price.value === null && priceWatcher === null) {
17
- price.value = await getGasPrice(config)
16
+ if (! priceWatcher) {
17
+ updatePrice()
18
+
19
+ priceWatcher = watch(blockNumber, () => updatePrice())
18
20
  }
19
21
 
20
22
  const unitPrice = computed(() => ({
@@ -23,7 +25,7 @@ export const useGasPrice = async () => {
23
25
  eth: formatEther(price.value as bigint),
24
26
 
25
27
  formatted: {
26
- gwei: price.value as bigint > 20000000000n
28
+ gwei: price.value as bigint > 2_000_000_000_000n
27
29
  ? roundNumber(formatGwei(price.value as bigint))
28
30
  : toFloat(formatGwei(price.value as bigint), 1),
29
31
  eth: formatEther(price.value as bigint),
@@ -33,8 +35,8 @@ export const useGasPrice = async () => {
33
35
  return unitPrice
34
36
  }
35
37
 
36
- export const useMintPrice = async (mintCount: Ref<number>) => {
37
- const gasPrice = await useGasPrice()
38
+ export const useMintPrice = (mintCount: Ref<number>) => {
39
+ const gasPrice = useGasPrice()
38
40
 
39
41
  const price = computed(() => (gasPrice.value.wei || 0n) * 60_000n * BigInt(mintCount.value))
40
42
  const displayPrice = computed(() => customFormatEther(price.value))
@@ -42,5 +44,7 @@ export const useMintPrice = async (mintCount: Ref<number>) => {
42
44
  return {
43
45
  price,
44
46
  displayPrice,
47
+ gasPrice,
45
48
  }
46
49
  }
50
+
@@ -12,7 +12,7 @@
12
12
 
13
13
  <form @submit.stop.prevent="mint" class="card">
14
14
  <Actions>
15
- <select class="select small choose-mode" v-model="mode">
15
+ <select class="select choose-mode" v-model="mode">
16
16
  <option value="file" title="Data URI Encoded File Upload">DATA-URI</option>
17
17
  <option value="ipfs" title="Interplanetary File System">IPFS</option>
18
18
  <option value="http" title="Hypertext Transfer Protocol" disabled>HTTP</option>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualizevalue/mint-app-base",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- export const isDark = ref(localStorage.getItem('color-scheme') !== 'light')