Skip to content

Commit 5e8a461

Browse files
committed
feat: 콘텐츠 스크립트 컴포넌트 렌더링
1 parent 4062f27 commit 5e8a461

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

src/contentScripts/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createRoot } from 'react-dom/client';
22
import { onMessage } from 'webext-bridge/content-script';
33
import browser from 'webextension-polyfill';
44

5+
import '~/shared/styles';
56
import { renderApp } from './render';
67

78
// Firefox `browser.tabs.executeScript()` requires scripts return a primitive value
@@ -16,6 +17,9 @@ import { renderApp } from './render';
1617
// mount component to context window
1718
const container = document.createElement('div');
1819
container.id = __NAME__;
20+
container.style.setProperty('z-index', '2147483647', 'important');
21+
container.style.setProperty('position', 'relative', 'important');
22+
container.style.setProperty('color-scheme', 'normal', 'important');
1923
const root = document.createElement('div');
2024
const styleEl = document.createElement('link');
2125
const shadowDOM = container.attachShadow?.({ mode: __DEV__ ? 'open' : 'closed' }) || container;

src/contentScripts/pages/App.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import { Button } from '~/shared/ui';
55

66
export const App = () => {
77
return (
8-
<div>
9-
<div className="fixed right-0 bottom-0 m-5 z-99999 select-none">
10-
<Button className="rounded-full">
11-
<IconCat />
12-
</Button>
8+
<div className="fixed h-dvh w-0 top-0 right-0 theme-blue">
9+
<div className="absolute w-14 select-none top-0 right-0 transform-translate-x-0 transform-translate-y-80">
10+
<div className="w-14 h-64 shadow-scrollbar-container rounded-6 cursor-pointer bg-primary transform-translate-x-0 transition-transform">
11+
<Button className="size-full rounded-6!">
12+
<IconCat />
13+
</Button>
14+
</div>
1315
</div>
1416
</div>
1517
);

unocss.config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@ export default defineConfig({
146146
};
147147
},
148148
],
149+
[
150+
'shadow-scrollbar-container',
151+
{
152+
'box-shadow':
153+
'rgba(0, 0, 0, 0.4) 0px 0px 0.5px 0px, rgba(0, 0, 0, 0.09) 0px 1px 3px 0px, rgba(0, 0, 0, 0.09) 0px 4px 8px 0px',
154+
},
155+
],
149156
],
150157
shortcuts: {
151158
container:

0 commit comments

Comments
 (0)