Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
LiAohua authored and LiAohua committed Jan 2, 2024
1 parent cc659e9 commit f4a1411
Show file tree
Hide file tree
Showing 45 changed files with 1,864 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# 🏗 Bodhi AI Explorer
# 🏗 Bodhi-Bodhi

<h4 align="center">
<a href="https://smart-contract-explorer.movespace.xyz/"> -[ Lanuch App ]- </a>
<a href="https://bodhi.wtf/13773"> -[ Whitepaper on Bodhi ]- </a>
<a href="https://google.com/"> -[ Lanuch App ]- </a>
</h4>

🧪 Bodhi AI Explorer 是一个基于向量化数据和智能合约的 Bodhi 内容搜索和去中心化内容标注 App。
🧪 Bodhi-Bodhi 包含 dApp 和浏览器插件,集成了如下功能:

- 订阅一个作者
- 分享这篇文章
- 将当前持有的 Shares 赠送他人
- 查看当前文章隐藏内容
- 给这篇文章作标记
- Awesome Bodhi Apps


## Quickstart
Expand Down
4 changes: 4 additions & 0 deletions extension/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
/.next
/node_modules
/.env
21 changes: 21 additions & 0 deletions extension/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Justinas Kairys (ibnzUk.eth)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
108 changes: 108 additions & 0 deletions extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Next.js Chrome Extension Starter 🚀

Next.js Chrome Extension Starter is a demo example application that demonstrates how to build a Chrome extension using Next.js.

## Table of Contents ✨

- [Description](#description)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

# Description

The Next.js Chrome Extension Starter provides a foundation for building Chrome extensions using Next.js, React, and other related technologies. It showcases the integration of Next.js and Chrome extension development by demonstrating a simple application with multiple pages.


![Preview](Screen2.jpg)

# Installation

To install and run Next.js Chrome Extension Starter locally, follow these steps:

1. Clone this repository:

```bash
git clone https://github.com/ibnzUK/next-chrome-starter.git
```
2. Navigate to project directory:

```
cd next-chrome-starter
```
4. Install the dependencies using npm:
```
npm install
```

# Usage
## Usage Locally 🔥
To run the Next.js Chrome Extension Starter locally, follow these steps:

Run the project:
```
npm run dev
```
`This will run project on your localhost`
http://localhost:3000/
## Build and Import To Chrome 🔥
To build and import Next.js Chrome Extension Starter to chrome browser, follow these steps:
1. Build the project:
```
npm run build
```
`This will run prep and export to create new folder 'out/', and rename '_next' forlder to 'next' (without underscore)`
2. Open Google Chrome and go to chrome://extensions.
3. Enable the "Developer mode" toggle switch.
4. Click on "Load unpacked" and select the out folder generated by the build process.
5. The Next.js Chrome Extension Starter should now be loaded as an unpacked extension in Google Chrome.
![Preview](Screen1.jpg)
# Contributing
Contributions to the Next.js Chrome Extension Starter are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.
# License
This project is licensed under the MIT License.
Feel free to customize and modify it based on your specific requirements.
Make sure to include any additional information, such as troubleshooting tips or specific
Chrome extension functionality, to provide a comprehensive guide for users.
```
MIT License

Copyright (c) 2023 Justinas Kairys (ibnzUk.eth)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

```
Binary file added extension/Screen1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/Screen2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions extension/components/Footer/Footer.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.footer {
width: 400px;
display: flex;
flex: 1;
height: 20px;
padding: 20px;

}

.footer a {
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
font-size: medium;
color: #757bc3;
}

.logo {
height: 1em;
margin-left: 0.5rem;
}
17 changes: 17 additions & 0 deletions extension/components/Footer/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import styles from './Footer.module.css';

export default function Footer() {
return (
<footer className={styles.footer}>
<a
href="https://x.com/0xleeduckgo"
target="_blank"
rel="noopener noreferrer"
>
<span>
❤️follow my twitter❤️
</span>
</a>
</footer>
);
}
7 changes: 7 additions & 0 deletions extension/components/Header/Header.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.head {
display: flex;
justify-content: center;
width: 400px;
font-size: medium;
color: #757bc3;
}
9 changes: 9 additions & 0 deletions extension/components/Header/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import styles from './Header.module.css';

export default function Header() {
return (
<>
<p className={styles.head}>Header / Menu / Navigation</p>
</>
);
}
47 changes: 47 additions & 0 deletions extension/components/Index/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import styles from '../../styles/Pages.module.css';

export default function Index({ navigateToPage }) {
// Awesome Bodhi Apps
// Subscribe Author -> Bodhi RSS
// Share as Iframe
// Transfer!
// See the Reveal Things
// Tag Things
return (
<div className={styles.container}>
<main className={styles.main}>

<h3 className={styles.title}>Bodhi Bodhi</h3>
{/*hr></hr> */}
<a href="https://projects.noncegeek.com/?tag=bodhi" target="_blank" rel="noreferrer">
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Share this Asset
</button>
</a>
<hr></hr>
<a href="https://projects.noncegeek.com/?tag=bodhi" target="_blank" rel="noreferrer">
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Tag this Asset
</button>
</a>
<hr></hr>
{/* <h3 className={styles.title}>Tag this asset</h3>
<hr></hr> */}
{/* <h3 className={styles.title}>Awesome Bodhi Apps</h3> */}
<a href="https://projects.noncegeek.com/?tag=bodhi" target="_blank" rel="noreferrer">
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
See Awesome Bodhi Apps
</button>
</a>
{/* <p className={styles.description}>
This is an example of a Browser Extension built with NEXT.JS. Please
refer to the GitHub repo for running instructions and documentation
</p>
<h1 className={styles.code}>Awesome Bodhi Apps</h1>
<p>{"[ - This is Index page content - ]"}</p>
<p onClick={() => navigateToPage('new')}>{"Go to New Page >"}</p>*/}
</main>
</div>
);
}
19 changes: 19 additions & 0 deletions extension/components/New/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import styles from '../../styles/Pages.module.css';

export default function New({ navigateToPage}) {
return (
<div className={styles.container}>
<main className={styles.main}>
<h1 className={styles.title}>NEXT-CHROME-STARTER</h1>
<p className={styles.description}>
This is an example of a Browser Extension built with NEXT.JS.
Please refer to the GitHub repo for running instructions and
documentation
</p>
<h1 className={styles.code}>New Page ./components/New/index.js</h1>
<p>{"[ - This is New page content - ]"}</p>
<p onClick={() => navigateToPage('index')}>{"< Go Back"}</p>
</main>
</div>
);
}
22 changes: 22 additions & 0 deletions extension/out.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// create out directory for static Chrome Extension

const fs = require('fs');
const glob = require('glob');

const files = glob.sync('out/**/*.html');
files.forEach((file) => {
const content = fs.readFileSync(file, 'utf-8');
const modifiedContent = content.replace(/\/_next/g, './next');
fs.writeFileSync(file, modifiedContent, 'utf-8');
});

const sourcePath = 'out/_next';
const destinationPath = 'out/next';

fs.rename(sourcePath, destinationPath, (err) => {
if (err) {
console.error('Failed to rename "_next" directory to "next".', err);
} else {
console.log('Renamed "_next" directory to "next" successfully.');
}
});
1 change: 1 addition & 0 deletions extension/out/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link rel="preload" href="./next/static/css/fd62b12307a4ad68.css" as="style" crossorigin=""/><link rel="stylesheet" href="./next/static/css/fd62b12307a4ad68.css" crossorigin="" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" crossorigin="" nomodule="" src="./next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="./next/static/chunks/webpack-fd8027ecb5121007.js" defer="" crossorigin=""></script><script src="./next/static/chunks/framework-0c7baedefba6b077.js" defer="" crossorigin=""></script><script src="./next/static/chunks/main-c379b48138cf9870.js" defer="" crossorigin=""></script><script src="./next/static/chunks/pages/_app-b4a25f026cc43754.js" defer="" crossorigin=""></script><script src="./next/static/chunks/pages/_error-ee5b5fb91d29d86f.js" defer="" crossorigin=""></script><script src="./next/static/6tsKlqQPqupmBdOvykrZ5/_buildManifest.js" defer="" crossorigin=""></script><script src="./next/static/6tsKlqQPqupmBdOvykrZ5/_ssgManifest.js" defer="" crossorigin=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div><footer class="Footer_footer__o4_Ec"><a href="https://x.com/0xleeduckgo" target="_blank" rel="noopener noreferrer"><span>❤️follow my twitter❤️</span></a></footer></div><script id="__NEXT_DATA__" type="application/json" crossorigin="">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"6tsKlqQPqupmBdOvykrZ5","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
Binary file added extension/out/icons/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/out/icons/icon192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/out/icons/icon32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/out/icons/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions extension/out/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="./next/static/css/fd62b12307a4ad68.css" as="style" crossorigin=""/><link rel="stylesheet" href="./next/static/css/fd62b12307a4ad68.css" crossorigin="" data-n-g=""/><link rel="preload" href="./next/static/css/f16ff769dc4f33ff.css" as="style" crossorigin=""/><link rel="stylesheet" href="./next/static/css/f16ff769dc4f33ff.css" crossorigin="" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" crossorigin="" nomodule="" src="./next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="./next/static/chunks/webpack-fd8027ecb5121007.js" defer="" crossorigin=""></script><script src="./next/static/chunks/framework-0c7baedefba6b077.js" defer="" crossorigin=""></script><script src="./next/static/chunks/main-c379b48138cf9870.js" defer="" crossorigin=""></script><script src="./next/static/chunks/pages/_app-b4a25f026cc43754.js" defer="" crossorigin=""></script><script src="./next/static/chunks/pages/index-4eb31e7cd8209f2b.js" defer="" crossorigin=""></script><script src="./next/static/6tsKlqQPqupmBdOvykrZ5/_buildManifest.js" defer="" crossorigin=""></script><script src="./next/static/6tsKlqQPqupmBdOvykrZ5/_ssgManifest.js" defer="" crossorigin=""></script></head><body><div id="__next"><div class="Pages_container__nsidX"><main class="Pages_main__YBDSF"><h3 class="Pages_title__0zY_5">Bodhi Bodhi</h3><a href="https://projects.noncegeek.com/?tag=bodhi" target="_blank" rel="noreferrer"><button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Share this Asset</button></a><hr/><a href="https://projects.noncegeek.com/?tag=bodhi" target="_blank" rel="noreferrer"><button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Tag this Asset</button></a><hr/><a href="https://projects.noncegeek.com/?tag=bodhi" target="_blank" rel="noreferrer"><button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">See Awesome Bodhi Apps</button></a></main></div><footer class="Footer_footer__o4_Ec"><a href="https://x.com/0xleeduckgo" target="_blank" rel="noopener noreferrer"><span>❤️follow my twitter❤️</span></a></footer></div><script id="__NEXT_DATA__" type="application/json" crossorigin="">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"6tsKlqQPqupmBdOvykrZ5","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
1 change: 1 addition & 0 deletions extension/out/inject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Message from inject.js")
30 changes: 30 additions & 0 deletions extension/out/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"manifest_version": 3,
"name": "bodhi-bodhi",
"short_name": "B-B",
"version": "0.0.1",
"description": "chrome extension for Bodhi!",
"icons": {
"16": "/icons/icon16.png",
"32": "/icons/icon32.png",
"48": "/icons/icon48.png",
"192": "/icons/icon192.png"
},
"permissions": [],
"web_accessible_resources": [
{
"resources": ["index.html"],
"matches": ["<all_urls>"]
}
],
"content_scripts": [
{
"matches": ["https://*/*", "http://*/*"],
"js": ["inject.js"]
}
],
"host_permissions": ["<all_urls>"],
"action": {
"default_popup": "index.html"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
self.__SSG_MANIFEST=new Set,self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB();
33 changes: 33 additions & 0 deletions extension/out/next/static/chunks/framework-0c7baedefba6b077.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions extension/out/next/static/chunks/main-c379b48138cf9870.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Loading

0 comments on commit f4a1411

Please sign in to comment.