-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/add Namecard Component #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6bc6040
add Namecard
totocalcio 7cb2640
fix namecard background
totocalcio 177c892
fix markup
totocalcio 44e1519
fix design
totocalcio 6ad58bc
fix markup
totocalcio fd03a66
code format
totocalcio 0caf8c8
move Namecard component from apps/web to packages/ui.
totocalcio 7447072
Merge remote-tracking branch 'origin/main' into feat/namecard
totocalcio 0ec00d6
Remove unused file
totocalcio 20a01ba
code format
totocalcio aaae6b5
code format
totocalcio da9cd85
change alt attribute
totocalcio a6a7e5e
test / get assets file path
totocalcio ab9167e
test / get assets file path
totocalcio 387f30e
fix style
totocalcio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,74 @@ | ||
<script setup lang="ts"> | ||
import NamecardAvatar from './NamecardAvatar24.vue' | ||
import type { NamecardUser } from '@vuejs-jp/model' | ||
import { useUserRole } from '@vuejs-jp/composable' | ||
|
||
type NamecardProps = { | ||
user: NamecardUser | ||
isPlaceholder?: boolean | ||
} | ||
|
||
defineProps<NamecardProps>() | ||
|
||
const { backgroundColor } = useUserRole() | ||
</script> | ||
|
||
<template> | ||
Namecard 2024 | ||
<div class="namecard-root"> | ||
<NamecardAvatar :user="user" :is-placeholder="isPlaceholder" /> | ||
<div | ||
class="namecard-role" | ||
:style="{ '--background-color-role': backgroundColor(user.role ?? 'staff') }" | ||
> | ||
{{ user.role }} | ||
</div> | ||
<div class="namecard-sponsor"> | ||
<img src="../../assets/namecard/support.svg" alt="Supported by Stockmark" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.namecard-root { | ||
width: 23.5rem; | ||
background-color: var(--color-white); | ||
border-radius: calc(var(--unit) * 1.25); | ||
overflow: hidden; | ||
box-shadow: 0px 8px 24px 0px hsla(0, 0%, 0%, 0.239); | ||
border: 1px solid #000; | ||
@media (width <= 480px) { | ||
width: 18rem; | ||
} | ||
} | ||
|
||
.namecard-role { | ||
--background-color-role: color-mix(in srgb, var(--color-vue-blue), #000 20%); | ||
font-size: 1.6875rem; | ||
height: 2.625rem; | ||
display: grid; | ||
place-items: center; | ||
font-weight: 700; | ||
text-transform: uppercase; | ||
color: var(--color-white); | ||
background-color: var(--background-color-role); | ||
@media (width <= 480px) { | ||
font-size: 1.3125rem; | ||
height: 2.0625rem; | ||
} | ||
} | ||
|
||
.namecard-sponsor { | ||
display: grid; | ||
place-items: center; | ||
height: 3.75rem; | ||
img { | ||
width: 16.25rem; | ||
} | ||
@media (width <= 480px) { | ||
height: 2.8125rem; | ||
img { | ||
width: 12.5rem; | ||
} | ||
} | ||
} | ||
</style> |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<script setup lang="ts"> | ||
import NamecardAvatarLogo from './NamecardAvatarLogo24.vue' | ||
import type { NamecardUser } from '@vuejs-jp/model' | ||
|
||
type NamecardAvatarProps = { | ||
user: NamecardUser | ||
isPlaceholder?: boolean | ||
} | ||
defineProps<NamecardAvatarProps>() | ||
|
||
const COLOR_AVATAR_NAME = { | ||
DEFAULT: 'color-mix(in srgb, var(--color-vue-blue), #000 20%)', | ||
PLACEHOLDER: 'var(--color-gray100)', | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="avatar"> | ||
<span class="avatar-hook" aria-hidden="true" /> | ||
<div class="vuefes-logo-wrapper"> | ||
<img src="../../assets/namecard/vuefes_logo.svg" alt="vuefes logo" /> | ||
</div> | ||
<div class="avatar-logo-wrapper"> | ||
<NamecardAvatarLogo :user="user" /> | ||
</div> | ||
<div class="avatar-name-area"> | ||
<div | ||
class="avatar-name" | ||
:style="{ | ||
'--color-avatar-name': isPlaceholder | ||
? COLOR_AVATAR_NAME.PLACEHOLDER | ||
: COLOR_AVATAR_NAME.DEFAULT, | ||
}" | ||
> | ||
{{ user.display_name }} | ||
</div> | ||
</div> | ||
<small class="avatar-footer">Vue Fes Japan 2024</small> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.avatar { | ||
display: grid; | ||
place-items: center; | ||
background: color-mix(in srgb, var(--color-vue-blue), #000 20%) | ||
url('../../assets/namecard/bg_texture.png') no-repeat; | ||
background-size: cover; | ||
container: avatar / inline-size; | ||
} | ||
|
||
.avatar-hook { | ||
margin-top: 1.25rem; | ||
width: 25px; | ||
aspect-ratio: 1; | ||
background-color: var(--color-white); | ||
border-radius: 50%; | ||
@media (width <= 480px) { | ||
margin-top: 0.9375rem; | ||
width: 20px; | ||
} | ||
} | ||
|
||
.vuefes-logo-wrapper { | ||
position: absolute; | ||
top: 17.98px; | ||
right: 14.07px; | ||
width: 29.72px; | ||
img { | ||
width: 100%; | ||
} | ||
@media (width <= 480px) { | ||
top: 13.77px; | ||
right: 10.77px; | ||
width: 22.76px; | ||
} | ||
} | ||
|
||
.avatar-logo-wrapper { | ||
width: 36.17cqi; | ||
aspect-ratio: 1; | ||
border-radius: 50%; | ||
margin-top: 2.5rem; | ||
background: var(--color-vue-green-gradation); | ||
display: grid; | ||
place-items: center; | ||
border: 4px solid var(--color-white); | ||
container: avatar-logo / inline-size; | ||
@media (width <= 480px) { | ||
border-width: 3px; | ||
margin-top: 1.875rem; | ||
} | ||
} | ||
|
||
.avatar-name-area { | ||
width: 85cqi; | ||
height: 8rem; | ||
background-color: var(--color-white); | ||
margin-top: 0.8125rem; | ||
display: grid; | ||
place-items: center; | ||
border-radius: calc(var(--unit) * 1.25); | ||
padding-inline: 1rem; | ||
overflow-wrap: anywhere; | ||
word-break: break-all; | ||
@media (width <= 480px) { | ||
margin-top: 0.625rem; | ||
height: 6.125rem; | ||
} | ||
} | ||
|
||
.avatar-name { | ||
--color-avatar-name: color-mix(in srgb, var(--color-vue-blue), #000 20%); | ||
|
||
font-size: 2.25rem; | ||
font-weight: 700; | ||
line-height: 1.1; | ||
color: var(--color-avatar-name); | ||
@media (width <= 480px) { | ||
font-size: 1.6875rem; | ||
} | ||
} | ||
|
||
.avatar-footer { | ||
font-size: 1.0625rem; | ||
font-weight: 700; | ||
color: var(--color-white); | ||
margin-top: 2.875rem; | ||
margin-bottom: 0.75rem; | ||
line-height: 1; | ||
height: 0.75rem; | ||
@media (width <= 480px) { | ||
font-size: 0.8125rem; | ||
margin-top: 2.125rem; | ||
margin-bottom: 0.4rem; | ||
} | ||
} | ||
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<script setup lang="ts"> | ||
import type { NamecardUser } from '@vuejs-jp/model' | ||
|
||
type NamecardAvatarLogoProps = { | ||
user: NamecardUser | ||
} | ||
|
||
defineProps<NamecardAvatarLogoProps>() | ||
</script> | ||
|
||
<template> | ||
<template v-if="user.avatar_url"> | ||
<img :alt="user.display_name" :src="user.avatar_url" class="avatar-logo" decoding="async" /> | ||
</template> | ||
<template v-else> | ||
<img | ||
alt="vuefes logo avatar sample" | ||
src="../../assets/namecard/vuefes_logo.svg" | ||
class="sample-logo" | ||
/> | ||
</template> | ||
</template> | ||
|
||
<style scoped> | ||
.avatar-logo { | ||
width: 100%; | ||
height: 100%; | ||
border-radius: 50%; | ||
} | ||
|
||
.sample-logo { | ||
width: 40cqi; | ||
opacity: 0.5; | ||
padding-bottom: 4cqi; | ||
} | ||
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NITS
SVG アイコンの箇所、表示されていなさそうな気がします
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storybook上では問題ありませんでしたが、apps/web側に埋め込んだら表示されないことを確認しました。
調査・対応します。