Skip to content

Commit c0b4ff9

Browse files
author
Timo Bechtel
committed
feat: initial commit
0 parents  commit c0b4ff9

File tree

14 files changed

+11434
-0
lines changed

14 files changed

+11434
-0
lines changed

.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
node: true,
6+
},
7+
parserOptions: {
8+
ecmaVersion: 2019,
9+
sourceType: 'module',
10+
},
11+
extends: ['eslint:recommended'],
12+
};

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v1
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Test
22+
run: npm test
23+
env:
24+
CI: true
25+
- name: Publish
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
run: npx semantic-release
30+
- name: GitHub Pages
31+
uses: peaceiris/actions-gh-pages@v3.5.6
32+
with:
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
publish_dir: ./example

.github/workflows/test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Test
2+
3+
on: pull_request
4+
5+
jobs:
6+
test:
7+
name: Test
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v1
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 12
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Test
19+
run: npm test
20+
env:
21+
CI: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
.vscode

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
access = 'public'

.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
tabWidth: 2,
3+
semi: true,
4+
singleQuote: true,
5+
trailingComma: 'es5',
6+
};

.releaserc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/changelog",
6+
"@semantic-release/npm",
7+
"@semantic-release/git",
8+
"@semantic-release/github"
9+
]
10+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Timo Bechtel
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

example/index.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="stylesheet" href="style.css" />
7+
<title>Test Page</title>
8+
</head>
9+
<body>
10+
<header>
11+
<a href="https://github.com/CompactJS/clipboard"
12+
>@compactjs/clipboard - Demo</a
13+
>
14+
</header>
15+
<main>
16+
<button id="copy-string">Copy String</button>
17+
<textarea id="input-text"></textarea>
18+
<button id="copy-input">Copy from Input</button>
19+
</main>
20+
<script type="module">
21+
import { clipboard } from './dist/index.module.js';
22+
23+
document
24+
.getElementById('copy-string')
25+
.addEventListener('click', () => clipboard('test' + Math.random()));
26+
27+
const inputText = document.getElementById('input-text');
28+
document
29+
.getElementById('copy-input')
30+
.addEventListener('click', () => clipboard(inputText));
31+
</script>
32+
</body>
33+
</html>

example/style.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
* {
2+
font-family: sans-serif;
3+
}
4+
header {
5+
text-align: center;
6+
margin: 30px 0 50px;
7+
}
8+
header a {
9+
color: black;
10+
text-decoration: none;
11+
font-weight: bold;
12+
font-size: 1.7em;
13+
}
14+
main {
15+
max-width: 400px;
16+
margin: 30px auto;
17+
}
18+
button,
19+
textarea {
20+
box-sizing: border-box;
21+
display: block;
22+
width: 100%;
23+
border-radius: 4px;
24+
}
25+
button {
26+
border: none;
27+
background: black;
28+
color: white;
29+
padding: 10px 10px;
30+
margin: 10px 0;
31+
cursor: pointer;
32+
}
33+
textarea {
34+
height: 70px;
35+
margin-top: 30px;
36+
}

0 commit comments

Comments
 (0)