Skip to content

Commit

Permalink
full alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
davay42 committed Jan 23, 2023
1 parent b3691f4 commit b643f78
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 75 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 1.8.0

Typescript is introduced. The internal functions are more clean and readable. And new documentation web-site based on Vitepress is soon to be deployed.
Typescript is introduced. The internal functions are more clean and readable. And new documentation web-site based on Vitepress is ready for the first deploy.

## 1.6.0

Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd demo
cd dist

git init
git remote add origin git@github.com:davay42/gun-avatar.git
Expand Down
17 changes: 12 additions & 5 deletions tests/index.html → docs/public/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,19 @@ <h4 class="text-xl mb-4 font-bold flex items-center">
MIT 2020-present<br />by <a href="https://github.com/davay42">davay</a>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/gun/sea.js"></script>
<script type="module">
import "@unocss/reset/tailwind.css";
import "uno.css";
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@unocss/reset/tailwind.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/@unocss/runtime"></script>

import { mountElement, mountClass } from "./src/index";
<script type="module">
import {
mountElement,
mountClass,
} from "https://esm.sh/v104/gun-avatar@1.8.0/es2022/gun-avatar.js";
import GUN from "https://esm.sh/v104/gun@0.2020.1239/gun";
import SEA from "https://esm.sh/v104/gun@0.2020.1239/es2022/sea.js";
mountElement();
mountClass();

Expand Down
61 changes: 61 additions & 0 deletions docs/public/tests/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GUN avatar generator</title>
<script src="https://cdn.jsdelivr.net/npm/@unocss/runtime"></script>

<script type="module">
import { mountElement, mountClass } from "../main.js";
mountElement();
mountClass();
</script>

<style>
.gun-avatar {
border-radius: 100%;
}
</style>
</head>

<body>
<div>
<h3>User avatar</h3>
<gun-avatar
style="cursor: pointer"
id="avatar"
pub="YZOBPSkw75Ute2tFhdjDQgzR-GsGhlfSlZxgEZKuquI.2F-j9ItJY44U8vcRAsj-5lxnECG5TDyuPD8gEiuInp8"
size="300"
round
></gun-avatar>
</div>

<div>
<h3>Room avatar</h3>
<gun-avatar
style="cursor: pointer"
id="room"
pub="YZOBPSkw75Ute2tFhdjDQgzR-GsGhlfSlZxgEZKuquI.2F-j9ItJY44U8vcRAsj-5lxnECG5TDyuPD8gEiuInp8"
size="400"
draw="squares"
reflect="false"
></gun-avatar>
</div>
<div>
<h3>IMG tag with class and data-attributes</h3>
<img
class="gun-avatar"
data-size="200"
data-pub="YZOBPSkw75Ute2tFhdjDQgzR-GsGhlfSlZxgEZKuquI.2F-j9ItJY44U8vcRAsj-5lxnECG5TDyuPD8gEiuInp8"
/>
<img
class="gun-avatar"
data-size="200"
data-dark="true"
data-pub="YZOBPSkw75Ute2tFhdjDQgzR-GsGhlfSlZxgEZKuquI.2F-j9ItJY44U8vcRAsj-5lxnECG5TDyuPD8gEiuInp8"
/>
</div>
</body>
</html>
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@
"lib"
],
"scripts": {
"build": "tsc && vite build --config vite.config.lib.js",
"deploy": "sh deploy.sh",
"dev": "vite",
"page": "vite build",
"serve": "vite preview --port=5005",
"docs": "vitepress dev docs",
"build-docs": "vitepress build docs"
"dev": "vitepress dev docs",
"build": "vitepress build docs",
"build-lib": "vite build --config vite.config.lib.js && tsc ",
"serve": "vitepress preview docs --port=5005",
"test": "vite docs/public/tests",
"deploy": "sh deploy.sh"
},
"dependencies": {
"@unocss/reset": "0.48.4",
Expand Down
60 changes: 0 additions & 60 deletions tests/test.html

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// Types should go into this directory.
// Removing this would place the .d.ts files
// next to the .js files
"outDir": "public/types",
"outDir": "lib/types",
// go to js file when using IDE functions like
// "Go to Definition" in VSCode
"declarationMap": true
Expand Down

0 comments on commit b643f78

Please sign in to comment.