-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
373 additions
and
189 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
## Todo | ||
|
||
### ウェブサイト | ||
### ゲーミング | ||
|
||
- [ ] [mdl.media.gunma-u.ac.jp](https://mdl.media.gunma-u.ac.jp/GU/index.php) | ||
- [ ] [www.kyomu-sys.gunma-u.ac.jp](https://www.kyomu-sys.gunma-u.ac.jp/Portal/) | ||
- [ ] [www.media.gunma-u.ac.jp](https://www.media.gunma-u.ac.jp/) | ||
- [ ] [www.gunma-u.ac.jp](https://www.gunma-u.ac.jp/) | ||
- SSOログイン画面 | ||
- [x] 基本的な実装 | ||
- [ ] 見やすさの改善 | ||
- [mdl.media.gunma-u.ac.jp](https://mdl.media.gunma-u.ac.jp/GU/index.php) | ||
- [x] 基本的な実装 | ||
- [www.kyomu-sys.gunma-u.ac.jp](https://www.kyomu-sys.gunma-u.ac.jp/Portal/) | ||
- [x] 基本的な実装 | ||
- [www.media.gunma-u.ac.jp](https://www.media.gunma-u.ac.jp/) | ||
- [x] 基本的な実装 | ||
- [opac.lib.gunma-u.ac.jp](https://opac.lib.gunma-u.ac.jp/opc/) | ||
- [x] 基本的な実装 | ||
- [www.gunma-u.ac.jp](https://www.gunma-u.ac.jp/) | ||
- [ ] 基本的な実装 | ||
|
||
### ダークモード | ||
|
||
- SSOログイン画面 | ||
- [ ] 基本的な実装 | ||
- [mdl.media.gunma-u.ac.jp](https://mdl.media.gunma-u.ac.jp/GU/index.php) | ||
- [ ] 基本的な実装 | ||
- [www.kyomu-sys.gunma-u.ac.jp](https://www.kyomu-sys.gunma-u.ac.jp/Portal/) | ||
- [ ] 基本的な実装 | ||
- [www.media.gunma-u.ac.jp](https://www.media.gunma-u.ac.jp/) | ||
- [ ] 基本的な実装 | ||
- [opac.lib.gunma-u.ac.jp](https://opac.lib.gunma-u.ac.jp/opc/) | ||
- [ ] 基本的な実装 | ||
- [www.gunma-u.ac.jp](https://www.gunma-u.ac.jp/) | ||
- [ ] 基本的な実装 | ||
|
||
### 開発 | ||
|
||
- [ ] [webpack-chrome-extension-reloader](https://www.npmjs.com/package/webpack-chrome-extension-reloader)でホットリロードに対応する | ||
- [ ] SCSSで直にスタイルを書き込んだ場合に無効化できない問題を修正する | ||
- [x] SCSSで直にスタイルを書き込んだ場合に無効化できない問題を修正する | ||
- [ ] リロードなしで有効化/無効化できるようにする | ||
- [ ] Reactコンポーネントを最適化する | ||
- [ ] テストを書く | ||
- [ ] ドキュメントを書く | ||
- [ ] 設定を開いている間はポップアップを無効化する | ||
- [x] 設定を開いている間はポップアップを無効化する | ||
- [ ] ポップアップでの設定変更後に手動でリロードする必要がある問題を修正する |
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,83 @@ | ||
import { addClass, Elements, removeClass } from "../utils/addClass"; | ||
|
||
const rainbowBg = "rainbow-bg"; | ||
const rainbowText = "rainbow-text"; | ||
const rainbowBgShadow = "rainbow-bg-shadow"; | ||
const rainbowTextShadow = "rainbow-text-shadow"; | ||
|
||
// 要素にclassNameを追加します | ||
// baseとclassesで追加するclassNameを指定し、applyで適用、removeで削除します | ||
// selectorで適用されるセレクタを取得できます | ||
// baseは初期化に必ず指定する必要があり書き換えるべきではありませんが、classesは追加で個別の設定を行うために指定できます | ||
export class classApplicator { | ||
#base: string[]; | ||
classes: string[]; | ||
constructor(base: string[]) { | ||
this.#base = base; | ||
this.classes = []; | ||
} | ||
|
||
apply(...elements: Elements[]) { | ||
addClass(elements, [...this.#base, ...this.classes]); | ||
} | ||
remove(...elements: Elements[]) { | ||
removeClass(elements, [...this.#base, ...this.classes]); | ||
} | ||
selector() { | ||
if (this.classes.length === 0) return `.${this.#base}`; | ||
else return `.${this.#base}.${this.classes.join(".")}`; | ||
} | ||
} | ||
|
||
export class ApplicatorBase { | ||
enable() {} | ||
disable() {} | ||
} | ||
|
||
// classApplicatorを用いて虹色にするクラス | ||
export class RainbowApplicator extends ApplicatorBase { | ||
text: classApplicator; | ||
bg: classApplicator; | ||
textShadow: classApplicator; | ||
bgShadow: classApplicator; | ||
|
||
constructor() { | ||
super(); | ||
this.text = new classApplicator([rainbowText]); | ||
this.bg = new classApplicator([rainbowBg]); | ||
this.textShadow = new classApplicator([rainbowText, rainbowTextShadow]); | ||
this.bgShadow = new classApplicator([rainbowBg, rainbowBgShadow]); | ||
} | ||
} | ||
|
||
// 隠し機能を有効化するクラス | ||
export class HiddenApplicator extends ApplicatorBase {} | ||
|
||
// classApplicatorを用いてダークテーマにするクラス | ||
export class DarkApplicator extends ApplicatorBase { | ||
bgBase: classApplicator; | ||
bgBaseDarker: classApplicator; | ||
bgContent: classApplicator; | ||
bgNeutral: classApplicator; | ||
bgAccent: classApplicator; | ||
textBase: classApplicator; | ||
textBaseDarker: classApplicator; | ||
textContent: classApplicator; | ||
textNeutral: classApplicator; | ||
textAccent: classApplicator; | ||
|
||
constructor() { | ||
super(); | ||
|
||
this.bgBase = new classApplicator(["bg-base"]); | ||
this.bgBaseDarker = new classApplicator(["bg-base-darker"]); | ||
this.bgContent = new classApplicator(["bg-content"]); | ||
this.bgNeutral = new classApplicator(["bg-neutral"]); | ||
this.bgAccent = new classApplicator(["bg-accent"]); | ||
this.textBase = new classApplicator(["text-base"]); | ||
this.textBaseDarker = new classApplicator(["text-base-darker"]); | ||
this.textContent = new classApplicator(["text-content"]); | ||
this.textNeutral = new classApplicator(["text-neutral"]); | ||
this.textAccent = new classApplicator(["text-accent"]); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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,12 @@ | ||
import changeQueryInnerHTML from "../../utils/changeQueryInnerHTML"; | ||
import { RainbowApplicator } from "../ClassApplicator"; | ||
|
||
export const DisableRainbowBg = (rainbow: RainbowApplicator) => { | ||
rainbow.bg.remove(".navbar", ".addinghtml"); | ||
rainbow.bg.remove(".page-header-headings h1"); | ||
rainbow.bg.remove("a"); | ||
}; | ||
|
||
export const ReplaceImagesToDefault = () => { | ||
changeQueryInnerHTML("#instance-320-header", "現在のログイン人数"); | ||
}; |
28 changes: 15 additions & 13 deletions
28
src/class/Moodle/EnableRainbow.ts → src/class/Moodle/enable-utils.ts
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
Oops, something went wrong.