This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
1,018 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
.vscode/ |
Large diffs are not rendered by default.
Oops, something went wrong.
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.
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,61 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<title>IPFS simple messaging</title> | ||
<meta name="description" content="Simple chat app on ipfs"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<link rel="stylesheet" href="./main.css"> | ||
|
||
<body> | ||
<header> | ||
<h1>IPFS Simple Messaging</h1> | ||
</header> | ||
<main> | ||
<div class="columns box"> | ||
<div class="row"> | ||
<div class="box"> | ||
<label>Room (double click to change):</label> | ||
<span id="room"></span> | ||
<input type="text" id="room-id" style="display: none"> | ||
</div> | ||
<div class="box msgs-box"> | ||
<ul id="msgs"></ul> | ||
</div> | ||
<div> | ||
<label>message:</label> | ||
<input type="text" id="message"></input> | ||
<button id="send">Send</button> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="box peers-box"> | ||
<label>Peers Joined Room:</label> | ||
<ul id="peers"></ul> | ||
</div> | ||
<div class="box peers-box"> | ||
<label>Peers Connected:</label> | ||
<ul id="peers-addrs"></ul> | ||
</div> | ||
<div> | ||
<label>Connect to Peer:</label> | ||
<input type="text" id="peer"></input> | ||
<button id="connect">Connect</button> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="box row"> | ||
<label>Peer id:</label> | ||
<ul id="peer-id"></ul> | ||
</div> | ||
<div class="box addrs-box"> | ||
<label>Addresses:</label> | ||
<ul id="addrs"></ul> | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
<script src="src/app.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,253 @@ | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
font-family: sans-serif; | ||
color: white; | ||
background: linear-gradient(to bottom, #041727 0%, #062b3f 100%); | ||
pointer-events: auto; | ||
} | ||
|
||
h1, | ||
h2, | ||
h3 { | ||
margin: 0; | ||
} | ||
|
||
h1 { | ||
font-size: 2em; | ||
font-weight: 300; | ||
} | ||
|
||
h2 { | ||
font-size: 1.25em; | ||
font-weight: 700; | ||
} | ||
|
||
h3 { | ||
font-size: 1.0em; | ||
font-weight: 700; | ||
} | ||
|
||
main, | ||
header { | ||
filter: none; | ||
} | ||
|
||
.dragover-popup { | ||
position: fixed; | ||
top: 0.5em; | ||
left: 0.5em; | ||
width: calc(100% - 1em); | ||
height: calc(100% - 1em); | ||
background-color: rgba(0, 0, 0, 0.5); | ||
display: none; | ||
pointer-events: none; | ||
} | ||
|
||
.dragover-popup h1 { | ||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%) | ||
} | ||
|
||
body.dragging main, | ||
body.dragging header { | ||
filter: blur(5px); | ||
} | ||
|
||
body.dragging .dragover-popup { | ||
display: block; | ||
} | ||
|
||
header { | ||
text-align: center; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 3em 0; | ||
} | ||
|
||
ul { | ||
margin: 0; | ||
padding: 0; | ||
list-style: none; | ||
} | ||
|
||
ul li { | ||
margin: 1em 0; | ||
font-size: 1em; | ||
font-family: monospace; | ||
word-wrap: break-word; | ||
} | ||
|
||
button { | ||
background-color: rgba(0, 0, 0, 0.2); | ||
color: #6acad1; | ||
border: 2px solid #6acad1; | ||
font-size: 1em; | ||
padding: 0.625em 1.5em; | ||
border-radius: 0.125em; | ||
margin: .5em 0; | ||
} | ||
|
||
button.full { | ||
margin-right: 0; | ||
margin-left: 0; | ||
width: 100%; | ||
} | ||
|
||
button:hover { | ||
color: white; | ||
border: 2px solid white; | ||
cursor: pointer; | ||
} | ||
|
||
.address { | ||
font-family: monospace | ||
} | ||
|
||
.disabled *, | ||
input:disabled, | ||
button:disabled { | ||
opacity: 0.2; | ||
} | ||
|
||
input { | ||
width: 100%; | ||
border: 2px solid rgba(0, 0, 0, 0.2); | ||
color: black; | ||
padding: 0.7em; | ||
border-radius: 2px; | ||
} | ||
|
||
input:hover, | ||
input:focus, | ||
input:active { | ||
border-color: #6acad1; | ||
} | ||
|
||
input, | ||
button { | ||
outline: none; | ||
} | ||
|
||
main { | ||
width: 90%; | ||
margin: 0 auto; | ||
} | ||
|
||
.buttons, | ||
.columns { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
height: 100%; | ||
} | ||
|
||
.msgs-box { | ||
flex: 1 1 0px; | ||
overflow-y: scroll; | ||
min-height: 250px; | ||
} | ||
|
||
.peers-box { | ||
flex: 1 1 0px; | ||
overflow-y: scroll; | ||
min-height: 182px; | ||
} | ||
|
||
.addrs-box { | ||
flex: 1; | ||
overflow-y: scroll; | ||
max-height: 273px; | ||
} | ||
|
||
.row { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.buttons>button, | ||
.columns>div { | ||
width: calc(33% - 0.5em); | ||
} | ||
|
||
.buttons>button { | ||
margin: 0 0 1em; | ||
} | ||
|
||
.box { | ||
background-color: rgba(255, 255, 255, 0.05); | ||
padding: 1em; | ||
margin-bottom: 1em; | ||
} | ||
|
||
.box>h2 { | ||
display: block; | ||
border-bottom: 2px solid rgba(255, 255, 255, 0.1); | ||
border-right: 0; | ||
border-left: 0; | ||
text-align: center; | ||
padding-bottom: 0.5em; | ||
margin-bottom: 1em; | ||
} | ||
|
||
.errors { | ||
grid-area: errors; | ||
color: red; | ||
font-style: italic; | ||
font-size: 1.125em; | ||
display: block; | ||
margin: 0 0 1em; | ||
} | ||
|
||
.errors.hidden { | ||
display: none; | ||
} | ||
|
||
table { | ||
width: 100%; | ||
margin: 1em 0; | ||
word-break: break-all; | ||
border-collapse: collapse; | ||
} | ||
|
||
table thead { | ||
background-color: rgba(255, 255, 255, 0.1); | ||
font-weight: normal | ||
} | ||
|
||
table th, | ||
table td { | ||
padding: 0.5em 0; | ||
} | ||
|
||
table td:last-child, | ||
table th:last-child { | ||
width: 20%; | ||
text-align: center; | ||
} | ||
|
||
table td:first-child { | ||
width: 45%; | ||
} | ||
|
||
table td:nth-child(2) { | ||
width: 35%; | ||
font-family: monospace; | ||
} | ||
|
||
table tr:hover { | ||
background-color: rgba(0, 0, 0, 0.2) | ||
} | ||
|
||
table a { | ||
color: inherit; | ||
} |
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,27 @@ | ||
{ | ||
"name": "ipfs-quick-msg", | ||
"version": "0.0.1", | ||
"description": "IPFS quick msg", | ||
"main": "index.js", | ||
"scripts": { | ||
"clean": "rm -rf dist/*", | ||
"build": "parcel build index.html --public-url '.'", | ||
"start": "parcel index.html", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"deploy": "ipfs add -r --quieter dist", | ||
"lint": "aegir lint" | ||
}, | ||
"author": "Dmitriy Ryajov <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"ipfs": "file:../../", | ||
"ipfs-pubsub-room": "~0.3.0" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^13.0.5", | ||
"http-server": "^0.10.0", | ||
"ipfs-css": "^0.2.0", | ||
"parcel-bundler": "^1.6.2", | ||
"tachyons": "^4.9.1" | ||
} | ||
} |
Oops, something went wrong.