From 330a2787f8d80c8ee7d57c2f696d6a78d3142cb6 Mon Sep 17 00:00:00 2001 From: Haoyu Xu Date: Mon, 23 Oct 2023 18:14:50 -0400 Subject: [PATCH] Revert "feat(directory): added animated cursor" This reverts commit b8a2247406e5be90057ffd0cc147c9722279002b. --- directory/src/App.scss | 2 -- directory/src/component/dropdown.jsx | 14 +-------- directory/src/component/popup.jsx | 2 +- directory/src/component/return_button.jsx | 1 - .../src/component/scss/dropdown.module.scss | 5 ++++ .../src/component/scss/popup.module.scss | 4 +++ .../component/scss/return_button.module.scss | 1 + .../src/component/scss/search_box.module.scss | 1 + .../src/component/scss/switch.module.scss | 1 + .../component/scss/totop_button.module.scss | 1 + directory/src/component/switch.jsx | 1 - directory/src/component/totop_button.jsx | 1 - directory/src/routes/Error.jsx | 20 ------------- directory/src/routes/Root.jsx | 30 +++---------------- directory/src/routes/path/Changelogs.jsx | 1 - directory/src/routes/path/Home.jsx | 15 ++-------- directory/src/routes/path/Operator.jsx | 3 +- directory/src/scss/_page_base.scss | 4 ++- directory/src/scss/root/Root.module.scss | 2 ++ directory/src/scss/root/header.module.scss | 1 + package.json | 1 - pnpm-lock.yaml | 13 -------- 22 files changed, 28 insertions(+), 96 deletions(-) diff --git a/directory/src/App.scss b/directory/src/App.scss index 8e73976..a171714 100644 --- a/directory/src/App.scss +++ b/directory/src/App.scss @@ -15,7 +15,6 @@ --home-item-background-linear-gradient-color: rgba(0, 0, 0, 10%); --home-item-outline-color: rgba(41, 41, 41, 30%); --button-color: #999; - --cursor-color: var(--text-color); } @mixin dark-theme() { @@ -31,7 +30,6 @@ --home-item-background-linear-gradient-color: rgba(255, 255, 255, 10%); --home-item-outline-color: rgba(214, 214, 214, 30%); --button-color: #666; - --cursor-color: var(--text-color); } @media (prefers-color-scheme: dark) { diff --git a/directory/src/component/dropdown.jsx b/directory/src/component/dropdown.jsx index ae663f6..08ffdb0 100644 --- a/directory/src/component/dropdown.jsx +++ b/directory/src/component/dropdown.jsx @@ -1,6 +1,5 @@ import React, { useState, - useCallback } from 'react' import PropTypes from 'prop-types'; import classes from './scss/dropdown.module.scss' @@ -12,17 +11,9 @@ export default function Dropdown(props) { setHidden(!hidden) } - const onMouseEnter = useCallback((item) => { - document.documentElement.style.setProperty('--cursor-color', item.color ? item.color : 'var(--text-color)'); - }, []) - - const onMouseLeave = useCallback(() => { - document.documentElement.style.setProperty('--cursor-color', 'var(--text-color)'); - }, []) - return ( <> -
+
toggleDropdown()} @@ -65,9 +56,6 @@ export default function Dropdown(props) { toggleDropdown() }} style={item.color ? { color: item.color } : {}} - data-type="clickable" - onMouseEnter={() => onMouseEnter(item)} - onMouseLeave={() => onMouseLeave()} > { item.icon ? ( diff --git a/directory/src/component/popup.jsx b/directory/src/component/popup.jsx index a937682..d1e081c 100644 --- a/directory/src/component/popup.jsx +++ b/directory/src/component/popup.jsx @@ -26,7 +26,7 @@ export default function Popup(props) {
toggle()} data-type="clickable"/> + onClick={() => toggle()} />
props.onClick()} - data-type="clickable" >
diff --git a/directory/src/component/scss/dropdown.module.scss b/directory/src/component/scss/dropdown.module.scss index 2644c3b..75586cc 100644 --- a/directory/src/component/scss/dropdown.module.scss +++ b/directory/src/component/scss/dropdown.module.scss @@ -4,6 +4,7 @@ user-select: none; z-index: 2; padding: 0.5em; + cursor: pointer; &.left { .popup, .menu { @@ -38,6 +39,7 @@ z-index: -1; top: 2.5em; right: 0; + cursor: auto; transition: all cubic-bezier(0.65, 0.05, 0.36, 1) 0.3s; overflow: auto; padding: 0.5rem; @@ -91,6 +93,7 @@ border: 1px solid var(--border-color); visibility: hidden; color: var(--link-highlight-color); + cursor: auto; &.left { left: 0; @@ -118,6 +121,7 @@ } .item { + cursor: pointer; padding: 0.5rem; font-size: 1rem; display: flex; @@ -158,6 +162,7 @@ bottom: 0; width: 100vw; height: 100vh; + cursor: auto; } &.active, diff --git a/directory/src/component/scss/popup.module.scss b/directory/src/component/scss/popup.module.scss index a4c0d91..7aaf2a8 100644 --- a/directory/src/component/scss/popup.module.scss +++ b/directory/src/component/scss/popup.module.scss @@ -1,3 +1,7 @@ +.entry-text { + cursor: pointer; +} + .popup { position: fixed; left: 0; diff --git a/directory/src/component/scss/return_button.module.scss b/directory/src/component/scss/return_button.module.scss index 0422523..a4f3b3f 100644 --- a/directory/src/component/scss/return_button.module.scss +++ b/directory/src/component/scss/return_button.module.scss @@ -9,6 +9,7 @@ align-items: flex-start; padding: 0.6rem 0; width: 3rem; + cursor: pointer; .wrapper { display: flex; diff --git a/directory/src/component/scss/search_box.module.scss b/directory/src/component/scss/search_box.module.scss index 401daee..7e72f59 100644 --- a/directory/src/component/scss/search_box.module.scss +++ b/directory/src/component/scss/search_box.module.scss @@ -49,6 +49,7 @@ right: 1rem; width: 2rem; height: 2rem; + cursor: pointer; opacity: 0; transition: all cubic-bezier(0.65, 0.05, 0.36, 1) 0.3s; visibility: hidden; diff --git a/directory/src/component/scss/switch.module.scss b/directory/src/component/scss/switch.module.scss index 5dcab84..621bff1 100644 --- a/directory/src/component/scss/switch.module.scss +++ b/directory/src/component/scss/switch.module.scss @@ -3,6 +3,7 @@ user-select: none; z-index: 2; padding: 8px 36px 8px 8px; + cursor: pointer; display: flex; flex-direction: row; align-items: center; diff --git a/directory/src/component/scss/totop_button.module.scss b/directory/src/component/scss/totop_button.module.scss index 2468f13..eb0f760 100644 --- a/directory/src/component/scss/totop_button.module.scss +++ b/directory/src/component/scss/totop_button.module.scss @@ -2,6 +2,7 @@ position: fixed; user-select: none; z-index: 2; + cursor: pointer; height: 2rem; right: 2rem; bottom: 1rem; diff --git a/directory/src/component/switch.jsx b/directory/src/component/switch.jsx index 93f7645..e3998e5 100644 --- a/directory/src/component/switch.jsx +++ b/directory/src/component/switch.jsx @@ -21,7 +21,6 @@ export default function Switch(props) { props.handleOnClick(!on) } }} - data-type="clickable" > {i18n(props.text)}
diff --git a/directory/src/component/totop_button.jsx b/directory/src/component/totop_button.jsx index 30a796d..8db38c7 100644 --- a/directory/src/component/totop_button.jsx +++ b/directory/src/component/totop_button.jsx @@ -52,7 +52,6 @@ export default function ToTopButton(props) { <>
{ smoothScroll("#root") }} - data-type="clickable" >
diff --git a/directory/src/routes/Error.jsx b/directory/src/routes/Error.jsx index 0076eed..7577447 100644 --- a/directory/src/routes/Error.jsx +++ b/directory/src/routes/Error.jsx @@ -20,7 +20,6 @@ import { useHeader } from '@/state/header'; import VoiceElement from '@/component/voice'; import spine from '!/libs/spine-player' import '!/libs/spine-player.css' -import AnimatedCursor from "react-animated-cursor" import useUmami from '@/state/insights'; const voiceOnAtom = atomWithStorage('voiceOn', false) @@ -187,25 +186,6 @@ export default function Error() { handleAduioStateChange={handleAduioStateChange} /> -
); } \ No newline at end of file diff --git a/directory/src/routes/Root.jsx b/directory/src/routes/Root.jsx index fbcf3df..ce738dc 100644 --- a/directory/src/routes/Root.jsx +++ b/directory/src/routes/Root.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useMemo, - useCallback, + useCallback } from 'react' import PropTypes from 'prop-types'; import { @@ -29,7 +29,6 @@ import Popup from '@/component/popup'; import Border from '@/component/border'; import CharIcon from '@/component/char_icon'; import ToTopButton from '@/component/totop_button'; -import AnimatedCursor from "react-animated-cursor" const currentYear = new Date().getFullYear() @@ -88,7 +87,6 @@ export default function Root() {
toggleDrawer()} - data-type="clickable" >
@@ -139,25 +137,6 @@ export default function Root() { - ) } @@ -170,7 +149,7 @@ function FooterElement() { return (