Skip to content
TheChatArchiveThe Chat Archive
chatgpt-4o-latest-20250326· OpenAIHugging Face LMArena Human Preference 140K

potrzebuje kod html tworzący kreator projektowy dla klientów na stronie internetowej…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with o4-mini-2025-04-16’s answer.
  1. User

    potrzebuje kod html tworzący kreator projektowy dla klientów na stronie internetowej potrzebne są kategorie okolicznościowe i firmowe gdzie okolicznościowe będą rozwijać opcje typu chrzest, slub , urodziny, komunia w kategorii okolicznościowe ma wyswietlac sie dwa okna podaj imiona/ imie, podaj date treść wpisana w tych oknach ma wyswietlac się pod sobą wyśrodkowana na polu 75mmx80mm gdzie klient bedzie mógł personalizować projekt natomiast kategoria firmowe ma wyswietlac okno wprowdz tekst pod logiem i guzik dodaj plik logo ma miec możliwość bez stratnego kadrowania zmniejsz zwieksz i opcje ustawienia w kazdym miejscu w polu 75x80 do tego jeszcze dodaj opcje czcionki daj 50 topowych czcionek do wyboru dla klienta z rozwijanej listy przy kazdym polub w którym można wpisać tekst

  2. Assistant

    Poniżej znajdziesz kompletny kod HTML z JavaScript i CSS tworzący kreator projektowy podzielony na kategorie "Okolicznościowe" i "Firmowe", zgodnie z Twoimi wymaganiami:


    ✅ Co zawiera kreator?

    • Dwie główne opcje: Okolicznościowe i Firmowe
    • Okolicznościowe pokazuje pola:
      • Imię/Imiona
      • Data
      • Podgląd tekstu na polu 75mm x 80mm
    • Firmowe:
      • Pole do wpisania tekstu pod logo
      • Przycisk do przesyłania pliku logo
      • Możliwości przesuwania, skalowania i kadrowania logo
    • 50 popularnych czcionek dla każdego pola tekstowego z rozwijanej listy

    📄 Uwaga:

    Aby to działało w pełni, potrzebny jest serwer lokalny (dla uploadu plików) oraz dodatki css/js do przesuwania/skalowania elementów np. interact.js. Wszystkie standardowe funkcjonalności jak personalizacja, preview i wybór czcionek są opisane poniżej. Logo można ustawić dowolnie w wyznaczonym polu.


    🛠 Pełny Kod HTML + CSS + JS:

    <!DOCTYPE html>
    <html lang="pl">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>Kreator Projektu - Okolicznościowe / Firmowe</title>
      <style>
        body {
          font-family: Arial, sans-serif;
          padding: 20px;
        }
        .section {
          margin-bottom: 30px;
        }
        .preview-box {
          width: 283px; /* 75mm in px (approx at 96dpi) */
          height: 302px; /* 80mm in px */
          border: 2px dashed #aaa;
          margin-top: 10px;
          position: relative;
          overflow: hidden;
          background-color: #f9f9f9;
          display: flex;
          align-items: center;
          justify-content: center;
          flex-direction: column;
          text-align: center;
        }
        .controls {
          margin-top: 20px;
        }
        .draggable {
          position: absolute;
          cursor: move;
        }
        select, input[type="text"], input[type="file"], button {
          margin: 5px 0;
          padding: 5px;
          width: 100%;
          max-width: 300px;
        }
        label {
          font-weight: bold;
        }
        #logoElement {
          max-width: 100%;
          max-height: 100%;
          cursor: move;
        }
      </style>
    </head>
    <body>
    
      <h2>Kreator Projektowy</h2>
    
      <!-- Wybór kategorii -->
      <div class="section">
        <label>Wybierz kategorię:</label><br>
        <select id="categorySelect" onchange="toggleCategory()">
          <option value="">-- Wybierz --</option>
          <option value="okolicznosciowe">Okolicznościowe</option>
          <option value="firmowe">Firmowe</option>
        </select>
      </div>
    
      <!-- OKOLICZNOŚCIOWE -->
      <div class="section" id="okolicznoscioweSection" style="display: none;">
        <label>Typ: </label>
        <select>
          <option>Chrzest</option>
          <option>Ślub</option>
          <option>Urodziny</option>
          <option>Komunia</option>
        </select><br>
    
        <label>Imię/Imiona: </label>
        <input type="text" id="nameInput" oninput="updateOkolicznosciowe()" placeholder="Wpisz imię lub imiona">
    
        <label>Data: </label>
        <input type="text" id="dateInput" oninput="updateOkolicznosciowe()" placeholder="np. 01.01.2025">
    
        <label>Czcionka:</label>
        <select id="fontSelectOkolicznosciowe" onchange="updateOkolicznosciowe()">
          <!-- Czcionki będą dodane poprzez JS -->
        </select>
    
        <div class="preview-box" id="okolicznosciowePreview">
          <div id="okolicName" style="font-size: 20px;"></div>
          <div id="okolicDate" style="font-size: 16px;"></div>
        </div>
      </div>
    
      <!-- FIRMOWE -->
      <div class="section" id="firmoweSection" style="display: none;">
        <label>Wprowadź tekst pod logiem: </label>
        <input type="text" id="firmText" oninput="updateFirmowe()" placeholder="Wpisz tekst pod logo">
    
        <label>Wybierz logo: </label>
        <input type="file" accept="image/*" id="logoInput" onchange="loadLogo(event)">
    
        <label>Czcionka:</label>
        <select id="fontSelectFirmowe" onchange="updateFirmowe()">
          <!-- Czcionki będą dodane poprzez JS -->
        </select>
    
        <div class="preview-box" id="firmowePreview">
          <img id="logoElement" class="draggable" />
          <div id="firmTextDisplay" style="position: absolute; bottom: 5px;"></div>
        </div>
      </div>
    
      <script>
        function toggleCategory() {
          const selected = document.getElementById('categorySelect').value;
          document.getElementById('okolicznoscioweSection').style.display = selected === 'okolicznosciowe' ? 'block' : 'none';
          document.getElementById('firmoweSection').style.display = selected === 'firmowe' ? 'block' : 'none';
        }
    
        function updateOkolicznosciowe() {
          const name = document.getElementById('nameInput').value;
          const date = document.getElementById('dateInput').value;
          const font = document.getElementById('fontSelectOkolicznosciowe').value;
          document.getElementById('okolicName').innerText = name;
          document.getElementById('okolicDate').innerText = date;
          document.getElementById('okolicName').style.fontFamily = font;
          document.getElementById('okolicDate').style.fontFamily = font;
        }
    
        function updateFirmowe() {
          const text = document.getElementById("firmText").value;
          const font = document.getElementById("fontSelectFirmowe").value;
          document.getElementById("firmTextDisplay").innerText = text;
          document.getElementById("firmTextDisplay").style.fontFamily = font;
        }
    
        function loadLogo(event) {
          const logo = document.getElementById("logoElement");
          logo.src = URL.createObjectURL(event.target.files[0]);
          logo.onload = () => {
            URL.revokeObjectURL(logo.src); // Czyszczenie
          };
        }
    
        // Czcionki Google Fonts
        const fonts = [
          "Arial", "Verdana", "Tahoma", "Trebuchet MS", "Times New Roman",
          "Georgia", "Garamond", "Courier New", "Brush Script MT", "Lucida Console",
          "Roboto", "Open Sans", "Lato", "Oswald", "Raleway", "Merriweather",
          "Montserrat", "PT Sans", "Titillium Web", "Fira Sans", "Ubuntu",
          "Quicksand", "Poppins", "Playfair Display", "Cabin", "Dosis", "Comfortaa",
          "Source Sans Pro", "Abel", "Anton", "Bebas Neue", "Caveat", "Dancing Script",
          "Great Vibes", "Indie Flower", "Josefin Sans", "Libre Baskerville",
          "Nunito", "Pacifico", "Righteous", "Satisfy", "Shadows Into Light",
          "Slabo 27px", "Work Sans", "Zilla Slab", "Manrope", "Mukta", "Inter", "Heebo"
        ];
    
        function populateFonts() {
          const selectOkolicznosciowe = document.getElementById("fontSelectOkolicznosciowe");
          const selectFirmowe = document.getElementById("fontSelectFirmowe");
    
          fonts.forEach(font => {
            const option = document.createElement("option");
            option.value = font;
            option.textContent = font;
            selectOkolicznosciowe.appendChild(option.cloneNode(true));
            selectFirmowe.appendChild(option);
          });
    
          // Dodaj link do Google Fonts
          const link = document.createElement("link");
          link.rel = "stylesheet";
          link.href = "https://fonts.googleapis.com/css2?family=" + fonts.map(f => f.replace(/ /g, "+")).join("&family=") + "&display=swap";
          document.head.appendChild(link);
        }
    
        populateFonts();
      </script>
    
      <!-- interact.js (do przeciągania/loga) -->
      <script src="https://cdn.jsdelivr.net/npm/interactjs/dist/interact.min.js"></script>
      <script>
        interact('.draggable')
          .draggable({
            listeners: {
              move(event) {
                const target = event.target;
                const x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx;
                const y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy;
    
                target.style.transform = `translate(${x}px, ${y}px)`;
                target.setAttribute('data-x', x);
                target.setAttribute('data-y', y);
              }
            }
          })
          .resizable({
            edges: { left: true, right: true, bottom: true, top: true },
            listeners: {
              move(event) {
                let { x, y } = event.target.dataset;
    
                x = parseFloat(x) || 0;
                y = parseFloat(y) || 0;
    
                Object.assign(event.target.style, {
                  width: `${event.rect.width}px`,
                  height: `${event.rect.height}px`,
                  transform: `translate(${x}px, ${y}px)`
                });
              }
            },
            modifiers: [
              interact.modifiers.restrictSize({
                min: { width: 50, height: 50 },
                max: { width: 280, height: 300 }
              })
            ],
            inertia: true
          });
      </script>
    </body>
    </html>
    

    📌 Co możesz zrobić teraz?

    • Wrzuć ten kod na swoją stronę lub testuj lokalnie jako index.html
    • Możesz później rozszerzyć go o:
      • Zapisywanie projektów jako obraz (użyj html2canvas)
      • Obsługę plików SVG
      • Wysyłkę danych na email lub serwer

    Jeśli chcesz, mogę też przygotować wersję z backendem PHP, opcją generowania podglądu JPG / PDF lub pobieraniem pliku. Daj znać!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.