[mirotalk] - feat: replace typewriter with shuffle text effect for room name generation

This commit is contained in:
Miroslav Pejic
2026-04-13 09:25:01 +02:00
parent e6ca71febc
commit 4dc41bfbd7
9 changed files with 50 additions and 21 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# ====================================================
# MiroTalk P2P v.1.8.01 - Environment Configuration
# MiroTalk P2P v.1.8.02 - Environment Configuration
# ====================================================
# App environment
+1 -1
View File
@@ -2,7 +2,7 @@
/**
* ==============================================
* MiroTalk P2P v.1.8.01 - Configuration File
* MiroTalk P2P v.1.8.02 - Configuration File
* ==============================================
*
* This file is the central configuration source.
+1 -1
View File
@@ -45,7 +45,7 @@ dependencies: {
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.8.01
* @version 1.8.02
*
*/
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "mirotalk",
"version": "1.8.01",
"version": "1.8.02",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mirotalk",
"version": "1.8.01",
"version": "1.8.02",
"license": "AGPL-3.0",
"dependencies": {
"@mattermost/client": "11.5.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mirotalk",
"version": "1.8.01",
"version": "1.8.02",
"description": "A free WebRTC browser-based video call",
"main": "server.js",
"scripts": {
+6
View File
@@ -4388,3 +4388,9 @@ body {
grid-template-columns: repeat(4, 1fr);
}
}
/* Shuffle text effect */
.shuffle-active {
opacity: 0.5;
transition: opacity 0.3s ease;
}
+1 -1
View File
@@ -109,7 +109,7 @@ let brand = {
},
about: {
imageUrl: '../images/mirotalk-logo.gif',
title: 'WebRTC P2P v1.8.01',
title: 'WebRTC P2P v1.8.02',
html: `
<button
id="support-button"
+2 -2
View File
@@ -15,7 +15,7 @@
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.8.01
* @version 1.8.02
*
*/
@@ -14966,7 +14966,7 @@ function showAbout() {
Swal.fire({
background: swBg,
position: 'center',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.8.01',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.8.02',
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
customClass: { image: 'img-about' },
html: `
+35 -12
View File
@@ -144,27 +144,49 @@ function getRandomNumber(length) {
return result;
}
// Typing Effect
// Shuffle Text Effect
let i = 0;
let txt = num + adjective + noun;
let speed = 100;
/**
* Set room name with typewriter effect
* Shuffle text effect for input fields
* @param {HTMLInputElement} input
* @param {string} finalValue
* @param {number} duration
*/
function typeWriter() {
if (i < txt.length) {
roomName.value += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
function shuffleText(input, finalValue, duration = 600) {
const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
const steps = 10;
const interval = duration / steps;
let step = 0;
input.classList.add('shuffle-active');
const timer = setInterval(() => {
step++;
const progress = step / steps;
let display = '';
for (let i = 0; i < finalValue.length; i++) {
if (i < finalValue.length * progress) {
display += finalValue[i];
} else {
display += chars[Math.floor(Math.random() * chars.length)];
}
}
input.value = display;
if (step >= steps) {
clearInterval(timer);
input.value = finalValue;
setTimeout(() => input.classList.remove('shuffle-active'), 300);
}
}, interval);
}
const roomName = document.getElementById('roomName');
if (roomName) {
roomName.value = '';
typeWriter();
shuffleText(roomName, txt);
roomName.onkeyup = (e) => {
if (e.keyCode === 13) {
@@ -223,7 +245,8 @@ if (adultCnt) {
}
function genRoom() {
document.getElementById('roomName').value = getUUID4();
const input = document.getElementById('roomName');
shuffleText(input, getUUID4());
}
function getUUID4() {