mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 23:50:52 +01:00
Toolbar and Chat Input updates
This commit is contained in:
parent
0e07a6d500
commit
f93563026f
BIN
src/assets/images/toolbar/icons/me-menu/forums.png
Normal file
BIN
src/assets/images/toolbar/icons/me-menu/forums.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 416 B |
BIN
src/assets/images/toolbar/icons/me-menu/helper-tool.png
Normal file
BIN
src/assets/images/toolbar/icons/me-menu/helper-tool.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 309 B |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 468 B |
BIN
src/assets/images/toolbar/icons/me-menu/talents.png
Normal file
BIN
src/assets/images/toolbar/icons/me-menu/talents.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 397 B |
@ -74,10 +74,28 @@ i {
|
|||||||
height: 21px;
|
height: 21px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.icon-me-talents {
|
||||||
|
background-image: url('../images/toolbar/icons/me-menu/talents.png');
|
||||||
|
width: 32px;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.icon-me-helper-tool {
|
||||||
|
background-image: url('../images/toolbar/icons/me-menu/helper-tool.png');
|
||||||
|
width: 32px;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
&.icon-me-profile {
|
&.icon-me-profile {
|
||||||
background-image: url('../images/toolbar/icons/me-menu/profile.png');
|
background-image: url('../images/toolbar/icons/me-menu/profile.png');
|
||||||
width: 21px;
|
width: 32px;
|
||||||
height: 21px;
|
height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.icon-me-forums {
|
||||||
|
background-image: url('../images/toolbar/icons/me-menu/forums.png');
|
||||||
|
width: 32px;
|
||||||
|
height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.icon-me-rooms {
|
&.icon-me-rooms {
|
||||||
|
@ -1,16 +1,23 @@
|
|||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.nitro-chat-input {
|
||||||
|
bottom: 65px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.nitro-chat-input {
|
.nitro-chat-input {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
display: flex;
|
display: flex;
|
||||||
bottom: 57px;
|
bottom: 9px;
|
||||||
left: 55px;
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: $chatinput-zindex;
|
z-index: $chatinput-zindex;
|
||||||
|
|
||||||
.chatinput-container {
|
.chatinput-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 30px;
|
height: 40px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 1.5px solid rgb(0, 0, 0);
|
border: 2px solid rgb(0, 0, 0);
|
||||||
background: #EDEDED;
|
background: #EDEDED;
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
padding-right: 30px;
|
padding-right: 30px;
|
||||||
@ -30,7 +37,6 @@
|
|||||||
width: auto;
|
width: auto;
|
||||||
min-width: 1em;
|
min-width: 1em;
|
||||||
grid-area: 1 / 2;
|
grid-area: 1 / 2;
|
||||||
font: inherit;
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
resize: none;
|
resize: none;
|
||||||
background: none;
|
background: none;
|
||||||
@ -38,7 +44,6 @@
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: attr(data-value) ' ';
|
content: attr(data-value) ' ';
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
@ -55,21 +60,6 @@
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top:0;
|
|
||||||
bottom:0;
|
|
||||||
margin: auto;
|
|
||||||
left: -5.5px;
|
|
||||||
height: 9px;
|
|
||||||
width: 9px;
|
|
||||||
background: #EDEDED;
|
|
||||||
transform: rotate(45deg);
|
|
||||||
border-left: 1.5px solid $black;
|
|
||||||
border-bottom: 1.5px solid $black;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -14,6 +14,7 @@ export const ChatInputView: FC<ChatInputViewProps> = props =>
|
|||||||
const [ chatValue, setChatValue ] = useState<string>('');
|
const [ chatValue, setChatValue ] = useState<string>('');
|
||||||
const [ selectedUsername, setSelectedUsername ] = useState('');
|
const [ selectedUsername, setSelectedUsername ] = useState('');
|
||||||
const [ isTyping, setIsTyping ] = useState(false);
|
const [ isTyping, setIsTyping ] = useState(false);
|
||||||
|
const [ maxCharacters, setMaxCharacters ] = useState<number>(100);
|
||||||
|
|
||||||
const inputRef = createRef<HTMLInputElement>();
|
const inputRef = createRef<HTMLInputElement>();
|
||||||
|
|
||||||
@ -138,7 +139,7 @@ export const ChatInputView: FC<ChatInputViewProps> = props =>
|
|||||||
<div className="nitro-chat-input">
|
<div className="nitro-chat-input">
|
||||||
<div className="chatinput-container">
|
<div className="chatinput-container">
|
||||||
<div className="input-sizer">
|
<div className="input-sizer">
|
||||||
<input ref={ inputRef } type="text" className="chat-input" placeholder={ LocalizeText('widgets.chatinput.default') } value={ chatValue } onChange={ event => { event.target.parentElement.dataset.value = event.target.value; setChatValue(event.target.value) } } onMouseDown={ onInputMouseDownEvent } />
|
<input ref={ inputRef } type="text" className="chat-input" placeholder={ LocalizeText('widgets.chatinput.default') } value={ chatValue } maxLength={ maxCharacters } onChange={ event => { event.target.parentElement.dataset.value = event.target.value; setChatValue(event.target.value) } } onMouseDown={ onInputMouseDownEvent } />
|
||||||
{/* <input #chatInputView type="text" class="chat-input" placeholder="{{ 'widgets.chatinput.default' | translate }}" (input)="chatInputView.parentElement.dataset.value = chatInputView.value" [disabled]="floodBlocked" [maxLength]="inputMaxLength" /> */}
|
{/* <input #chatInputView type="text" class="chat-input" placeholder="{{ 'widgets.chatinput.default' | translate }}" (input)="chatInputView.parentElement.dataset.value = chatInputView.value" [disabled]="floodBlocked" [maxLength]="inputMaxLength" /> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,18 +3,24 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 35px;
|
height: 59px;
|
||||||
z-index: $toolbar-zindex;
|
z-index: $toolbar-zindex;
|
||||||
|
|
||||||
.nitro-toolbar {
|
.nitro-toolbar {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
background-color: rgba(#33312C, 1);
|
background: rgba(20, 20, 20, .95);
|
||||||
|
border-top: 1px solid #101010;
|
||||||
|
box-shadow: inset 0px 2px rgba(255, 255, 255, .1);
|
||||||
|
|
||||||
.navigation-items {
|
.navigation-items {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
&.navigation-avatar {
|
||||||
|
border-right: 1px solid rgba(0, 0, 0, .3);
|
||||||
|
}
|
||||||
|
|
||||||
.navigation-item {
|
.navigation-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -23,20 +29,31 @@
|
|||||||
width: 50px;
|
width: 50px;
|
||||||
margin: 0 1px;
|
margin: 0 1px;
|
||||||
|
|
||||||
|
.toolbar-avatar {
|
||||||
|
height: 50px;
|
||||||
|
|
||||||
|
.avatar-image {
|
||||||
|
margin-left: -5px;
|
||||||
|
margin-top: -20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover, &.active {
|
||||||
|
height: 53px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.icon,
|
.icon,
|
||||||
.avatar-image {
|
.toolbar-avatar {
|
||||||
position: relative;
|
transition: transform .2s ease-out;
|
||||||
top: -12px;
|
|
||||||
filter: drop-shadow(2px 1px 0 rgba($white, 1)) drop-shadow(-2px 1px 0 rgba($white, 1)) drop-shadow(0 -2px 0 rgba($white, 1));
|
|
||||||
|
|
||||||
&:active {
|
&:hover, &.active {
|
||||||
-webkit-transform: translate(0, 1px);
|
-webkit-transform: translate(0, -3px);
|
||||||
transform: translate(0, 1px);
|
transform: translate(0, -3px);
|
||||||
|
filter: drop-shadow(2px 2px 0 rgba($black, 0.8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar-image {
|
.avatar-image {
|
||||||
top: -40px;
|
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,5 +116,6 @@
|
|||||||
max-width: 120px;
|
max-width: 120px;
|
||||||
max-height: 150px;
|
max-height: 150px;
|
||||||
z-index: 500;
|
z-index: 500;
|
||||||
filter: drop-shadow(2px 1px 0 rgba($white, 1)) drop-shadow(-2px 1px 0 rgba($white, 1)) drop-shadow(0 -2px 0 rgba($white, 1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@import './me/ToolbarMeView';
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
|
import classNames from 'classnames';
|
||||||
import { UserInfoEvent } from 'nitro-renderer/src/nitro/communication/messages/incoming/user/data/UserInfoEvent';
|
import { UserInfoEvent } from 'nitro-renderer/src/nitro/communication/messages/incoming/user/data/UserInfoEvent';
|
||||||
import { UserInfoDataParser } from 'nitro-renderer/src/nitro/communication/messages/parser/user/data/UserInfoDataParser';
|
import { UserInfoDataParser } from 'nitro-renderer/src/nitro/communication/messages/parser/user/data/UserInfoDataParser';
|
||||||
import { MouseEvent, useCallback, useState } from 'react';
|
import { MouseEvent, useCallback, useState } from 'react';
|
||||||
import { CatalogEvent, FriendListEvent, InventoryEvent, NavigatorEvent } from '../../events';
|
import { CatalogEvent, FriendListEvent, InventoryEvent, NavigatorEvent } from '../../events';
|
||||||
import { dispatchUiEvent } from '../../hooks/events/ui/ui-event';
|
import { dispatchUiEvent } from '../../hooks/events/ui/ui-event';
|
||||||
import { CreateMessageHook } from '../../hooks/messages/message-event';
|
import { CreateMessageHook } from '../../hooks/messages/message-event';
|
||||||
|
import { TransitionAnimation } from '../../transitions/TransitionAnimation';
|
||||||
|
import { TransitionAnimationTypes } from '../../transitions/TransitionAnimation.types';
|
||||||
import { AvatarImageView } from '../avatar-image/AvatarImageView';
|
import { AvatarImageView } from '../avatar-image/AvatarImageView';
|
||||||
|
import { ToolbarMeView } from './me/ToolbarMeView';
|
||||||
import { ToolbarViewItems, ToolbarViewProps } from './ToolbarView.types';
|
import { ToolbarViewItems, ToolbarViewProps } from './ToolbarView.types';
|
||||||
|
|
||||||
export function ToolbarView(props: ToolbarViewProps): JSX.Element
|
export function ToolbarView(props: ToolbarViewProps): JSX.Element
|
||||||
@ -12,6 +16,7 @@ export function ToolbarView(props: ToolbarViewProps): JSX.Element
|
|||||||
const { isInRoom } = props;
|
const { isInRoom } = props;
|
||||||
|
|
||||||
const [ userInfo, setUserInfo ] = useState<UserInfoDataParser>(null);
|
const [ userInfo, setUserInfo ] = useState<UserInfoDataParser>(null);
|
||||||
|
const [ expandMeToolbar, setExpandMeToolbar ] = useState(false);
|
||||||
|
|
||||||
const unseenInventoryCount = 0;
|
const unseenInventoryCount = 0;
|
||||||
const unseenFriendListCount = 0;
|
const unseenFriendListCount = 0;
|
||||||
@ -45,14 +50,25 @@ export function ToolbarView(props: ToolbarViewProps): JSX.Element
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleMeToolbar(): void
|
||||||
|
{
|
||||||
|
setExpandMeToolbar((value) => !value);
|
||||||
|
}
|
||||||
|
|
||||||
CreateMessageHook(UserInfoEvent, onUserInfoEvent);
|
CreateMessageHook(UserInfoEvent, onUserInfoEvent);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="d-flex nitro-toolbar">
|
<>
|
||||||
<div className="navigation-items me-2">
|
{ expandMeToolbar && <TransitionAnimation className="" type={ TransitionAnimationTypes.FADE_UP } inProp={ false } timeout={ 300 }>
|
||||||
|
<ToolbarMeView />
|
||||||
|
</TransitionAnimation> }
|
||||||
|
<div className="d-flex nitro-toolbar py-1 px-3">
|
||||||
|
<div className="navigation-items navigation-avatar pe-1 me-2">
|
||||||
<div className="navigation-item">
|
<div className="navigation-item">
|
||||||
|
<div className={"toolbar-avatar" + classNames({ ' active': expandMeToolbar })} onClick={ toggleMeToolbar }>
|
||||||
{ userInfo && <AvatarImageView figure={ userInfo.figure } direction={ 2 } /> }
|
{ userInfo && <AvatarImageView figure={ userInfo.figure } direction={ 2 } /> }
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{ (unseenAchievementsCount > 0) && (
|
{ (unseenAchievementsCount > 0) && (
|
||||||
<div className="position-absolute bg-danger px-1 py-0 rounded shadow count">{ unseenAchievementsCount }</div>) }
|
<div className="position-absolute bg-danger px-1 py-0 rounded shadow count">{ unseenAchievementsCount }</div>) }
|
||||||
</div>
|
</div>
|
||||||
@ -83,5 +99,6 @@ export function ToolbarView(props: ToolbarViewProps): JSX.Element
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
40
src/views/toolbar/me/ToolbarMeView.scss
Normal file
40
src/views/toolbar/me/ToolbarMeView.scss
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
.nitro-toolbar-me {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10px;
|
||||||
|
left: 15px;
|
||||||
|
z-index: $toolbar-zindex;
|
||||||
|
background: rgba(20, 20, 20, .95);
|
||||||
|
border: 1px solid #101010;
|
||||||
|
box-shadow: inset 2px 2px rgba(255, 255, 255, .1), inset -2px -2px rgba(255, 255, 255, .1);
|
||||||
|
border-radius: $border-radius;
|
||||||
|
|
||||||
|
.navigation-items {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&.navigation-avatar {
|
||||||
|
border-right: 1px solid rgba(0, 0, 0, .3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 50px;
|
||||||
|
font-size: 11px;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
transition: filter .2s ease-out;
|
||||||
|
filter: grayscale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.icon {
|
||||||
|
filter: grayscale(0) drop-shadow(2px 2px 0 rgba($black, 0.8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
33
src/views/toolbar/me/ToolbarMeView.tsx
Normal file
33
src/views/toolbar/me/ToolbarMeView.tsx
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import { ToolbarMeViewProps } from './ToolbarMeView.types';
|
||||||
|
|
||||||
|
export function ToolbarMeView(props: ToolbarMeViewProps): JSX.Element
|
||||||
|
{
|
||||||
|
return (<div className="d-flex nitro-toolbar-me px-1 py-2">
|
||||||
|
<div className="navigation-items">
|
||||||
|
<div className="navigation-item">
|
||||||
|
<i className="icon icon-me-talents"></i>
|
||||||
|
</div>
|
||||||
|
<div className="navigation-item">
|
||||||
|
<i className="icon icon-me-helper-tool"></i>
|
||||||
|
</div>
|
||||||
|
<div className="navigation-item">
|
||||||
|
<i className="icon icon-me-achievements"></i>
|
||||||
|
</div>
|
||||||
|
<div className="navigation-item">
|
||||||
|
<i className="icon icon-me-profile"></i>
|
||||||
|
</div>
|
||||||
|
<div className="navigation-item">
|
||||||
|
<i className="icon icon-me-rooms"></i>
|
||||||
|
</div>
|
||||||
|
<div className="navigation-item">
|
||||||
|
<i className="icon icon-me-clothing"></i>
|
||||||
|
</div>
|
||||||
|
<div className="navigation-item">
|
||||||
|
<i className="icon icon-me-forums"></i>
|
||||||
|
</div>
|
||||||
|
<div className="navigation-item">
|
||||||
|
<i className="icon icon-me-settings"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>);
|
||||||
|
}
|
2
src/views/toolbar/me/ToolbarMeView.types.ts
Normal file
2
src/views/toolbar/me/ToolbarMeView.types.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export interface ToolbarMeViewProps
|
||||||
|
{}
|
Loading…
Reference in New Issue
Block a user