mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 05:42:55 -04:00
Update WallpaperFree
This commit is contained in:
parent
8e01e87868
commit
d5187a752b
2 changed files with 20 additions and 4 deletions
|
@ -5,8 +5,9 @@
|
|||
*/
|
||||
|
||||
import { openModal } from "@utils/modal";
|
||||
import { makeCodeblock } from "@utils/text";
|
||||
import { findByCodeLazy, findStoreLazy } from "@webpack";
|
||||
import { Button, FluxDispatcher } from "@webpack/common";
|
||||
import { Button, FluxDispatcher, Parser } from "@webpack/common";
|
||||
|
||||
import { SetCustomWallpaperModal, SetDiscordWallpaperModal } from "./modal";
|
||||
|
||||
|
@ -49,6 +50,16 @@ export function GlobalDefaultComponent() {
|
|||
);
|
||||
}
|
||||
|
||||
export function TipsComponent() {
|
||||
const tipText = `
|
||||
[class^=wallpaperContainer] {
|
||||
transform: scaleX(-1); /* flip it horizontally */
|
||||
filter: blur(4px); /* apply a blur */
|
||||
opacity: 0.7; /* self-explanatory */
|
||||
}`;
|
||||
return Parser.parse(makeCodeblock(tipText, "css"));
|
||||
}
|
||||
|
||||
export interface Wallpaper {
|
||||
id: string;
|
||||
label: string;
|
||||
|
|
|
@ -13,7 +13,7 @@ import { useStateFromStores } from "@webpack/common";
|
|||
import { Channel } from "discord-types/general";
|
||||
|
||||
import { ChannelContextPatch, GuildContextPatch, UserContextPatch } from "./components/ctxmenu";
|
||||
import { GlobalDefaultComponent, Wallpaper } from "./components/util";
|
||||
import { GlobalDefaultComponent, TipsComponent, Wallpaper } from "./components/util";
|
||||
import { WallpaperFreeStore } from "./store";
|
||||
|
||||
|
||||
|
@ -23,6 +23,11 @@ const settings = definePluginSettings({
|
|||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
stylingTips: {
|
||||
description: "",
|
||||
type: OptionType.COMPONENT,
|
||||
component: TipsComponent,
|
||||
},
|
||||
globalDefault: {
|
||||
description: "Set a global default wallpaper for all channels.",
|
||||
type: OptionType.COMPONENT,
|
||||
|
@ -48,8 +53,8 @@ export default definePlugin({
|
|||
replace: "$&vcWpFreeCustom||"
|
||||
},
|
||||
{
|
||||
match: /(\i=).{0,25}\.asset\):null/,
|
||||
replace: "$1arguments[0].chatWallpaperState.vcWallpaperUrl"
|
||||
match: /(\i)=(.{1,50}asset.+?(?=,\i=))(?=.+?concat\(\1)/,
|
||||
replace: "$1=arguments[0].chatWallpaperState.vcWallpaperUrl||($2)"
|
||||
},
|
||||
{
|
||||
match: /(\i\.isViewable&&)(null!=\i)/,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue