-
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
11 changed files
with
149 additions
and
71 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,17 +1,67 @@ | ||
// 無駄とは人生である。無駄を極めよ。無駄を愛せ。無駄を生きろ。 | ||
// 無駄を以て物を成す者は、無駄を以て物を滅ぼす者に勝る。x | ||
|
||
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"; | ||
|
||
// GundaiWebSiteはゲーミング化するウェブサイトを定義したクラス | ||
// 型変数とAdditionalInfoプロパティによって任意の情報を追加できる | ||
export default class GundaiWebSite<T> { | ||
classes: { | ||
RainbowText: string[]; | ||
RainbowTextShadow: string[]; | ||
RainbowBg: string[]; | ||
RainbowBgShadow: string[]; | ||
}; | ||
|
||
constructor(enable?: () => void, disable?: () => void) { | ||
if (enable) this.EnableRainbow = enable; | ||
if (disable) this.DisableRainbow = disable; | ||
this.AdditionalInfo = {} as T; | ||
|
||
this.additionalInfo = {} as T; | ||
this.classes = { | ||
RainbowText: [], | ||
RainbowTextShadow: [], | ||
RainbowBg: [], | ||
RainbowBgShadow: [], | ||
}; | ||
|
||
this.EnableRainbow.bind(this); | ||
this.DisableRainbow.bind(this); | ||
} | ||
EnableRainbow() {} | ||
DisableRainbow() {} | ||
AdditionalInfo: T; | ||
additionalInfo: T; | ||
|
||
AddRainbowBg(...elements: Elements[]) { | ||
AddClass(elements, [rainbowBg, ...this.classes.RainbowBg]); | ||
} | ||
AddRainbowBgWithShadow(...elements: Elements[]) { | ||
AddClass(elements, [rainbowBg, rainbowBgShadow, ...this.classes.RainbowBgShadow]); | ||
} | ||
AddRainbowText(...elements: Elements[]) { | ||
AddClass(elements, [rainbowText, ...this.classes.RainbowText]); | ||
} | ||
AddRainbowTextWithShadow(...elements: Elements[]) { | ||
AddClass(elements, [rainbowText, rainbowTextShadow, ...this.classes.RainbowTextShadow]); | ||
} | ||
|
||
RemoveRainbowBg(...elements: Elements[]) { | ||
RemoveClass(elements, [rainbowBg, ...this.classes.RainbowBg]); | ||
} | ||
RemoveRainbowBgWithShadow(...elements: Elements[]) { | ||
RemoveClass(elements, [rainbowBg, rainbowBgShadow, ...this.classes.RainbowBgShadow]); | ||
} | ||
RemoveRainbowText(...elements: Elements[]) { | ||
RemoveClass(elements, [rainbowText, ...this.classes.RainbowText]); | ||
} | ||
RemoveRainbowTextWithShadow(...elements: Elements[]) { | ||
RemoveClass(elements, [rainbowText, rainbowTextShadow, ...this.classes.RainbowTextShadow]); | ||
} | ||
} | ||
|
||
// 型変数使うとかっこいいよね |
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,12 +1,13 @@ | ||
// メディアは人類にとっての第四の権力である 権力を持つ者はそれを正しく使わなければならない | ||
// 情報は現代の石油である 情報を多く持つものは資本主義で言うところの富を得る | ||
import { AddClass, AddRainbowBg, AddRainbowBgWithShadow, AddRainbowText } from "../../utils/AddClass"; | ||
import { AddClass } from "../../utils/AddClass"; | ||
import GundaiWebSite from "../GundaiWebsite"; | ||
|
||
export const Media = new GundaiWebSite(() => { | ||
AddRainbowBgWithShadow(".banner_list li"); | ||
export const Media = new GundaiWebSite(); | ||
Media.EnableRainbow = function () { | ||
this.AddRainbowBgWithShadow(".banner_list li"); | ||
AddClass([".banner_list li a"], ["rainbow-bg-shadow"]); | ||
AddRainbowBgWithShadow(".menu_category h3"); | ||
AddRainbowText("#news_list li a"); | ||
AddRainbowBg("#news_category_list .active"); | ||
}); | ||
this.AddRainbowBgWithShadow(".menu_category h3"); | ||
this.AddRainbowText("#news_list li a"); | ||
this.AddRainbowBg("#news_category_list .active"); | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import GundaiWebSite from "../GundaiWebsite"; | ||
|
||
export interface MoodleAdditionalInfo { | ||
headerText: string; | ||
} | ||
|
||
export type Moodle = GundaiWebSite<MoodleAdditionalInfo>; |
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