-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from guocaoyi/feat/v0.5
merge(0.5): merge feat/v0.5 to main
- Loading branch information
Showing
42 changed files
with
545 additions
and
28 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/icons/logo.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Chrome Extensioin + Alpine + JS + Vite App - Options</title> | ||
<link rel="stylesheet" href="/common.css" /> | ||
</head> | ||
<body> | ||
<main> | ||
<h3>Options Page!</h3> | ||
|
||
<h6>v 0.0.0</h6> | ||
|
||
<a | ||
href="https://www.npmjs.com/package/create-chrome-ext" | ||
target="_blank" | ||
x-data="{ crx: '' }" | ||
x-text="crx" | ||
x-init="() => { | ||
crx = 'Power by create-chrome-ext'; | ||
}" | ||
> | ||
</a> | ||
</main> | ||
<script type="module" src="/src/options/index.js"></script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "chrome-extension-alpine-js", | ||
"version": "0.0.0", | ||
"author": "", | ||
"description": "", | ||
"type": "module", | ||
"license": "MIT", | ||
"keywords": [ | ||
"chrome-extension", | ||
"alpine", | ||
"alpinejs", | ||
"vite", | ||
"create-chrome-ext" | ||
], | ||
"engines": { | ||
"node": ">=14.18.0" | ||
}, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"alpinejs": "^3.10.2" | ||
}, | ||
"devDependencies": { | ||
"@types/chrome": "0.0.193", | ||
"@crxjs/vite-plugin": "^1.0.12", | ||
"vite": "^2.9.13" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/icons/logo.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Chrome Extensioin + Alpine + JS + Vite App - Popup</title> | ||
<link rel="stylesheet" href="/common.css" /> | ||
</head> | ||
<body> | ||
<main> | ||
<h3>Popup Page!</h3> | ||
|
||
<h6>v 0.0.0</h6> | ||
|
||
<a | ||
href="https://www.npmjs.com/package/create-chrome-ext" | ||
target="_blank" | ||
x-data="{ crx: '' }" | ||
x-text="crx" | ||
x-init="() => { | ||
crx = 'Power by create-chrome-ext'; | ||
}" | ||
> | ||
</a> | ||
</main> | ||
<script type="module" src="/src/popup/index.js"></script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
:root { | ||
font-family: Inter, Avenir, Helvetica, Arial, sans-serif; | ||
font-size: 16px; | ||
line-height: 24px; | ||
font-weight: 400; | ||
|
||
color-scheme: light dark; | ||
color: rgba(255, 255, 255, 0.87); | ||
background-color: #242424; | ||
|
||
font-synthesis: none; | ||
text-rendering: optimizeLegibility; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
-webkit-text-size-adjust: 100%; | ||
} | ||
|
||
body { | ||
min-width: 20rem; | ||
} | ||
|
||
:root { | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, | ||
'Open Sans', 'Helvetica Neue', sans-serif; | ||
} | ||
|
||
main { | ||
text-align: center; | ||
padding: 1em; | ||
margin: 0 auto; | ||
} | ||
|
||
h3 { | ||
color: #3999b1; | ||
text-transform: uppercase; | ||
font-size: 1.5rem; | ||
font-weight: 200; | ||
line-height: 1.2rem; | ||
margin: 2rem auto; | ||
} | ||
|
||
h6 { | ||
font-size: 0.5rem; | ||
color: #cccccc; | ||
margin: 0.5rem; | ||
} | ||
|
||
a { | ||
font-size: 0.5rem; | ||
margin: 0.5rem; | ||
color: #cccccc; | ||
text-decoration: none; | ||
} | ||
|
||
@media (min-width: 480px) { | ||
h3 { | ||
max-width: none; | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
console.info('chrome-ext template-alpine-js background script') | ||
|
||
export {} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
console.info('chrome-ext template-alpine-js content script') | ||
|
||
export {} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { defineManifest } from '@crxjs/vite-plugin' | ||
|
||
export default defineManifest({ | ||
name: 'create-chrome-ext', | ||
description: '', | ||
version: '0.0.0', | ||
manifest_version: 3, | ||
icons: { | ||
16: 'img/logo-16.png', | ||
32: 'img/logo-34.png', | ||
48: 'img/logo-48.png', | ||
128: 'img/logo-128.png', | ||
}, | ||
action: { | ||
default_popup: 'popup.html', | ||
default_icon: 'img/logo-48.png', | ||
}, | ||
options_page: 'options.html', | ||
background: { | ||
service_worker: 'src/background/index.js', | ||
type: 'module', | ||
}, | ||
content_scripts: [ | ||
{ | ||
matches: ['http://*/*', 'https://*/*'], | ||
js: ['src/content/index.js'], | ||
}, | ||
], | ||
web_accessible_resources: [ | ||
{ | ||
resources: ['img/logo-16.png', 'img/logo-34.png', 'img/logo-48.png', 'img/logo-128.png'], | ||
matches: [], | ||
}, | ||
], | ||
permissions: [], | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Alpine from 'alpinejs' | ||
|
||
const dropdown = () => { | ||
return { | ||
show: false, | ||
open() { | ||
this.show = true | ||
}, | ||
close() { | ||
this.show = false | ||
}, | ||
isOpen() { | ||
return this.show === true | ||
}, | ||
} | ||
} | ||
|
||
Reflect.set(window, 'dropdown', dropdown) | ||
|
||
Alpine.start() | ||
window.Alpine = Alpine |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Alpine from 'alpinejs' | ||
|
||
window.Alpine = Alpine | ||
|
||
Alpine.start() | ||
|
||
Alpine.data('dropdown', () => ({ | ||
open: false, | ||
|
||
toggle() { | ||
this.open = !this.open | ||
}, | ||
})) | ||
|
||
console.info('popup index.js loaded') |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { defineConfig } from 'vite' | ||
import { crx } from '@crxjs/vite-plugin' | ||
|
||
import manifest from './src/manifest.js' | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig(({ mode }) => { | ||
return { | ||
build: { | ||
emptyOutDir: true, | ||
outDir: 'build', | ||
rollupOptions: { | ||
output: { | ||
chunkFileNames: 'assets/chunk-[hash].js', | ||
}, | ||
}, | ||
}, | ||
|
||
plugins: [crx({ manifest })], | ||
} | ||
}) |
Oops, something went wrong.