Skip to content

Commit

Permalink
Update: Add media center website
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed Oct 16, 2023
1 parent b59b35e commit f129880
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 11 deletions.
12 changes: 8 additions & 4 deletions src/class/Media/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// メディアは人類にとっての第四の権力である 権力を持つ者はそれを正しく使わなければならない
// 情報は現代の石油である 情報を多く持つものは資本主義で言うところの富を得る
import { AddClass, AddRainbowBg, AddRainbowBgWithShadow, AddRainbowText } from "../../utils/AddClass";
import GundaiWebSite from "../GundaiWebsite";

export const Media = new GundaiWebSite(
() => {},
() => {},
);
export const Media = new GundaiWebSite(() => {
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");
});
3 changes: 1 addition & 2 deletions src/scripts/content_common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import "../styles/gaming.scss";
import "../styles/kyomu.scss";
import "/styles/gaming.scss";

chrome.runtime.onMessage.addListener((message) => {
if (message === "reload") {
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/content_kyomu.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "/styles/kyomu.scss";

import { Kyomu } from "../class";
import LoadGamingWebsite from "../utils/LoadGamingWebsite";

Expand Down
2 changes: 2 additions & 0 deletions src/scripts/content_media.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "/styles/media.scss";

import { Media } from "../class";
import loadGamingWebsite from "../utils/LoadGamingWebsite";

Expand Down
2 changes: 2 additions & 0 deletions src/scripts/content_moodle.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "/styles/moodle.scss";

import { Moodle } from "../class";
import loadGamingWebsite from "../utils/LoadGamingWebsite";

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/content_mylib.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "../styles/mylibrary.scss";
import "/styles/mylibrary.scss";

import { MyLibrary } from "../class";
import LoadGamingWebsite from "../utils/LoadGamingWebsite";
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/content_sso.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "/styles/sso.scss";

import { SSO } from "../class";
import loadGamingWebsite from "../utils/LoadGamingWebsite";

Expand Down
8 changes: 8 additions & 0 deletions src/styles/gaming.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@
font-weight: bold;
color: transparent;
}

.rainbow-text-shadow {
text-shadow: 0px 0px 40px black;
}

.rainbow-bg-shadow {
box-shadow: 0px 0px 40px white;
}
12 changes: 12 additions & 0 deletions src/styles/media.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.banner_list li a {
font-weight: bold;
}
.menu_category h3{
color: black;
font-weight: bold;
font-size: larger;
}

#news_list li a{
font-weight: bolder;
}
18 changes: 16 additions & 2 deletions src/utils/AddClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export function RemoveClass(queries: string[], classNames: string[]) {
const elements = document.querySelectorAll(query);
elements.forEach((element) => {
//console.log("removing classes from", element);
element.classList.remove(...classNames);
classNames.forEach((className) => {
if (element.classList.contains(className)) element.classList.remove(className);
});
});
});
}
Expand All @@ -22,14 +24,26 @@ export function AddRainbowBg(...queries: string[]) {
AddClass(queries, ["rainbow-bg"]);
}

export function AddRainbowBgWithShadow(...queries: string[]) {
AddClass(queries, ["rainbow-bg", "rainbow-bg-shadow"]);
}

export function AddRainbowText(...queries: string[]) {
AddClass(queries, ["rainbow-text"]);
}

export function AddRainbowTextWithShadow(...queries: string[]) {
AddClass(queries, ["rainbow-text", "rainbow-text-shadow"]);
}

export function RemoveRainbowBg(...queries: string[]) {
RemoveClass(queries, ["rainbow-bg"]);
}

export function RemoveRainbowBgWithShadow(...queries: string[]) {
RemoveClass(queries, ["rainbow-bg", "rainbow-bg-shadow"]);
}

export function RemoveRainbowText(...queries: string[]) {
RemoveClass(queries, ["rainbow-text"]);
RemoveClass(queries, ["rainbow-text", "rainbow-text-shadow"]);
}
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"rootDir": "./src",
"module": "commonjs",
"outDir": "dist",
"strict": true,
Expand Down
4 changes: 3 additions & 1 deletion webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = {

resolve: {
extensions: [".ts", ".js"],
roots: [path.resolve(__dirname, "node_modules"), path.resolve(__dirname, "src")],
},

module: {
Expand Down Expand Up @@ -64,5 +65,6 @@ module.exports = {
}),
new ESLintPlugin(),
],
//devtool: "source-map",

devtool: "source-map",
};

0 comments on commit f129880

Please sign in to comment.