Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)A
Posts
46
Comments
56
Joined
1 yr. ago

  • are you promoting vandalism?

  • the perception of time flying too fast

  • genocide joe

  • they don't have to, to be honest, your mod team itself is very bad, they hand out bans for just having an oppinion that is not far left, it's the either you are with us or against us attitude that i don't like

  • Locked

    lemm.ee is shutting down at the end of this month

    Jump
  • no joke, i got banned from lemmy.cafe for saying pineapple pizza bad, definitely avoid it

  • Locked

    lemm.ee is shutting down at the end of this month

    Jump
  • i got banned from lemmy.cafe for saying pineapple pizza bad, definitely avoid it

  • Locked

    lemm.ee is shutting down at the end of this month

    Jump
  • is there anyone for center leaning folks?

  • exactly that's why it will always lag behind

  • but how to find groups?

  • any proof that most muslims have bad belief?

  • yeah that's my middle name, i don't think i can change your mind but i will say this that majority of followers of islam have bad beliefs

  • some say fascism is a form of religion

  • dogmatism

  • not necessarily

  • thoughts mean when people think about to give opinion about something

  • what about established accounts?

  • is it wrong?

  • yes i meant separate instance also we just have to put this, dark souls wiki also uses it

    You don’t need to rewrite the whole page—just inject the pieces for Socket .io and your chat UI where indicated. Here’s exactly what to add or change in existing HTML (THIS PAGE):


    1. Include Socket.IO on the client

    Find the closing </head> tag and just before it insert:

     html
        
      <!-- Socket.IO client library (served automatically by your server) -->
      <script src="/socket.io/socket.io.js"></script>
      <!-- Optional: simple styles for the chat box -->
      <style>
        #chat-container {
          position: fixed;
          bottom: 0;
          right: 0;
          width: 300px;
          max-height: 400px;
          background: white;
          border: 1px solid #ccc;
          display: flex;
          flex-direction: column;
          font-family: sans-serif;
          z-index: 1000;
        }
        #chat-messages {
          flex: 1;
          overflow-y: auto;
          padding: 8px;
        }
        #chat-form {
          display: flex;
          border-top: 1px solid #eee;
        }
        #chat-input {
          flex: 1;
          border: none;
          padding: 8px;
        }
        #chat-send {
          border: none;
          padding: 8px 12px;
          cursor: pointer;
        }
      </style>
    </head>
    
      


    2. Add the chat HTML

    Find the closing </body> tag and just before it paste:

     html
        
      <!-- Chat widget -->
      <div id="chat-container">
        <div id="chat-messages"></div>
        <form id="chat-form">
          <input id="chat-input" autocomplete="off" placeholder="Type a message…" />
          <button type="submit" id="chat-send">Send</button>
        </form>
      </div>
    
      


    3. Wire up the client-side JavaScript

    Right below that (still before </body>), add:

     html
        
      <script>
        // connect using the global io() function
        const socket = io();
    
        const form = document.getElementById('chat-form');
        const input = document.getElementById('chat-input');
        const messages = document.getElementById('chat-messages');
    
        // render incoming messages
        socket.on('message', ({ from, text }) => {
          const div = document.createElement('div');
          div.textContent = from + ': ' + text;
          messages.appendChild(div);
          messages.scrollTop = messages.scrollHeight;
        });
    
        // on submit send to server
        form.addEventListener('submit', e => {
          e.preventDefault();
          const msg = input.value.trim();
          if (!msg) return;
          socket.emit('message', msg);
          input.value = '';
        });
      </script>
    </body>
    </html>
    
      


    4. Ensure your server is serving this page and Socket.IO

    On your Node/Express server (the same one you use to serve the Lemmy/lemm.ee front-end), you need to:

    1. Install Socket.IO:

       bash
          
      npm install socket.io
      
        
    2. Hook it up to your HTTP server (roughly as in the example I shared before), making sure you share sessions so only logged-in users connect.

      The minimal changes in your server.js (or equivalent) are:

       js
          
      const http = require('http');
      const socketIO = require('socket.io');
      // … your existing Express `app`
      
      const server = http.createServer(app);
      const io = socketIO(server);
      
      // (if you have session middleware already:)
      io.use((socket, next) => {
        // reuse your Express session middleware here…
        sessionMiddleware(socket.request, socket.request.res || {}, next);
      });
      
      io.on('connection', socket => {
        const user = socket.request.session.user; 
        if (!user) return socket.disconnect(true);
      
        socket.broadcast.emit('message', {
          from: 'SYSTEM',
          text: `${user.name} joined.`
        });
      
        socket.on('message', msg => {
          io.emit('message', { from: user.name, text: msg });
        });
      
        socket.on('disconnect', () => {
          io.emit('message', {
            from: 'SYSTEM',
            text: `${user.name} left.`
          });
        });
      });
      
      server.listen(3000);
      
        


    Summary of “what changed” in your HTML

    1. Head: added <script src="/socket.io/socket.io.js"> + minimal CSS
    2. Body: injected a <div id="chat-container">…</div> chat widget
    3. Footer: added a <script>…</script> block to wire up io()

    With those three small patches, your existing site will host a floating chat box that’s only usable by authenticated users. Let me know if you need help wiring up the session middleware or adjusting the styles!

  • Technology @lemmy.world

    The people who think AI might become conscious

    www.bbc.com /news/articles/c0k3700zljjo
  • Technology @lemmy.world

    GeForce GTX 970 8GB mod is back for a full review

    videocardz.com /newz/geforce-gtx-970-upgraded-to-8gb-vram-gets-tested-up-to-40-faster-than-stock-model
  • Technology @lemmy.world

    Prototype of RTX 5090 Appears With Four 16-Pin Power Connectors, Capable of Delivering 2,400W

    www.eteknix.com /prototype-of-rtx-5090-appears-with-four-16-pin-power-connectors-capable-of-delivering-2400w/
  • Technology @lemmy.world

    Half-Life 3 Has Been Designed to be ‘The Final Chapter’, It’s Claimed

    insider-gaming.com /half-life-3-has-been-designed-to-be-the-final-chapter-its-claimed/
  • Technology @lemmy.world

    Saudi Arabia unveils AI 'Fatwa Robot,' new pilgrim flow technology

    www.dailysabah.com /life/saudi-arabia-unveils-ai-fatwa-robot-new-pilgrim-flow-technology/news
  • Programming @programming.dev

    List of tutorials to learn videogame development

  • Ask Lemmy @lemmy.world

    what family type is better to have?

  • Ask Lemmy @lemmy.world

    Youtube comment gives advice how to run from cops is it accurate?

  • Today I Learned @lemmy.world

    TIL you can extract energy from space time itself & working on that same principle, make black hole bombs

  • Space @mander.xyz

    TIL you can extract energy from space time itself & working on that same principle, make black hole bombs

  • politics @lemmy.world

    Arab and Black communities are trying to reconcile after Trump's election

    www.npr.org /transcripts/1251284841
  • politics @lemmy.world

    "Indians Shouldn't Take Trump Literally": Ex-US Official On Ceasefire

    www.ndtv.com /india-news/ex-pentagon-official-michael-rubin-on-ceasefire-indians-shouldnt-take-trump-literally-8416223
  • Technology @lemmy.world

    India-made GPUs to be tech demo-ready by 2025, production by 2029

    archive.is /W7z7H
  • Technology @lemmy.world

    HMD, Lava to launch feature phones with direct-to-mobile technology, Developed in collaboration with Tejas Networks and powered by Saankhya's chipset, these phones can stream content without internet

    indianexpress.com /article/technology/mobile-tabs/hmd-lava-to-launch-feature-phones-with-direct-to-mobile-technology-9972546/
  • Technology @lemmy.world

    Most influential LLM papers and the ideas they introduced (post 2017)

    archive.is /Cw1I0
  • Technology @lemmy.world

    what are your thoughts on Bidirectional brain-computer interfaces ?

    pubmed.ncbi.nlm.nih.gov /32164851/
  • Technology @lemmy.world

    X blocks 8,000 accounts in India under government order

    m.economictimes.com /tech/technology/x-blocks-8000-accounts-in-india-under-government-order/articleshow/121005398.cms
  • News @lemmy.world

    'India avenges Daniel Pearl's murder': JeM commander Abdul Rauf Azhar killed in Indian airstrikes - 'India avenges Daniel Pearl's murder': JeM commander Abdul Rauf Azhar killed in Indian airstrikes

    www.businesstoday.in /india/story/india-avenges-daniel-pearls-murder-jem-commander-abdul-rauf-azhar-killed-in-indian-airstrikes-475317-2025-05-08
  • Technology @lemmy.world

    New Meta XR glasses again tipped to land later this year – well ahead of Apple's rumored AR glasses with Apple Intelligence

    www.techradar.com /computing/virtual-reality-augmented-reality/new-meta-xr-glasses-again-tipped-to-land-later-this-year-well-ahead-of-apples-rumored-ar-glasses-with-apple-intelligence
  • Technology @lemmy.world

    20th-Anniversary iPhone Will Reportedly Feature an All-Screen Design

    forums.macrumors.com /threads/20th-anniversary-iphone-will-reportedly-feature-an-all-screen-design.2456440/