-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
198 lines (136 loc) · 7.29 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous" defer></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<!-- font awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- librerie -->
<script src="https://cdn.jsdelivr.net/npm/luxon@3.3.0/build/global/luxon.min.js"></script>
<!-- link assets -->
<link rel="stylesheet" href="style.css">
<script src="https://unpkg.com/vue@3/dist/vue.global.js" defer></script>
<script src="script.js" defer></script>
<!-- title -->
<style>[v-cloak] {display: none;}</style>
<link rel="icon" href="img/logo.png" >
<title>Boolzap</title>
</head>
<body>
<!-- APPLICAZIONE -->
<div id="app">
<div :class="colorMode ? `light_mode` : `dark_mode`" class="my_container">
<div class="bck-1"></div>
<div class="bck-2"></div>
<div class="web-app">
<!-- ZONA DELLE CHATS -->
<div class="chats" v-cloak>
<!-- zona account/settings -->
<div class="account">
<div class="proPic">
<!-- aggiornare immagine profilo *********** -->
<img src="img/pek.jpeg" alt="myProfilePicture">
<span class="text•">Pek</span>
</div>
<div class="icons">
<i class="fa-solid fa-circle-half-stroke" @click="changeColorMode"></i>
</div>
</div>
<!-- zona "ricevi notifiche" -->
<div class="popup-notifiche">
<div class="icon"> <i class="fa-solid fa-bell-slash"></i> </div>
<div class="popup-text">
<h6>Ricevi notifiche di nuovi messaggi</h6>
<p>Attiva notifiche desktop</p>
</div>
</div>
<!-- zona search chat -->
<div class="input-group search">
<span class="input-group-text" id="basic-addon1"> <i class="fa-solid fa-magnifying-glass"></i> </span>
<input v-model="userSearch" type="text" class="my_form" placeholder="Cerca una chat" aria-label="Username" aria-describedby="basic-addon1">
</div>
<!-- elenco delle chat -->
<div class="elenco-chat">
<div @click="openChat(contact)" v-for="(contact, index) in filteredContacts" :key="contact.name" class="chat-singola" :class="{ selected: index == activeIndex }">
<div class="info-contact">
<img :src="contact.avatar">
<div class="px-0">
<h5> {{ contact.name }} </h5>
<p v-if="contact.messages[contact.messages.length - 1].message.length < 40">
{{ contact.messages ? contact.messages[contact.messages.length - 1].message : `** messaggi eliminati **`}}
</p>
<p v-else> {{ contact.messages[contact.messages.length - 1].message.slice(0, 40) + `...` }} </p>
</div>
</div>
<div class="orario"> {{ contact.messages ? contact.messages[contact.messages.length - 1].date.slice(11, 16) : `` }} </div>
</div>
</div>
</div>
<!-- CHAT SELEZIONATA -->
<div class="chat" v-cloak>
<!-- sezione chat selezionata -->
<div class="title-chat">
<div class="profile">
<img v-if="contacts[activeIndex].name == ``" :src="contacts[0].avatar">
<img v-else :src="contacts[activeIndex].avatar">
<div>
<h5 v-if="contacts[activeIndex].avatar == ``"> {{contacts[0].name}} </h5>
<h5 v-else> {{ contacts[activeIndex].name }} </h5>
<p>ultimo accesso oggi alle {{ contacts[activeIndex].messages.length ? contacts[activeIndex].messages[this.contacts[activeIndex].messages.length - 1].date.slice(11, 16) : `00:00` }}</p>
</div>
</div>
<div class="icons dropstart">
<!-- search messages in chat -->
<button type="button" data-bs-toggle="dropdown" class="btn_dropdown">
<i class="fa-solid fa-magnifying-glass"></i>
</button>
<div class="mySearch dropdown-menu dropdown-menu-end">
<input v-model="messageSearch" type="text" placeholder="cerca un messaggio">
</div>
</div>
</div>
<div class="conversazione" :class="[`conversazione`, backgroundImageClass]" ref="fixScroll">
<div v-for="(mex, i) in filteredMessages" :key="i" class="mex" :class="{ ricevuto: mex.status == `received`, inviato: mex.status == `sent` }">
<p class="testo"> {{ mex.message }} </p>
<p class="mex-orario"> {{ mex.date.slice(11, 16) }} </p>
<div @click="deleteMessage(i)" :class="{ delete_received: mex.status == `received`, delete_sent: mex.status == `sent` }">
<i class="fa-solid fa-xmark"></i>
</div>
<div :class="{ triangle_ricevuto: mex.status == `received`, triangle_inviato: mex.status == `sent` }"></div>
</div>
</div>
<div class="messaggio">
<!-- emoji -->
<div class="messaggio-icon">
<button type="button" data-bs-toggle="dropdown" class="btn_dropdown">
<i class="fa-regular fa-face-smile dropdown"></i>
</button>
<div class="emoji dropdown-menu dropdown-menu-top">
<template v-for="(emoticon, index) in emoticons">
<span @click="addEmoticon(index)">{{ emoticon }}</span>
</template>
</div>
</div>
<!-- input per newMessages -->
<input
v-model="newInputSent.message"
@keyup.enter="newMessages()"
type="text"
placeholder="Scrivi un messaggio"
ref="writeHere"
>
<!-- click per aggiungere un nuovo messaggio alla chat -->
<div class="messaggio-icon">
<i class="bi bi-send" @click="newMessages()"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>