Skip to content

Commit

Permalink
elaborando estrutura em angular
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioconselheiro committed Nov 10, 2023
1 parent 5dc5cbe commit 632540b
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 17 deletions.
1 change: 0 additions & 1 deletion .sass-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ rules:
- style: long
nesting-depth:
- 0
zero-unit: 1
attribute-quotes:
- 0
no-warn: 0
Expand Down
1 change: 1 addition & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"options": {
"outputPath": "docs",
"index": "src/index.html",
"baseHref": "/omegle-nostr/",
"main": "src/main.ts",
"polyfills": [
"zone.js"
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
<style>*,*:before,*:after{margin:0;padding:0;box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{font-family:sans-serif;font-weight:400;line-height:1.6;background-color:#fff7ee;height:100vh}</style><link rel="stylesheet" href="styles.a9e16dc67e970205.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.a9e16dc67e970205.css"></noscript></head>
<body>
<app-root></app-root>
<script src="runtime.0f20e5c7eea2b445.js" type="module"></script><script src="polyfills.694182d5e6dfd93d.js" type="module"></script><script src="main.5b50cd9580f95ff7.js" type="module"></script></body>
<script src="runtime.0f20e5c7eea2b445.js" type="module"></script><script src="polyfills.694182d5e6dfd93d.js" type="module"></script><script src="main.a0e87ef09211df97.js" type="module"></script></body>
</html>
1 change: 0 additions & 1 deletion docs/main.5b50cd9580f95ff7.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/main.a0e87ef09211df97.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
"scripts": {
"start": "npm run dev",
"dev": "ng serve --host=0.0.0.0",
"build": "ng build & sass-lint -c ./.sass-lint.yml -v -q",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"lint": "ng lint",
"lint": "ng lint & sass-lint -c ./.sass-lint.yml -v -q",
"docs": "sassdoc src --dest=sassdoc --verbose && npx compodoc -p tsconfig.json"
},
"husky": {
"hooks": {
"pre-push": "npm run lint && npm run build"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/antonioconselheiro/omegle-nostr.git"
Expand Down
53 changes: 53 additions & 0 deletions src/app/default-relays.const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
export const defaultRelays = [...new Set([
'wss://relay.damus.io',
'wss://nos.lol',
'wss://relay.snort.social',
'wss://nostr-pub.wellorder.net',
'wss://offchain.pub',
'wss://relay.shitforce.one',
'wss://yabu.me',
'wss://nostr.vulpem.com',
'wss://nostrich.friendship.tw',
'wss://n.xmr.se',
'wss://nostr-1.nbo.angani.co',
'wss://eden.nostr.land',
'wss://feeds.nostr.band',
'wss://nostr.wine',
'wss://e.nos.lol',
'wss://nostrue.com',
'wss://nostr.mom',
'wss://nostr.fmt.wiz.biz',
'wss://relay.nostrati.com',
'wss://relay.nostr.com.au',
'wss://eden.nostr.land',
'wss://nostr.fmt.wiz.biz',
'wss://relay.damus.io',
'wss://nostr-pub.wellorder.net',
'wss://offchain.pub',
'wss://nos.lol',
'wss://relay.snort.social',
'wss://soloco.nl',
'wss://eden.nostr.land',
'wss://nostr.fmt.wiz.biz',
'wss://relay.damus.io',
'wss://nostr-pub.wellorder.net',
'wss://offchain.pub',
'wss://nos.lol',
'wss://relay.snort.social',
'wss://soloco.nl',
'wss://relay.shitforce.one',
'wss://yabu.me',
'wss://nostr.vulpem.com',
'wss://nostrich.friendship.tw',
'wss://n.xmr.se',
'wss://nostr-1.nbo.angani.co',
'wss://eden.nostr.land',
'wss://feeds.nostr.band',
'wss://nostr.wine',
'wss://e.nos.lol',
'wss://nostrue.com',
'wss://nostr.mom',
'wss://nostr.fmt.wiz.biz',
'wss://relay.nostrati.com',
'wss://relay.nostr.com.au'
])];
4 changes: 4 additions & 0 deletions src/app/domain/message-author.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum MessageAuthor {
STRANGE = 'STRANGE',
YOU = 'YOU'
}
7 changes: 7 additions & 0 deletions src/app/domain/message.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { MessageAuthor } from './message-author.enum';

export interface IMessage {
time: number
message: string;
from: MessageAuthor;
}
5 changes: 5 additions & 0 deletions src/app/pages/chat/chat-state.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum ChatState {
CONNECTED = 'CONNECTED',
UP_TO_DISCONNECT = 'UP_TO_DISCONNECT',
DISCONNECTED = 'DISCONNECTED'
}
29 changes: 17 additions & 12 deletions src/app/pages/chat/chat.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,36 @@
<section class="navbar">
<img class="logo" src="/assets/logo.png" alt="logo" />
<h2 class="description">Talk to strangers!</h2>
<h2 class="online"></h2>
<h2 class="online">{{currentOnline}}</h2>
</section>

<main class="main">
<section class="conversation"></section>
<section #conversation class="conversation">

</section>

<form class="form">
<button type="button" class="btn start bottom-left-radius">
<form (submit)="sendMessage(message.value)" class="form" novalidate autocomplete="off">
<button *ngIf="state === STATE_DISCONNECTED" type="button" class="btn start bottom-left-radius">
Start
</button>
<button type="button" class="btn bottom-left-radius hide">
<button *ngIf="state === STATE_CONNECTED" type="button" class="btn bottom-left-radius">
Stop
</button>
<button
type="button"
class="btn bottom-left-radius bold hide"
>
<button *ngIf="state === STATE_UP_TO_DISCONNECT" type="button" class="btn bottom-left-radius bold">
Really?
</button>
<textarea name="text" id="text" class="textarea" disabled></textarea>
<textarea
name="text"
#message
class="textarea"
[attr.disabled]="state === STATE_DISCONNECTED ? true : null"
(keydown.enter)="sendMessage(message.value)"
></textarea>
<button
type="submit"
id="send"
#send
class="btn bottom-right-radius"
disabled
[attr.disabled]="state === STATE_DISCONNECTED ? true : null"
>
Send
</button>
Expand Down
15 changes: 15 additions & 0 deletions src/app/pages/chat/chat.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Component } from '@angular/core';
import { ChatState } from './chat-state.enum';
import { IMessage } from 'src/app/domain/message.interface';

@Component({
selector: 'omg-chat',
Expand All @@ -7,4 +9,17 @@ import { Component } from '@angular/core';
})
export class ChatComponent {

readonly STATE_CONNECTED = ChatState.CONNECTED;
readonly STATE_UP_TO_DISCONNECT = ChatState.UP_TO_DISCONNECT;
readonly STATE_DISCONNECTED = ChatState.DISCONNECTED;

state = ChatState.DISCONNECTED;

currentOnline = 0;

messages: IMessage[] = [];

sendMessage(message: string): void {

}
}

0 comments on commit 632540b

Please sign in to comment.