Repository navigation
Expand file tree
/
Copy pathRC.html
More file actions
129 lines (111 loc) · 4.22 KB
/
Copy pathRC.html
File metadata and controls
129 lines (111 loc) · 4.22 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Matchly | Random Chat</title>
<style>
body{margin:0;background:#000;color:#fff;font-family:Helvetica Neue;height:100vh;overflow:hidden}
.top-bar{position:fixed;top:0;width:100%;padding:20px 40px;display:flex;justify-content:space-between;z-index:10}
.online-counter{background:rgba(0,255,136,.1);border:1px solid #00ff88;padding:8px 15px;border-radius:50px;font-size:.75rem;color:#00ff88}
.random-container{display:flex;width:100vw;height:100vh;padding-top:80px}
.person-sidebar{width:320px;padding:40px;border-right:1px solid rgba(255,255,255,.1);opacity:0;transition:.4s}
.person-sidebar.visible{opacity:1}
.chat-section{flex:1;display:flex;flex-direction:column}
.messages-container{flex:1;padding:40px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}
.bubble{max-width:60%;padding:14px 18px;border-radius:22px}
.you{align-self:flex-end;background:#fff;color:#000}
.stranger{align-self:flex-start;background:rgba(255,255,255,.1)}
.input-area{padding:25px;display:flex;gap:12px}
#userInput{flex:1;padding:16px 26px;border-radius:50px;background:rgba(255,255,255,.06);border:none;color:#fff}
.btn-stop{background:#ff4444;border:none;border-radius:50px;padding:0 22px;color:#fff;font-weight:bold}
.loading{position:absolute;inset:0;background:rgba(0,0,0,.85);display:flex;align-items:center;justify-content:center}
</style>
</head>
<body>
<div class="top-bar">
<div>MATCHLY RANDOM</div>
<div class="online-counter" id="onlineCount">5000 ONLINE</div>
</div>
<div class="random-container">
<div class="person-sidebar" id="sidebar">
<h2 id="pName">Searching...</h2>
<p id="pBio"></p>
</div>
<div class="chat-section">
<div class="loading" id="loader">Connecting...</div>
<div class="messages-container" id="msgContainer"></div>
<div class="input-area">
<button class="btn-stop" onclick="newChat()">NEW</button>
<input id="userInput" placeholder="Type...">
</div>
</div>
</div>
<script>
/* ===== VERIFY ENTRY ===== */
let stats = JSON.parse(localStorage.getItem("matchly_stats"));
if (!stats || !stats.adVerified) {
location.href = "ad-controller.html";
}
/* ===== INIT ===== */
stats.adVerified = false;
localStorage.setItem("matchly_stats", JSON.stringify(stats));
let isBot = false;
/* ===== MATCH ===== */
function newChat(){
document.getElementById("loader").style.display="flex";
document.getElementById("msgContainer").innerHTML="";
document.getElementById("sidebar").classList.remove("visible");
setTimeout(()=>{
stats.sessionChats++;
stats.totalChats++;
localStorage.setItem("matchly_stats", JSON.stringify(stats));
if (stats.totalChats < 20 && stats.sessionChats >= 5) {
return location.href="ad-controller.html";
}
if (stats.totalChats >= 20 && stats.sessionChats >= 2) {
return location.href="ad-controller.html";
}
isBot = Math.random() > 0.6;
document.getElementById("pName").innerText = isBot ? "Anonymous" : "Stranger";
document.getElementById("pBio").innerText = isBot ? "Here to talk." : "Real user connected";
document.getElementById("sidebar").classList.add("visible");
document.getElementById("loader").style.display="none";
},2000);
}
/* ===== CHAT ===== */
function addMsg(t,c){
const d=document.createElement("div");
d.className="bubble "+c;
d.innerText=t;
msgContainer.appendChild(d);
msgContainer.scrollTop=99999;
}
userInput.onkeypress=e=>{
if(e.key==="Enter"&&userInput.value){
addMsg(userInput.value,"you");
stats.messages++;
localStorage.setItem("matchly_stats",JSON.stringify(stats));
if(stats.messages%20===0){
location.href="ad-controller.html";
return;
}
if(isBot){
setTimeout(()=>addMsg(botReply(userInput.value),"stranger"),900);
}
userInput.value="";
}
};
/* ===== BOT ===== */
function botReply(t){
t=t.toLowerCase();
if(t.includes("hi"))return"Hey. What’s up?";
if(t.includes("sad"))return"I’m listening.";
if(t.includes("name"))return"Names don’t matter here.";
return"Tell me more.";
}
/* START */
newChat();
</script>
</body>
</html>