File size: 7,027 Bytes
d884d35 |
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 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JVCGPT - Faux Forum</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #121212;
color: #d3d3d3;
margin: 0;
padding: 0;
}
header {
background-color: #ff8000;
color: white;
padding: 10px;
text-align: center;
}
.container {
width: 90%;
max-width: 800px;
margin: 20px auto;
background-color: #1c1c1c;
border: 1px solid #333;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
.topic-header {
padding: 10px;
background-color: #2a2a2a;
border-bottom: 1px solid #444;
color: #ff8000;
font-weight: bold;
}
.post {
display: flex;
align-items: flex-start;
padding: 10px;
border-bottom: 1px solid #444;
}
.post:last-child {
border-bottom: none;
}
.avatar {
margin-right: 10px;
}
.avatar img {
width: 50px;
height: 50px;
border-radius: 5px;
}
.post-content-wrapper {
flex: 1;
}
.post-meta {
font-size: 0.9em;
color: #aaa;
margin-bottom: 5px;
}
.post-meta .username {
font-weight: bold;
}
.post-meta .username.author {
color: #ff8000;
text-shadow: 0 0 5px #ff8000;
}
.post-meta .date {
font-size: 0.8em;
color: #aaa;
}
.post-content {
font-size: 1em;
color: #d3d3d3;
word-wrap: break-word;
}
.post-content img {
width: 75px;
height: 50px;
display: block;
margin: 10px 0;
}
footer {
text-align: center;
margin: 20px 0;
color: #888;
}
textarea {
width: 100%;
height: 150px;
margin: 20px 0;
padding: 10px;
background-color: #1c1c1c;
border: 1px solid #333;
border-radius: 5px;
color: #d3d3d3;
box-sizing: border-box;
font-family: Arial, sans-serif;
font-size: 1em;
}
button {
display: block;
margin: 10px auto;
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1em;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<header>
<h1>JVCGPT</h1>
</header>
<div class="container">
<div class="topic-header">Sujet : <span id="topic-title">Titre du sujet</span></div>
<div id="posts-container">
<!-- Posts will be dynamically loaded here -->
</div>
</div>
<div class="container">
<textarea id="logInput" placeholder="Collez vos logs ici..."></textarea>
<button onclick="parseLogs()">Générer le topic</button>
</div>
<footer>
<p>JVCGPT - Faux Forum simulé par IA</p>
</footer>
<script>
function parseLogs() {
const logs = document.getElementById('logInput').value;
const postsContainer = document.getElementById('posts-container');
postsContainer.innerHTML = ''; // Clear previous posts
const blocks = logs.split('<|eot_id|>');
let topicTitle = '';
blocks.forEach(block => {
if (block.includes('<|start_header_id|>system<|end_header_id|>')) {
const titleMatch = block.match(/Sujet : "(.*?)"/);
if (titleMatch) {
topicTitle = titleMatch[1];
document.getElementById('topic-title').textContent = topicTitle;
}
} else {
const pseudoMatch = block.match(/<\|im_pseudo\|>(.*?)<\|end_pseudo\|>/);
const dateMatch = block.match(/<\|im_date\|>(.*?)<\|end_date\|>/);
const postMatch = block.match(/<\|begin_of_post\|>([\s\S]*?)<\|end_of_post\|>/);
if (pseudoMatch && dateMatch && postMatch) {
const username = pseudoMatch[1];
const date = dateMatch[1];
const message = postMatch[1];
const postDiv = document.createElement('div');
postDiv.className = 'post';
const avatarDiv = document.createElement('div');
avatarDiv.className = 'avatar';
const avatarImg = document.createElement('img');
avatarImg.src = 'https://image.jeuxvideo.com/avatar-md/default.jpg';
avatarDiv.appendChild(avatarImg);
const contentWrapper = document.createElement('div');
contentWrapper.className = 'post-content-wrapper';
const metaDiv = document.createElement('div');
metaDiv.className = 'post-meta';
const usernameDiv = document.createElement('div');
usernameDiv.textContent = username;
usernameDiv.className = 'username';
if (block.includes('<|start_header_id|>user<|end_header_id|>')) {
usernameDiv.classList.add('author');
}
metaDiv.appendChild(usernameDiv);
const dateDiv = document.createElement('div');
dateDiv.textContent = date;
dateDiv.className = 'date';
metaDiv.appendChild(dateDiv);
const contentDiv = document.createElement('div');
contentDiv.className = 'post-content';
const formattedMessage = message.replace(/https?:\/\/image\.noelshack\.com\/[^\s]+/g, (url) => {
return `<img src="${url}" alt="Image">`;
});
contentDiv.innerHTML = formattedMessage;
contentWrapper.appendChild(metaDiv);
contentWrapper.appendChild(contentDiv);
postDiv.appendChild(avatarDiv);
postDiv.appendChild(contentWrapper);
postsContainer.appendChild(postDiv);
}
}
});
}
</script>
</body>
</html>
|