deploy: d4487e16e732e491a4b05a26d5387eb1f7241bf0
This commit is contained in:
parent
15289bb0a5
commit
dd79c207a4
2 changed files with 26 additions and 0 deletions
25
Chat-Bubbles/index.js
Normal file
25
Chat-Bubbles/index.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
(function(n,l,c,t,h){"use strict";const o={avatarRadius:12,bubbleChatRadius:12,bubbleChatColor:""},C=function(){return{...o,...l.storage}},u=function(e){Object.assign(l.storage,e)};let s=[];const a=function(){const e=C(),{avatarRadius:b,bubbleChatRadius:r,bubbleChatColor:m}=e,d=document.createElement("style");d.id="chat-bubbles-style";const p=m||"var(--background-tertiary)";d.textContent=`
|
||||
/* Chat message styling */
|
||||
.message_d5deea {
|
||||
background-color: ${p};
|
||||
border-radius: ${r}px;
|
||||
padding: 8px 12px;
|
||||
margin: 2px 0;
|
||||
max-width: 80%;
|
||||
}
|
||||
|
||||
/* Avatar styling */
|
||||
.avatar_f8541f {
|
||||
border-radius: ${b}px !important;
|
||||
}
|
||||
|
||||
/* Message content adjustments */
|
||||
.contents_f9f2ca {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Message group styling */
|
||||
.groupStart_d5deea {
|
||||
margin-top: 8px;
|
||||
}
|
||||
`;const i=document.getElementById("chat-bubbles-style");i&&i.remove(),document.head.appendChild(d)},f=function(){const e=document.getElementById("chat-bubbles-style");e&&e.remove()};var g={onLoad:function(){try{a();const e=c.findByProps("Message","MessageContent");e&&s.push(h.after("type",e,function(b,r){return setTimeout(a,100),r})),t.showToast("ChatBubbles loaded successfully!",t.showToast.Kind.SUCCESS)}catch(e){console.error("Failed to load ChatBubbles:",e),t.showToast("Failed to load ChatBubbles plugin",t.showToast.Kind.FAILURE)}},onUnload:function(){try{s.forEach(function(e){return e()}),s=[],f(),t.showToast("ChatBubbles unloaded",t.showToast.Kind.SUCCESS)}catch(e){console.error("Failed to unload ChatBubbles:",e)}},settings:{avatarRadius:{type:"slider",title:"Avatar Curve",note:"Adjust the border radius of avatars",default:o.avatarRadius,min:0,max:18,step:3,onValueChange:function(e){u({avatarRadius:e}),a()}},bubbleChatRadius:{type:"slider",title:"Bubble Curve",note:"Adjust the border radius of chat bubbles",default:o.bubbleChatRadius,min:0,max:18,step:3,onValueChange:function(e){u({bubbleChatRadius:e}),a()}},bubbleChatColor:{type:"text",title:"Bubble Color",note:"The color of the chat bubble (in #RRGGBBAA format). When empty, default background is used.",default:o.bubbleChatColor,placeholder:"#RRGGBBAA",onValueChange:function(e){e===""||/^#[0-9A-Fa-f]{8}$/.test(e)?(u({bubbleChatColor:e}),a()):t.showToast("Invalid color format! Use #RRGGBBAA",t.showToast.Kind.FAILURE)}}}};return n.default=g,Object.defineProperty(n,"__esModule",{value:!0}),n})({},vendetta.plugin,vendetta.metro,vendetta.ui.toasts,vendetta.patcher);
|
||||
1
Chat-Bubbles/manifest.json
Normal file
1
Chat-Bubbles/manifest.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"authors":[{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","name":"Chat Bubbles","description":"Make the messages be in... bubbles...?","vendetta":{"icon":"ChatIcon","original":"plugins/Chat-Bubbles"},"version":"1.0.0","hash":"c346cfc7bf7d5d6f94b25974baad8334aca7f3e5d04c2824d0eebc772f8e1910"}
|
||||
Loading…
Add table
Reference in a new issue