summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-08-22 13:16:15 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-08-22 13:16:15 +0900
commit8785e1c3a48487152dcfc754506e7e86a28a1048 (patch)
treeb184798f1bf572ba964e6717fb1b4cc89acaf1c6 /src
parent12.89.0 (diff)
downloadmisskey-8785e1c3a48487152dcfc754506e7e86a28a1048.tar.gz
misskey-8785e1c3a48487152dcfc754506e7e86a28a1048.tar.bz2
misskey-8785e1c3a48487152dcfc754506e7e86a28a1048.zip
enhance(client): ユーザー名についてのヒントを追加
Diffstat (limited to 'src')
-rw-r--r--src/client/components/dialog.vue1
-rw-r--r--src/client/components/signup.vue2
-rw-r--r--src/client/directives/tooltip.ts16
-rw-r--r--src/client/style.scss7
4 files changed, 24 insertions, 2 deletions
diff --git a/src/client/components/dialog.vue b/src/client/components/dialog.vue
index f3611f050e..0a7508aee9 100644
--- a/src/client/components/dialog.vue
+++ b/src/client/components/dialog.vue
@@ -10,6 +10,7 @@
<i v-else-if="type === 'warning'" class="fas fa-exclamation-triangle"></i>
<i v-else-if="type === 'info'" class="fas fa-info-circle"></i>
<i v-else-if="type === 'question'" class="fas fa-question-circle"></i>
+ <i v-else-if="type === 'help'" class="fas fa-question-circle"></i>
<i v-else-if="type === 'waiting'" class="fas fa-spinner fa-pulse"></i>
</div>
<header v-if="title"><Mfm :text="title"/></header>
diff --git a/src/client/components/signup.vue b/src/client/components/signup.vue
index b0b0c2ad4d..a19b4f5bd5 100644
--- a/src/client/components/signup.vue
+++ b/src/client/components/signup.vue
@@ -6,7 +6,7 @@
<template #prefix><i class="fas fa-key"></i></template>
</MkInput>
<MkInput v-model="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @update:modelValue="onChangeUsername" data-cy-signup-username>
- <template #label>{{ $ts.username }}</template>
+ <template #label>{{ $ts.username }} <div class="_button _help" v-tooltip:dialog="$ts.usernameInfo"><i class="far fa-question-circle"></i></div></template>
<template #prefix>@</template>
<template #suffix>@{{ host }}</template>
<template #caption>
diff --git a/src/client/directives/tooltip.ts b/src/client/directives/tooltip.ts
index 90247eacb2..cf6f3c8e69 100644
--- a/src/client/directives/tooltip.ts
+++ b/src/client/directives/tooltip.ts
@@ -1,6 +1,6 @@
import { Directive, ref } from 'vue';
import { isDeviceTouch } from '@client/scripts/is-device-touch';
-import { popup } from '@client/os';
+import { popup, dialog } from '@client/os';
const start = isDeviceTouch ? 'touchstart' : 'mouseover';
const end = isDeviceTouch ? 'touchend' : 'mouseleave';
@@ -24,6 +24,20 @@ export default {
}
};
+ console.log(binding.arg);
+
+ if (binding.arg === 'dialog') {
+ el.addEventListener('click', (ev) => {
+ ev.preventDefault();
+ ev.stopPropagation();
+ dialog({
+ type: 'help',
+ text: binding.value,
+ });
+ return false;
+ });
+ }
+
const show = e => {
if (!document.body.contains(el)) return;
if (self._close) return;
diff --git a/src/client/style.scss b/src/client/style.scss
index a6c027745a..269cf88939 100644
--- a/src/client/style.scss
+++ b/src/client/style.scss
@@ -156,8 +156,10 @@ hr {
._button {
appearance: none;
+ display: inline-block;
padding: 0;
margin: 0; // for Safari
+ width: max-content;
background: none;
border: none;
cursor: pointer;
@@ -201,6 +203,11 @@ hr {
}
}
+._help {
+ color: var(--accent);
+ cursor: help
+}
+
._textButton {
@extend ._button;
color: var(--accent);