-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from MakinoharaShoko/dev
4.4.7
- Loading branch information
Showing
63 changed files
with
968 additions
and
494 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
.title{ | ||
font-size: 90%; | ||
color: #005caf; | ||
color: var(--terre-primary); | ||
font-weight: bold; | ||
} | ||
|
||
|
This file contains 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 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 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 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,113 @@ | ||
:root { | ||
--black: rgba(0, 0, 0, 1); | ||
--black-0pct: rgba(0, 0, 0, 0); | ||
--black-5pct: rgba(0, 0, 0, 0.05); | ||
--black-7pct: rgba(0, 0, 0, 0.07); | ||
--black-10pct: rgba(0, 0, 0, 0.1); | ||
--black-15pct: rgba(0, 0, 0, 0.15); | ||
--black-35pct: rgba(0, 0, 0, 0.35); | ||
--black-50pct: rgba(0, 0, 0, 0.5); | ||
--black-75pct: rgba(0, 0, 0, 0.75); | ||
--gray-dark: rgba(40, 44, 52, 1); | ||
--gray-51: rgba(51, 51, 51, 1); | ||
--gray-102: rgba(102, 102, 102, 1); | ||
--gray-153: rgba(153, 153, 153, 1); | ||
--gray-204: rgba(204, 204, 204, 1); | ||
--gray-242: rgba(242, 242, 242, 1); | ||
--gray-245: rgba(245, 245, 245, 1); | ||
--gray-248: rgba(248, 248, 248, 1); | ||
--blue-deep: rgba(0, 90, 158, 1); | ||
--blue-deep-20pct: rgba(0, 90, 158, 0.2); | ||
--blue-light: rgba(97, 218, 251, 1); | ||
--blue-ultra-light: rgba(250, 252, 255, 1); | ||
--blue-medium: rgba(0, 120, 212, 1); | ||
--blue-medium-10pct: rgba(0, 120, 212, 0.1); | ||
--blue-sky-50pct: rgba(47, 136, 255, 0.5); | ||
--blue-navy: rgba(11, 52, 110, 1); | ||
--white: rgba(255, 255, 255, 1); | ||
--terre-primary: rgba(0, 92, 175, 1); | ||
--terre-primary-5pct: rgba(0, 92, 175, 0.05); | ||
--terre-primary-10pct: rgba(0, 92, 175, 0.1); | ||
--addSentence-sentenceTypeButton-background: var(--black-5pct); | ||
--addSentence-sentenceTypeButton-hover-background: var(--black-0pct); | ||
--app-header-background: var(--gray-dark); | ||
--app-header: var(--white); | ||
--app-link: var(--blue-light); | ||
--assets-controlCommonButton-border: var(--black-15pct); | ||
--assets-controlCommonButton-hover-border: var(--terre-primary-10pct); | ||
--assets-commonFileButton-hover-background: var(--black-5pct); | ||
--assets-controlDirnameDisplay-border: var(--black-15pct); | ||
--assets-deleteButton-hover-background: var(--black-10pct); | ||
--assets-extNameShow-background: var(--blue-medium-10pct); | ||
--assets-extNameShow: var(--blue-medium); | ||
--assets-fileSelectButton-background: var(--blue-medium); | ||
--assets-fileSelectButton: var(--white); | ||
--assets-fileSelectButton-hover-background: var(--blue-deep); | ||
--assets-fileSelectInput-border: var(--blue-medium); | ||
--assets-fileSelectInput-focus-border: var(--blue-deep); | ||
--assets-fileSelectInput-focus-box-shadow: var(--blue-deep-20pct); | ||
--chooseFile-button-border-bottom: var(--black-10pct); | ||
--commonTips-tips-background: var(--terre-primary-10pct); | ||
--common-tag_title_button: var(--black-10pct); | ||
--common-tag_title_button-first-child-border-left: var(--black-0pct); | ||
--common-tag_title_button-hover-background: var(--black-10pct); | ||
--common-tag_title_button-hover-border-left: var(--black-0pct); | ||
--commonOption-item-hover-background: var(--black-5pct); | ||
--commonOption-title: var(--black-50pct); | ||
--createGameButton: var(--white); | ||
--dashboard-gameElement-main-border: var(--black-15pct); | ||
--dashboard-gameElement-main: var(--blue-navy); | ||
--dashboard-gameElement-main-hover-background: var(--gray-245); | ||
--dashboard-topBar-border-bottom: var(--black-10pct); | ||
--editArea-none-text: var(--black-35pct); | ||
--editorSidebar-control-button-active-background: var(--black-10pct); | ||
--editorSidebar-divider-background: var(--black-10pct); | ||
--editorSidebar-livePreviewNotice-background: var(--terre-primary-5pct); | ||
--gameElement-box-shadow: var(--black-10pct); | ||
--gamePreview-editGameButton: var(--white); | ||
--gamePreview-noneChecked: var(--black-75pct); | ||
--graphicalEditor-sentenceEditorWrapper-background: var(--white); | ||
--graphicalEditor-sentenceEditorWrapper-border-bottom: var(--black-10pct); | ||
--graphicalEditor-sentenceEditorWrapper: var(--black-50pct); | ||
--graphicalEditor-lineNumber: var(--black-50pct); | ||
--graphicalEditor-optionButton-hover-background: var(--black-5pct); | ||
--iconPark-closeIcon-fill: var(--black); | ||
--iconPark-icon-chooseFile-fill: var(--blue-sky-50pct); | ||
--iconPark-icon-chooseFile-stroke-first: var(--gray-51); | ||
--iconPark-icon-chooseFile-stroke-second: var(--white); | ||
--iconPark-icon-chooseFile-stroke-third: var(--white); | ||
--iconPark-icon-fill: var(--gray-51); | ||
--sentenceEditor-sayArea: var(--black); | ||
--sentenceEditor-sayArea-background: var(--black-5pct); | ||
--sentenceEditor-sayArea-border: var(--black-7pct); | ||
--sentenceEditor-sayInput-background: var(--black-5pct); | ||
--sentenceEditor-sayInput-border: var(--black-7pct); | ||
--sidebar-main-border-right: var(--black-10pct); | ||
--sidebarComponents-fileElement-hover-background: var(--black-5pct); | ||
--sidebarComponents-fileElement-interactable-icon-hover-background: var(--black-10pct); | ||
--sideBarIcon-pressDown: var(--blue-navy); | ||
--sideBarIcon-pressUp: var(--gray-102); | ||
--sidebarTags-editButton-background: var(--terre-primary-10pct); | ||
--sidebarTags-imageChooseItem-hover-background: var(--black-10pct); | ||
--sidebarTags-open-assets-background: var(--terre-primary-10pct); | ||
--sidebarTags-open-assets: var(--blue-navy); | ||
--singleMessage-background: var(--blue-ultra-light); | ||
--singleMessage: var(--blue-navy); | ||
--singleMessage-border: var(--black-10pct); | ||
--singleMessage-box-shadow: var(--black-10pct); | ||
--tagManager-tag-background: var(--gray-248); | ||
--tagManager-tag-border-top: var(--black-0pct); | ||
--tagManager-tagsContainer-background: var(--gray-248); | ||
--tagManager-tagsContainer-webkit-scrollbar-background: var(--gray-242); | ||
--tagManager-tagsContainer-webkit-scrollbar-thumb-background: var(--gray-204); | ||
--tagManager-tagsContainer-webkit-scrollbar-thumb-hover-background: var(--gray-153); | ||
--tagManager-tagsContainer-Firefox-scrollbar-first: var(--gray-204); | ||
--tagManager-tagsContainer-Firefox-scrollbar-second: var(--gray-242); | ||
--tagManager-tag-active-background: var(--white); | ||
--tagManager-tag-active-border-top: var(--blue-navy); | ||
--tagManager-tag-hover-background: var(--black-10pct); | ||
--tagManager-closeIcon-hover-background: var(--black-10pct); | ||
--topbar-border-bottom: var(--black-10pct); | ||
--topbar-editingGame-background: var(--terre-primary-10pct); | ||
--topbar-home-btn-hover-background: var(--black-7pct); | ||
} |
This file contains 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 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,82 @@ | ||
import {useDispatch, useSelector} from "react-redux"; | ||
import {RootState} from "@/store/origineStore"; | ||
import {useEffect} from "react"; | ||
import {setDashboardShow, setEditingGame, statusActions} from "@/store/statusReducer"; | ||
import {ITag} from "@/store/statusReducer"; | ||
|
||
export function useHashRoute() { | ||
const state = useSelector((state: RootState) => state.status); | ||
const isShowDashboard = state.dashboard.showDashBoard; | ||
const editingGameName = state.editor.currentEditingGame; | ||
const currentTag = state.editor.selectedTagTarget; | ||
const dispatch = useDispatch(); | ||
useEffect(() => { | ||
setTimeout(() => { | ||
// 写入 Hash | ||
// 如果显示 dashboard 或者两个状态都为空,则清空哈希 | ||
if (isShowDashboard || (!editingGameName && !currentTag)) { | ||
window.location.hash = ''; | ||
return; | ||
} | ||
console.log(currentTag); | ||
const tagInfoObj = state.editor.tags.find(e => e.tagTarget === currentTag); | ||
let tagStr = ''; | ||
if (tagInfoObj) { | ||
tagStr = JSON.stringify(tagInfoObj); | ||
} | ||
tagStr = encodeURIComponent(tagStr); | ||
// 基于当前的状态构造哈希字符串,过滤掉空字符串并用 '/' 连接 | ||
const hashParts = [editingGameName, tagStr].filter(part => part !== ''); | ||
// 更新浏览器的哈希部分 | ||
window.location.hash = `#/${hashParts.join('/')}`; | ||
}, 50); | ||
|
||
}, [isShowDashboard, editingGameName, currentTag]); | ||
|
||
useEffect(() => { | ||
const result = decodeHash(); | ||
if (result.editingGameName !== '') { | ||
dispatch(setDashboardShow(false)); | ||
dispatch(setEditingGame(result.editingGameName)); | ||
if (result.currentTag !== '') { | ||
const currentTagJsonStr = decodeURIComponent(result.currentTag); | ||
let tagObj: null | ITag = null; | ||
try { | ||
tagObj = JSON.parse(currentTagJsonStr); | ||
} catch (e) { | ||
} | ||
if (tagObj) { | ||
dispatch(statusActions.addEditAreaTag(tagObj)); | ||
dispatch(statusActions.setCurrentTagTarget(tagObj.tagTarget)); | ||
} | ||
|
||
} | ||
} | ||
}, []); | ||
|
||
} | ||
|
||
function decodeHash() { | ||
// 获取当前 URL 的哈希部分 | ||
const hash = window.location.hash; | ||
|
||
// 如果没有哈希,返回空 | ||
if (!hash) { | ||
return {editingGameName: '', currentTag: ''}; | ||
} | ||
|
||
// 移除哈希开头的 #/ ,然后分割字符串 | ||
const parts = hash.slice(2).split('/'); | ||
|
||
// 根据 parts 的长度返回相应的值 | ||
if (parts.length === 0) { | ||
// 哈希存在但没有内容 | ||
return {editingGameName: '', currentTag: ''}; | ||
} else if (parts.length === 1) { | ||
// 只有 editingGameName | ||
return {editingGameName: parts[0], currentTag: ''}; | ||
} else { | ||
// 有 editingGameName 和 currentTag | ||
return {editingGameName: parts[0], currentTag: parts[1]}; | ||
} | ||
} |
Oops, something went wrong.