-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: better builds and exported vue
- Loading branch information
Showing
7 changed files
with
127 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="https://unpkg.com/@gun-vue/components/dist/style.css"> | ||
<title>Chat example</title> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"app": "https://unpkg.com/@gun-vue/app" | ||
} | ||
} | ||
</script> | ||
<script type="module"> | ||
import {createGunVueApp} from 'app' | ||
createGunVueApp('#app') | ||
</script> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
<div id="app"> | ||
<h1>Chat example app!</h1> | ||
<gun-relay-list></gun-relay-list> | ||
<p> {{message}} </p> | ||
<user-icon></user-icon> | ||
<chat-room topic="Example chat"></chat-room> | ||
</div> | ||
|
||
</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 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="https://unpkg.com/@gun-vue/components/dist/style.css"> | ||
<title>Chat example</title> | ||
<script src="https://unpkg.com/@gun-vue/app@0.16.5/dist/app.iife.js"></script> | ||
<script> | ||
document.addEventListener('DOMContentLoaded', () => { | ||
GunVue.createGunVueApp('#app') | ||
}) | ||
</script> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
<div id="app"> | ||
<h1>Chat example app!</h1> | ||
<gun-relay-list></gun-relay-list> | ||
<p> {{message}} </p> | ||
<user-icon></user-icon> | ||
<chat-room topic="Example chat"></chat-room> | ||
</div> | ||
|
||
</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,50 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>@gun-vue/composables test</title> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"@gun-vue/composables":"https://unpkg.com/@gun-vue/composables" | ||
} | ||
} | ||
</script> | ||
<script type="module"> | ||
import {useUser, SEA, useRoom, useRelay} from "@gun-vue/composables" | ||
const {user, auth} = useUser() | ||
const {room} = useRoom() | ||
const {relay} = useRelay() | ||
|
||
setTimeout(async () => { | ||
await login() | ||
document.getElementById('pubKey').innerText = user.pub | ||
document.getElementById('roomName').innerText = room.profile?.name | ||
document.getElementById('roomKey').innerText = room.pub | ||
document.getElementById('relay').innerText = relay.peer | ||
}, 100) | ||
|
||
async function login() { | ||
if (user.is) return console.log('reused user') | ||
const pair = await SEA.pair() | ||
await auth(pair) | ||
console.log('New user created!') | ||
} | ||
|
||
</script> | ||
</head> | ||
|
||
<body> | ||
<h1>Hello!</h1> | ||
<h2>Your pub key is:</h2> | ||
<pre id="pubKey"></pre> | ||
<h2>You are in the room <span id="roomName"></span></h2> | ||
<pre id="roomKey"></pre> | ||
<h2>Connected to relay:</h2> | ||
<pre id="relay"></pre> | ||
</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