Skip to content

Commit cfa386e

Browse files
committed
style: hexagon avatar
1 parent 5b52d02 commit cfa386e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

components/Navbar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<header class="px-4 md:px-9 py-5 h-[72px] fixed w-full bg-neutral-50 border-b border-neutral-100">
2+
<header class="px-4 md:px-9 py-5 h-[72px] fixed w-full bg-neutral-50 border-b border-neutral-100 z-10">
33
<div class="h-full flex items-center">
44
<div class="hidden lg:flex items-center gap-8">
55
<h1 class="font-medium text-xl text-sky-500">ethereum avatar service</h1>

pages/index.vue

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<template v-if="isConnected">
55
<template v-if="avatarInfo">
66
<div class="flex flex-col items-center">
7-
<div class="w-64 h-64 flex items-center bg-neutral-50 border border-neutral-100 rounded-full shadow-[0px_0px_16px_8px] shadow-neutral-100 overflow-hidden">
7+
<div class="hex w-72 h-72 flex items-center bg-neutral-50 shadow-[0px_0px_16px_8px] shadow-neutral-500 overflow-hidden">
88
<template v-if="imageType === 'image'">
9-
<img :src="imageLink" class="w-full" alt="" />
9+
<img :src="imageLink" class="object-cover" alt="" />
1010
</template>
1111
<template v-else-if="imageType === 'video'">
1212
<video autoplay loop muted :src="imageLink" class="w-full h-full object-cover" />
@@ -261,8 +261,6 @@ async function updateAvatarInfo() {
261261
try {
262262
avatarInfo.value = await getAvatarInfo();
263263
264-
updateImageLink();
265-
266264
const apiRes = await getAvatarForAddress(address.value);
267265
268266
const chainName = chain.value.name.toLowerCase();
@@ -271,11 +269,17 @@ async function updateAvatarInfo() {
271269
} catch(error) {
272270
console.error("Error getting avatar:", error);
273271
}
272+
273+
updateImageLink();
274274
}
275275
</script>
276276
277277
<style scoped>
278278
.input {
279279
@apply bg-neutral-100 p-4 placeholder-neutral-300 rounded-2xl w-full;
280280
}
281+
282+
.hex {
283+
clip-path: polygon(45% 1.33975%, 46.5798% 0.60307%, 48.26352% 0.15192%, 50% 0%, 51.73648% 0.15192%, 53.4202% 0.60307%, 55% 1.33975%, 89.64102% 21.33975%, 91.06889% 22.33956%, 92.30146% 23.57212%, 93.30127% 25%, 94.03794% 26.5798%, 94.48909% 28.26352%, 94.64102% 30%, 94.64102% 70%, 94.48909% 71.73648%, 94.03794% 73.4202%, 93.30127% 75%, 92.30146% 76.42788%, 91.06889% 77.66044%, 89.64102% 78.66025%, 55% 98.66025%, 53.4202% 99.39693%, 51.73648% 99.84808%, 50% 100%, 48.26352% 99.84808%, 46.5798% 99.39693%, 45% 98.66025%, 10.35898% 78.66025%, 8.93111% 77.66044%, 7.69854% 76.42788%, 6.69873% 75%, 5.96206% 73.4202%, 5.51091% 71.73648%, 5.35898% 70%, 5.35898% 30%, 5.51091% 28.26352%, 5.96206% 26.5798%, 6.69873% 25%, 7.69854% 23.57212%, 8.93111% 22.33956%, 10.35898% 21.33975%);
284+
}
281285
</style>

0 commit comments

Comments
 (0)