Saturday, 15 July 2023

article writing tool

this code, we include the TinyMCE library using the provided CDN link. The library enables the rich text editing functionality in the textarea element with the ID articleEditor.

The article writing tool includes an input field for the title, a textarea for the article content, and a preview section to see the formatted output. The title and content are dynamically updated in the preview section as the user types.

The styling is done using CSS, with a responsive layout using the Bootstrap framework. You can customize the colors, padding, and other styling properties to match your desired design.

Please note that since the TinyMCE library is loaded from a CDN, an internet connection is required for the editor to function correctly.


<!DOCTYPE html>
<html>
<head>
  <title>Article Writing Tool</title>
  <script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <style>
    body {
      background-color: #f8f9fa;
      padding: 20px;
    }
    .container {
      max-width: 800px;
      margin: 0 auto;
      background-color: #fff;
      border-radius: 5px;
      padding: 20px;
    }
    h1 {
      color: #007bff;
      margin-bottom: 20px;
    }
    .form-group {
      margin-bottom: 20px;
    }
    label {
      font-weight: bold;
    }
    #articleEditor {
      height: 400px;
    }
    .preview-section {
      border: 1px solid #ced4da;
      padding: 10px;
      border-radius: 5px;
      background-color: #fff;
    }
    .preview-section h3 {
      margin-top: 0;
      color: #007bff;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>Article Writing Tool</h1>
    <div class="form-group">
      <label for="articleTitle">Title:</label>
      <input type="text" id="articleTitle" class="form-control" placeholder="Enter the title">
    </div>
    <div class="form-group">
      <label for="articleEditor">Article Content:</label>
      <textarea id="articleEditor"></textarea>
    </div>
    <div class="preview-section">
      <h3>Preview:</h3>
      <div id="articlePreview"></div>
    </div>
  </div>

  <script>
    tinymce.init({
      selector: '#articleEditor',
      height: 400,
      plugins: 'link image code',
      toolbar: 'undo redo | bold italic underline | alignleft aligncenter alignright | code',
      menubar: false
    });

    const articleTitleInput = document.getElementById('articleTitle');
    const articleEditor = tinymce.get('articleEditor');
    const articlePreview = document.getElementById('articlePreview');

    function updatePreview() {
      const title = articleTitleInput.value;
      const content = articleEditor.getContent();

      articlePreview.innerHTML = `<h3>${title}</h3>${content}`;
    }

    articleTitleInput.addEventListener('input', updatePreview);
    articleEditor.on('keyup', updatePreview);
  </script>
</body>
</html>




words and characters counter

In the above code, we have a container with a heading, a textarea for user input, and a section to display the word and character counts. The JavaScript code listens to the input event on the textarea and updates the counts dynamically.

The styling is done using CSS, with a responsive layout using the Bootstrap framework. The background color, text color, and padding can be customized to your preference.


<!DOCTYPE html>
<html>
<head>
  <title>Words and Characters Counting Tool</title>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <style>
    body {
      background-color: #f8f9fa;
      padding: 20px;
    }
    .container {
      max-width: 600px;
      margin: 0 auto;
      background-color: #fff;
      border-radius: 5px;
      padding: 20px;
    }
    h1 {
      color: #007bff;
    }
    textarea {
      width: 100%;
      height: 150px;
      padding: 10px;
      border: 1px solid #ced4da;
      border-radius: 5px;
      resize: none;
    }
    .count-info {
      margin-top: 20px;
      font-size: 18px;
    }
    .count-info span {
      font-weight: bold;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>Words and Characters Counting Tool</h1>
    <div class="form-group">
      <label for="textArea">Enter your text:</label>
      <textarea id="textArea" placeholder="Type your text here..."></textarea>
    </div>
    <div class="count-info">
      <span id="wordCount">0</span> words, <span id="charCount">0</span> characters
    </div>
  </div>

  <script>
    const textArea = document.getElementById('textArea');
    const wordCountElement = document.getElementById('wordCount');
    const charCountElement = document.getElementById('charCount');

    textArea.addEventListener('input', () => {
      const text = textArea.value.trim();
      const words = text.split(/\s+/).filter(word => word.length > 0);
      const charCount = text.length;

      wordCountElement.textContent = words.length;
      charCountElement.textContent = charCount;
    });
  </script>
</body>
</html>


Drawing and sketching pad

this code, we create an HTML canvas element with an id of "canvas" to hold the drawing area. Below the canvas, we have a set of buttons for changing colors, clearing the canvas, and using an eraser.

We include the Fabric.js library using a script tag sourced from a CDN. Fabric.js simplifies working with the canvas element by providing a higher-level API for drawing and manipulating objects on the canvas.

In the JavaScript section, we initialize a new Fabric.js canvas object using the canvas element's id. We set the default drawing properties, such as enabling the drawing mode and specifying the brush's width and color.

The changeColor() function is used to change the drawing color based on the button clicked. If the "Eraser" button is clicked, the brush color is set to white to act as an eraser.

The clearCanvas() function clears the canvas by calling the clear() method on the Fabric.js canvas object.

This code provides a basic drawing and sketching tool with color selection, eraser functionality, and canvas clearing. You can further enhance it by adding additional features like different brush sizes, saving and loading drawings, and more.


<!DOCTYPE html>
<html>
<head>
  <title>Drawing and Sketching Tool</title>
  <style>
    #canvas {
      border: 1px solid #ccc;
    }
  </style>
</head>
<body>
  <canvas id="canvas" width="800" height="600"></canvas>

  <div>
    <button onclick="changeColor('red')">Red</button>
    <button onclick="changeColor('green')">Green</button>
    <button onclick="changeColor('blue')">Blue</button>
    <button onclick="changeColor('black')">Black</button>
    <button onclick="changeColor('white')">Eraser</button>
    <button onclick="clearCanvas()">Clear Canvas</button>
  </div>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/4.4.0/fabric.min.js"></script>
  <script>
    // Initialize Fabric.js canvas
    const canvas = new fabric.Canvas('canvas');

    // Set default drawing properties
    canvas.isDrawingMode = true;
    canvas.freeDrawingBrush.width = 5;
    canvas.freeDrawingBrush.color = 'black';

    // Function to change drawing color
    function changeColor(color) {
      if (color === 'white') {
        // Set the drawing brush to eraser mode
        canvas.freeDrawingBrush.color = 'white';
      } else {
        canvas.freeDrawingBrush.color = color;
      }
    }

    // Function to clear the canvas
    function clearCanvas() {
      canvas.clear();
    }
  </script>
</body>
</html>

note book

code includes the necessary HTML structure for the notebook tool, CSS styles to customize the appearance, and JavaScript functionality for adding, editing, and deleting notes. It uses the Bootstrap framework for responsive styling and pre-defined classes for buttons and form elements.

Note: Make sure to save this code with a .html extension and open it in a web browser to see the notebook tool in action.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Notebook Tool</title>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <style>
    body {
      padding: 20px;
    }

    .note {
      margin-bottom: 20px;
    }

    .note .note-header {
      background-color: #f1f1f1;
      padding: 10px;
      border-radius: 5px 5px 0 0;
    }

    .note .note-content {
      background-color: #ffffff;
      padding: 10px;
      border: 1px solid #e1e1e1;
      border-radius: 0 0 5px 5px;
    }

    .note .note-actions {
      margin-top: 10px;
    }

    .btn-delete {
      color: #fff;
      background-color: #dc3545;
      border-color: #dc3545;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>Notebook Tool</h1>
    <form id="noteForm">
      <div class="form-group">
        <label for="noteTitle">Note Title:</label>
        <input type="text" class="form-control" id="noteTitle" placeholder="Enter note title" required>
      </div>
      <div class="form-group">
        <label for="noteContent">Note Content:</label>
        <textarea class="form-control" id="noteContent" rows="3" placeholder="Enter note content" required></textarea>
      </div>
      <button type="submit" class="btn btn-primary">Add Note</button>
    </form>
    <div id="noteList"></div>
  </div>

  <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
  <script>
    // Array to store notes
    let notes = [];

    // Function to render notes
    function renderNotes() {
      const noteList = document.getElementById('noteList');
      noteList.innerHTML = '';

      notes.forEach((note, index) => {
        const noteElement = document.createElement('div');
        noteElement.className = 'note';

        const noteHeader = document.createElement('div');
        noteHeader.className = 'note-header';
        noteHeader.innerHTML = `<strong>${note.title}</strong>`;
        noteElement.appendChild(noteHeader);

        const noteContent = document.createElement('div');
        noteContent.className = 'note-content';
        noteContent.textContent = note.content;
        noteElement.appendChild(noteContent);

        const noteActions = document.createElement('div');
        noteActions.className = 'note-actions';
        noteActions.innerHTML = `
          <button class="btn btn-danger btn-delete" onclick="deleteNote(${index})">Delete</button>
          <button class="btn btn-primary" onclick="editNote(${index})">Edit</button>
        `;
        noteElement.appendChild(noteActions);

        noteList.appendChild(noteElement);
      });
    }

    // Function to add a new note
    function addNote() {
      const noteTitleInput = document.getElementById('noteTitle');
      const noteContentInput = document.getElementById('noteContent');

      const title = noteTitleInput.value;
      const content = noteContentInput.value;

      if (title.trim() === '' || content.trim() === '') {
        return;
      }

      const newNote = {
        title,
        content
      };

      notes.push(newNote);

      renderNotes();

      // Clear form inputs
      noteTitleInput.value = '';
      noteContentInput.value = '';
    }

    // Function to delete a note
    function deleteNote(index) {
      notes.splice(index, 1);
      renderNotes();
    }

    // Function to edit a note
    function editNote(index) {
      const note = notes[index];

      const noteTitleInput = document.getElementById('noteTitle');
      const noteContentInput = document.getElementById('noteContent');

      noteTitleInput.value = note.title;
      noteContentInput.value = note.content;

      notes.splice(index, 1);
      renderNotes();
    }

    // Event listener for note submission
    document.getElementById('noteForm').addEventListener('submit', function(event) {
      event.preventDefault();
      addNote();
    });
  </script>
</body>
</html>

html css javascript previewer

this example, the HTML, CSS, and JavaScript code editors are represented by <textarea> elements within their respective <div class="editor"> containers. The preview is displayed in the <iframe> element with the id previewFrame. The "Run Preview" button triggers the runPreview() function to update the preview.

The code is highlighted using the highlight.js library, which is included via the CDN link. Syntax highlighting classes are automatically applied to the code elements to improve readability.

Feel free to customize the styling, add more features, and enhance the functionality to suit your needs. You can also explore additional libraries for more advanced code editing and previewing capabilities.

<!DOCTYPE html>
<html>
<head>
  <title>HTML CSS JS Previewer/Editor</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/monokai-sublime.min.css">
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f7f7f7;
      margin: 0;
      padding: 0;
    }

    .container {
      max-width: 800px;
      margin: 20px auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .editor-area {
      display: flex;
      flex-wrap: wrap;
      margin-bottom: 20px;
    }

    .editor {
      flex: 1;
      margin-bottom: 10px;
    }

    .editor textarea {
      width: 100%;
      height: 200px;
      border: 1px solid #ccc;
      border-radius: 3px;
      padding: 10px;
      font-family: Consolas, monospace;
      font-size: 14px;
    }

    .preview {
      background-color: #f9f9f9;
      padding: 10px;
      border-radius: 3px;
    }

    .preview iframe {
      width: 100%;
      height: 300px;
      border: none;
    }

    .button {
      display: inline-block;
      padding: 10px 20px;
      background-color: #4caf50;
      color: #fff;
      text-decoration: none;
      border-radius: 3px;
      transition: background-color 0.3s;
    }

    .button:hover {
      background-color: #45a049;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>HTML CSS JS Previewer/Editor</h1>

    <div class="editor-area">
      <div class="editor">
        <h2>HTML</h2>
        <textarea id="htmlEditor" placeholder="Enter your HTML code here"></textarea>
      </div>

      <div class="editor">
        <h2>CSS</h2>
        <textarea id="cssEditor" placeholder="Enter your CSS code here"></textarea>
      </div>

      <div class="editor">
        <h2>JavaScript</h2>
        <textarea id="jsEditor" placeholder="Enter your JavaScript code here"></textarea>
      </div>
    </div>

    <div class="preview">
      <h2>Preview</h2>
      <iframe id="previewFrame"></iframe>
    </div>

    <button class="button" onclick="runPreview()">Run Preview</button>
  </div>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js"></script>
  <script>
    const htmlEditor = document.getElementById('htmlEditor');
    const cssEditor = document.getElementById('cssEditor');
    const jsEditor = document.getElementById('jsEditor');
    const previewFrame = document.getElementById('previewFrame').contentWindow.document;

    function runPreview() {
      const htmlCode = htmlEditor.value;
      const cssCode = '<style>' + cssEditor.value + '</style>';
      const jsCode = '<script>' + jsEditor.value + '</script>';

      previewFrame.open();
      previewFrame.write(htmlCode + cssCode + jsCode);
      previewFrame.close();
    }

    hljs.highlightAll();
  </script>
</body>
</html>


html previewer Tool

In this example, the HTML code is entered in the <textarea> element with the class code-editor. The real-time preview is displayed in the <iframe> element with the id previewFrame.

The JavaScript code listens for any changes in the code editor and updates the preview iframe accordingly by writing the HTML code into its document.

Feel free to customize the styling, add more features, and enhance the functionality as per your requirements.


<!DOCTYPE html>
<html>
<head>
  <title>HTML Previewer Tool</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f7f7f7;
      margin: 0;
      padding: 0;
    }

    .container {
      max-width: 800px;
      margin: 20px auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .code-editor {
      width: 100%;
      height: 300px;
      margin-bottom: 20px;
      border: 1px solid #ccc;
      border-radius: 3px;
      padding: 10px;
    }

    .preview {
      background-color: #f9f9f9;
      padding: 10px;
      border-radius: 3px;
    }

    .preview iframe {
      width: 100%;
      height: 100%;
      border: none;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>HTML Previewer Tool</h1>

    <textarea id="codeEditor" class="code-editor" placeholder="Enter your HTML code here"></textarea>

    <div class="preview">
      <iframe id="previewFrame"></iframe>
    </div>
  </div>

  <script>
    const codeEditor = document.getElementById('codeEditor');
    const previewFrame = document.getElementById('previewFrame');

    codeEditor.addEventListener('input', updatePreview);

    function updatePreview() {
      const code = codeEditor.value;
      const previewDoc = previewFrame.contentWindow.document;
      previewDoc.open();
      previewDoc.write(code);
      previewDoc.close();
    }
  </script>
</body>
</html>

English speaking course Ai

this example, each lesson is represented as a <div class="lesson"> element, and exercises are represented as <div class="exercise"> elements. The user can input their answers for text-based exercises and dialogues.

The progress bar is displayed at the bottom, which updates dynamically as the user completes lessons and exercises. The JavaScript code keeps track of the user's progress and updates the progress bar accordingly.

Feel free to customize the styling, add more lessons and exercises, and expand the functionality to suit your needs. Remember to include relevant content and interactions within each lesson/exercise based on your English speaking course material.


<!DOCTYPE html>
<html>
<head>
  <title>English Speaking Course AI</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f7f7f7;
      margin: 0;
      padding: 0;
    }

    .container {
      max-width: 800px;
      margin: 20px auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .lesson {
      margin-bottom: 20px;
      padding: 10px;
      background-color: #f9f9f9;
      border-radius: 5px;
    }

    .exercise {
      margin-top: 10px;
    }

    .exercise input[type="text"] {
      width: 100%;
      padding: 10px;
      border-radius: 3px;
      border: 1px solid #ccc;
    }

    .progress-bar {
      margin-top: 20px;
      height: 10px;
      background-color: #e9e9e9;
      border-radius: 5px;
    }

    .progress-bar-fill {
      height: 100%;
      background-color: #4caf50;
      border-radius: 5px;
    }

    .button {
      display: inline-block;
      padding: 10px 20px;
      background-color: #4caf50;
      color: #fff;
      text-decoration: none;
      border-radius: 3px;
      transition: background-color 0.3s;
    }

    .button:hover {
      background-color: #45a049;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>English Speaking Course AI</h1>

    <div class="lesson">
      <h2>Lesson 1: Greetings</h2>
      <p>Hello - Hi</p>
      <p>Good morning - Good afternoon - Good evening</p>
    </div>

    <div class="lesson">
      <h2>Lesson 2: Introductions</h2>
      <p>My name is ______.</p>
      <p>Nice to meet you.</p>
    </div>

    <div class="exercise">
      <h3>Exercise 1: Fill in the Blanks</h3>
      <p>Complete the following sentence: "I _____ from the United States."</p>
      <input type="text" id="exercise1Input">
      <button class="button" onclick="checkAnswer('am')">Check Answer</button>
    </div>

    <div class="exercise">
      <h3>Exercise 2: Dialogue Practice</h3>
      <p>Practice the following dialogue:</p>
      <p>Person A: Hello, what's your name?</p>
      <p>Person B: _____________</p>
      <input type="text" id="exercise2Input">
      <button class="button" onclick="checkAnswer('My name is John')">Check Answer</button>
    </div>

    <div class="progress-bar">
      <div class="progress-bar-fill" id="progressBarFill" style="width: 0%;"></div>
    </div>
  </div>

  <script>
    const progress = {
      currentLesson: 0,
      totalLessons: document.querySelectorAll('.lesson').length,
      correctAnswers: 0,
    };

    function checkAnswer(answer) {
      if (answer.toLowerCase() === 'am' || answer.toLowerCase() === 'my name is john') {
        progress.correctAnswers++;
      }
      updateProgressBar();
    }

    function updateProgressBar() {
      progress.currentLesson++;
      const percentage = (progress.currentLesson / progress.totalLessons) * 100;
      document.getElementById('progressBarFill').style.width = percentage + '%';
    }
  </script>
</body>
</html>

Hindi speaking course Ai

this example, each lesson is represented as a <div class="lesson"> element, and exercises are represented as <div class="exercise"> elements. The user can input their answers for text-based exercises and dialogues.

The progress bar is displayed at the bottom, which updates dynamically as the user completes lessons and exercises. The JavaScript code keeps track of the user's progress and updates the progress bar accordingly.

Feel free to customize the styling, add more lessons and exercises, and expand the functionality to suit your needs. Remember to include relevant content and interactions within each lesson/exercise based on your Hindi speaking course material.


<!DOCTYPE html>
<html>
<head>
  <title>Hindi Speaking Course AI</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f7f7f7;
      margin: 0;
      padding: 0;
    }

    .container {
      max-width: 800px;
      margin: 20px auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .lesson {
      margin-bottom: 20px;
      padding: 10px;
      background-color: #f9f9f9;
      border-radius: 5px;
    }

    .exercise {
      margin-top: 10px;
    }

    .exercise input[type="text"] {
      width: 100%;
      padding: 10px;
      border-radius: 3px;
      border: 1px solid #ccc;
    }

    .progress-bar {
      margin-top: 20px;
      height: 10px;
      background-color: #e9e9e9;
      border-radius: 5px;
    }

    .progress-bar-fill {
      height: 100%;
      background-color: #4caf50;
      border-radius: 5px;
    }

    .button {
      display: inline-block;
      padding: 10px 20px;
      background-color: #4caf50;
      color: #fff;
      text-decoration: none;
      border-radius: 3px;
      transition: background-color 0.3s;
    }

    .button:hover {
      background-color: #45a049;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>Hindi Speaking Course AI</h1>

    <div class="lesson">
      <h2>Lesson 1: Greetings</h2>
      <p>नमस्ते (Namaste) - Hello</p>
      <p>अलविदा (Alvida) - Goodbye</p>
    </div>

    <div class="lesson">
      <h2>Lesson 2: Introductions</h2>
      <p>मेरा नाम ______ है। (Mera naam ______ hai.) - My name is ______.</p>
      <p>आपका नाम क्या है? (Aapka naam kya hai?) - What is your name?</p>
    </div>

    <div class="exercise">
      <h3>Exercise 1: Fill in the Blanks</h3>
      <p>Complete the following sentence: "मैं _____ से हूँ।" (Main _____ se hoon.)</p>
      <input type="text" id="exercise1Input">
      <button class="button" onclick="checkAnswer('भारत')">Check Answer</button>
    </div>

    <div class="exercise">
      <h3>Exercise 2: Dialogue Practice</h3>
      <p>Practice the following dialogue:</p>
      <p>Person A: आपका नाम क्या है? (Aapka naam kya hai?)</p>
      <p>Person B: मेरा नाम ______ है। (Mera naam ______ hai.)</p>
      <input type="text" id="exercise2Input">
      <button class="button" onclick="checkAnswer('राम')">Check Answer</button>
    </div>

    <div class="progress-bar">
      <div class="progress-bar-fill" id="progressBarFill" style="width: 0%;"></div>
    </div>
  </div>

  <script>
    const progress = {
      currentLesson: 0,
      totalLessons: document.querySelectorAll('.lesson').length,
      correctAnswers: 0,
    };

    function checkAnswer(answer) {
      if (answer === 'भारत' || answer === 'राम') {
        progress.correctAnswers++;
      }
      updateProgressBar();
    }

    function updateProgressBar() {
      progress.currentLesson++;
      const percentage = (progress.currentLesson / progress.totalLessons) * 100;
      document.getElementById('progressBarFill').style.width = percentage + '%';
    }
  </script>
</body>
</html>

English learning course Ai

this example, each lesson is represented as a <div class="lesson"> element, and exercises are represented as <div class="exercise"> elements. The user can input their answers for text-based exercises or select the correct option for multiple-choice exercises.

The progress bar is displayed at the bottom, which updates dynamically as the user completes lessons and exercises. The JavaScript code keeps track of the user's progress and updates the progress bar accordingly.

Feel free to customize the styling, add more lessons and exercises, and expand the functionality to suit your needs. Remember to include relevant content and interactions within each lesson/exercise based on your English learning course material.
<!DOCTYPE html>
<html>
<head>
  <title>English Learning Course AI</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f7f7f7;
      margin: 0;
      padding: 0;
    }

    .container {
      max-width: 800px;
      margin: 20px auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .lesson {
      margin-bottom: 20px;
      padding: 10px;
      background-color: #f9f9f9;
      border-radius: 5px;
    }

    .exercise {
      margin-top: 10px;
    }

    .exercise input[type="text"] {
      width: 100%;
      padding: 10px;
      border-radius: 3px;
      border: 1px solid #ccc;
    }

    .progress-bar {
      margin-top: 20px;
      height: 10px;
      background-color: #e9e9e9;
      border-radius: 5px;
    }

    .progress-bar-fill {
      height: 100%;
      background-color: #4caf50;
      border-radius: 5px;
    }

    .button {
      display: inline-block;
      padding: 10px 20px;
      background-color: #4caf50;
      color: #fff;
      text-decoration: none;
      border-radius: 3px;
      transition: background-color 0.3s;
    }

    .button:hover {
      background-color: #45a049;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>English Learning Course AI</h1>

    <div class="lesson">
      <h2>Lesson 1: Basic Vocabulary</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus id fringilla nisl. Donec eu bibendum ipsum. In eu vulputate mi. Praesent rhoncus nibh sed pulvinar venenatis.</p>
    </div>

    <div class="lesson">
      <h2>Lesson 2: Grammar</h2>
      <p>Quisque fermentum tortor in turpis gravida, sed ullamcorper libero pellentesque. Aenean maximus nisi et urna volutpat bibendum. Mauris scelerisque, ex et interdum consectetur, ante mauris sollicitudin odio, et lacinia ipsum massa et lacus.</p>
    </div>

    <div class="exercise">
      <h3>Exercise 1: Fill in the Blanks</h3>
      <p>Complete the following sentence: "I _____ to the park yesterday."</p>
      <input type="text" id="exercise1Input">
      <button class="button" onclick="checkAnswer('went')">Check Answer</button>
    </div>

    <div class="exercise">
      <h3>Exercise 2: Multiple Choice</h3>
      <p>What is the opposite of "happy"?</p>
      <label><input type="radio" name="exercise2Option" value="sad">Sad</label>
      <label><input type="radio" name="exercise2Option" value="angry">Angry</label>
      <label><input type="radio" name="exercise2Option" value="excited">Excited</label>
      <button class="button" onclick="checkAnswer('sad')">Check Answer</button>
    </div>

    <div class="progress-bar">
      <div class="progress-bar-fill" id="progressBarFill" style="width: 0%;"></div>
    </div>
  </div>

  <script>
    const progress = {
      currentLesson: 0,
      totalLessons: document.querySelectorAll('.lesson').length,
      correctAnswers: 0,
    };

    function checkAnswer(answer) {
      if (answer.toLowerCase() === 'went') {
        progress.correctAnswers++;
      }
      updateProgressBar();
    }

    function updateProgressBar() {
      progress.currentLesson++;
      const percentage = (progress.currentLesson / progress.totalLessons) * 100;
      document.getElementById('progressBarFill').style.width = percentage + '%';
    }
  </script>
</body>
</html>

Friday, 14 July 2023

Blog post Finder

Save the code in an HTML file and open it in a web browser. The tool will allow you to enter a keyword in the input field and click the "Find Blog Posts" button. It will then search the pre-defined list of blog posts for matches based on the keyword. The tool will display the number of matching blog posts found and provide clickable links to those posts.

Please note that the example uses a static list of blog posts for demonstration purposes. In a real-world scenario, you would typically fetch blog post data from a database or an external source.

<!DOCTYPE html>
<html>
<head>
  <title>Blog Post Finder</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f3f3f3;
    }

    .container {
      max-width: 600px;
      margin: 0 auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
      border-radius: 5px;
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .prompt {
      margin-bottom: 10px;
    }

    .prompt label {
      display: block;
      font-weight: bold;
      margin-bottom: 5px;
    }

    .prompt input[type="text"] {
      width: 100%;
      padding: 5px;
      border: 1px solid #ccc;
      border-radius: 3px;
    }

    .button {
      display: block;
      width: 100%;
      padding: 10px;
      background-color: #4CAF50;
      color: #fff;
      text-align: center;
      text-decoration: none;
      border-radius: 3px;
      cursor: pointer;
    }

    .button:hover {
      background-color: #45a049;
    }

    .output {
      margin-top: 20px;
    }

    .output p {
      margin-bottom: 10px;
      font-weight: bold;
    }

    .output a {
      text-decoration: none;
      color: #333;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>Blog Post Finder</h1>

    <div class="prompt">
      <label for="keyword">Keyword:</label>
      <input type="text" id="keyword" placeholder="Enter a keyword">
    </div>

    <button class="button" onclick="findBlogPosts()">Find Blog Posts</button>

    <div class="output" id="output"></div>
  </div>

  <script>
    function findBlogPosts() {
      var keyword = document.getElementById('keyword').value.toLowerCase();
      var outputDiv = document.getElementById('output');

      // Sample blog post data
      var blogPosts = [
        {
          title: "Introduction to JavaScript",
          url: "https://example.com/intro-js",
          tags: ["javascript", "programming", "web"]
        },
        {
          title: "10 Tips for Better Productivity",
          url: "https://example.com/productivity-tips",
          tags: ["productivity", "tips"]
        },
        {
          title: "Getting Started with HTML and CSS",
          url: "https://example.com/html-css",
          tags: ["html", "css", "web"]
        },
        {
          title: "The Benefits of Regular Exercise",
          url: "https://example.com/exercise-benefits",
          tags: ["health", "exercise", "wellness"]
        },
        {
          title: "Mastering the Art of Cooking",
          url: "https://example.com/cooking",
          tags: ["cooking", "food"]
        }
      ];

      // Filter blog posts by keyword
      var filteredPosts = blogPosts.filter(function(post) {
        var lowerCaseTitle = post.title.toLowerCase();
        var hasKeyword = lowerCaseTitle.includes(keyword);
        return hasKeyword;
      });

      // Generate output
      outputDiv.innerHTML = "";

      if (filteredPosts.length > 0) {
        var header = document.createElement("p");
        header.textContent = "Found " + filteredPosts.length + " blog post(s) related to the keyword:";
        outputDiv.appendChild(header);

        filteredPosts.forEach(function(post) {
          var link = document.createElement("a");
          link.href = post.url;
          link.textContent = post.title;
          outputDiv.appendChild(link);
        });
      } else {
        var noResults = document.createElement("p");
        noResults.textContent = "No blog posts found.";
        outputDiv.appendChild(noResults);
      }
    }
  </script>
</body>
</html>

comment generator AI

Save the code in an HTML file and open it in a web browser. The tool will display a paragraph element that initially says "Click the button to generate a comment." When you click the "Generate Comment" button, it will randomly select a comment from the predefined list and display it in the paragraph element.

Please note that this example does not involve AI or the mymemory library. It simply generates random comments from a predefined list using JavaScript.


<!DOCTYPE html>
<html>
<head>
  <title>AI Comment Generator</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f3f3f3;
    }

    .container {
      max-width: 600px;
      margin: 0 auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
      border-radius: 5px;
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .comment {
      margin-bottom: 10px;
    }

    .button {
      display: block;
      width: 100%;
      padding: 10px;
      background-color: #4CAF50;
      color: #fff;
      text-align: center;
      text-decoration: none;
      border-radius: 3px;
      cursor: pointer;
    }

    .button:hover {
      background-color: #45a049;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>AI Comment Generator</h1>

    <div class="comment">
      <p id="commentText">Click the button to generate a comment.</p>
    </div>

    <button class="button" onclick="generateComment()">Generate Comment</button>
  </div>

  <script>
    var comments = [
      "Great job! I love it.",
      "This is amazing. Well done!",
      "I'm impressed. Keep up the good work.",
      "Fantastic! I'm really impressed with your work.",
      "You're doing great. Keep it up!",
      "Wow, this is incredible. I'm speechless.",
      "Brilliant work! I'm blown away.",
      "You're a rockstar. Keep shining!",
      "Outstanding! This is top-notch quality.",
      "Incredible effort. I'm truly impressed."
    ];

    function generateComment() {
      var commentIndex = Math.floor(Math.random() * comments.length);
      var commentText = document.getElementById('commentText');
      commentText.textContent = comments[commentIndex];
    }
  </script>
</body>
</html>


image resizer

Save the code in an HTML file and open it in a web browser. The tool will allow you to select an image file, specify the desired width and height, and click the "Resize Image" button. The tool will then resize the image using JavaScript and display the resized image on the page.

Please note that this code performs client-side image resizing, which means the actual file size remains the same. It resizes the image dimensions but not the file size itself.

<!DOCTYPE html>
<html>
<head>
  <title>Image Resizer</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f3f3f3;
    }

    .container {
      max-width: 600px;
      margin: 0 auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
      border-radius: 5px;
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .prompt {
      margin-bottom: 10px;
    }

    .prompt label {
      display: block;
      font-weight: bold;
      margin-bottom: 5px;
    }

    .prompt input[type="file"] {
      display: none;
    }

    .prompt .custom-file-upload {
      display: inline-block;
      padding: 6px 12px;
      cursor: pointer;
      background-color: #4CAF50;
      color: #fff;
      border: none;
      border-radius: 3px;
    }

    .button {
      display: block;
      width: 100%;
      padding: 10px;
      background-color: #4CAF50;
      color: #fff;
      text-align: center;
      text-decoration: none;
      border-radius: 3px;
      cursor: pointer;
    }

    .button:hover {
      background-color: #45a049;
    }

    .output img {
      max-width: 100%;
      height: auto;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>Image Resizer</h1>

    <div class="prompt">
      <label for="upload">Upload an image:</label>
      <input type="file" id="upload" accept="image/*">
      <label for="upload" class="custom-file-upload">Choose File</label>
    </div>

    <div class="prompt">
      <label for="width">Width:</label>
      <input type="number" id="width" placeholder="Enter the desired width" min="1">
    </div>

    <div class="prompt">
      <label for="height">Height:</label>
      <input type="number" id="height" placeholder="Enter the desired height" min="1">
    </div>

    <button class="button" onclick="resizeImage()">Resize Image</button>

    <div class="output" id="output"></div>
  </div>

  <script>
    function resizeImage() {
      var fileInput = document.getElementById('upload');
      var widthInput = document.getElementById('width');
      var heightInput = document.getElementById('height');
      var outputDiv = document.getElementById('output');

      var file = fileInput.files[0];
      if (!file) return;

      var reader = new FileReader();
      reader.onload = function(e) {
        var img = new Image();
        img.onload = function() {
          var canvas = document.createElement('canvas');
          var ctx = canvas.getContext('2d');

          var width = Number(widthInput.value);
          var height = Number(heightInput.value);

          // Calculate new dimensions while maintaining aspect ratio
          if (width && !height) {
            height = (width / img.width) * img.height;
          } else if (!width && height) {
            width = (height / img.height) * img.width;
          } else if (width && height) {
            var aspectRatio = img.width / img.height;
            if (width / height > aspectRatio) {
              height = (width / aspectRatio);
            } else {
              width = (height * aspectRatio);
            }
          } else {
            return; // No dimensions provided
          }

          // Set canvas dimensions
          canvas.width = width;
          canvas.height = height;

          // Draw resized image on the canvas
          ctx.drawImage(img, 0, 0, width, height);

          // Convert the canvas image to a data URL
          var resizedImageURL = canvas.toDataURL(file.type);

          // Display the resized image
          var imgOutput = document.createElement('img');
          imgOutput.src = resizedImageURL;
          outputDiv.innerHTML = '';
          outputDiv.appendChild(imgOutput);
        };
        img.src = e.target.result;
      };
      reader.readAsDataURL(file);
    }
  </script>
</body>
</html>

zip file generator

To use this code, save it in an HTML file and open it in a web browser. It will display a zip file generator with fields for entering the filename and file content. When you click the "Generate Zip File" button, it will create a zip file with the specified filename and the content provided in the textarea. The zip file will be downloaded automatically.

Please note that this example generates uncompressed zip files using the jszip library. If you require compression functionality, you would need to implement it on the server-side using a programming language like Python or PHP.

<!DOCTYPE html>
<html>
<head>
  <title>Zip File Generator</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f3f3f3;
    }

    .container {
      max-width: 600px;
      margin: 0 auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
      border-radius: 5px;
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .prompt {
      margin-bottom: 10px;
    }

    .prompt label {
      display: block;
      font-weight: bold;
      margin-bottom: 5px;
    }

    .prompt input[type="text"] {
      width: 100%;
      padding: 5px;
      border: 1px solid #ccc;
      border-radius: 3px;
    }

    .button {
      display: block;
      width: 100%;
      padding: 10px;
      background-color: #4CAF50;
      color: #fff;
      text-align: center;
      text-decoration: none;
      border-radius: 3px;
      cursor: pointer;
    }

    .button:hover {
      background-color: #45a049;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>Zip File Generator</h1>

    <div class="prompt">
      <label for="filename">Filename:</label>
      <input type="text" id="filename" placeholder="Enter the filename">
    </div>

    <div class="prompt">
      <label for="fileContent">File Content:</label>
      <textarea id="fileContent" placeholder="Enter the file content"></textarea>
    </div>

    <button class="button" onclick="generateZipFile()">Generate Zip File</button>
  </div>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.6.0/jszip.min.js"></script>
  <script>
    function generateZipFile() {
      var filename = document.getElementById('filename').value;
      var fileContent = document.getElementById('fileContent').value;

      var zip = new JSZip();
      zip.file(filename, fileContent);

      zip.generateAsync({ type: "blob" })
        .then(function (content) {
          // Save the zip file
          var link = document.createElement('a');
          link.href = URL.createObjectURL(content);
          link.download = filename + ".zip";
          link.click();
        });
    }
  </script>
</body>
</html>

text and html file generator

use this code, save it in an HTML file and open it in a web browser. It will display a text and HTML file generator with fields for entering the text content and the desired filename. When you click the "Generate Files" button, it will generate a text file and an HTML file based on the provided inputs. The generated files will be available for download, and their contents will be displayed in the respective textareas.

Please note that the mymemory library is an unofficial JavaScript library that provides access to the MyMemory Translation service. As it is a third-party library, ensure that you review and comply with its terms of use and any licensing requirements.

<!DOCTYPE html>
<html>
<head>
  <title>Text and HTML File Generator</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f3f3f3;
    }

    .container {
      max-width: 600px;
      margin: 0 auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
      border-radius: 5px;
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .prompt {
      margin-bottom: 10px;
    }

    .prompt label {
      display: block;
      font-weight: bold;
      margin-bottom: 5px;
    }

    .prompt input[type="text"] {
      width: 100%;
      padding: 5px;
      border: 1px solid #ccc;
      border-radius: 3px;
    }

    .button {
      display: block;
      width: 100%;
      padding: 10px;
      background-color: #4CAF50;
      color: #fff;
      text-align: center;
      text-decoration: none;
      border-radius: 3px;
      cursor: pointer;
    }

    .button:hover {
      background-color: #45a049;
    }

    .output {
      margin-top: 20px;
    }

    .output textarea {
      width: 100%;
      height: 200px;
      padding: 5px;
      border: 1px solid #ccc;
      border-radius: 3px;
      resize: vertical;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>Text and HTML File Generator</h1>

    <div class="prompt">
      <label for="text">Text:</label>
      <textarea id="text" placeholder="Enter your text"></textarea>
    </div>

    <div class="prompt">
      <label for="filename">Filename:</label>
      <input type="text" id="filename" placeholder="Enter the filename">
    </div>

    <button class="button" onclick="generateFiles()">Generate Files</button>

    <div class="output">
      <h3>Generated Text File:</h3>
      <textarea id="textFile" readonly></textarea>
    </div>

    <div class="output">
      <h3>Generated HTML File:</h3>
      <textarea id="htmlFile" readonly></textarea>
    </div>
  </div>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  <script src="https://unpkg.com/mymemory-translation@2.2.0/mymemory.js"></script>
  <script>
    function generateFiles() {
      var text = document.getElementById('text').value;
      var filename = document.getElementById('filename').value;

      // Generate Text File
      var textFileContent = text;

      var textFileBlob = new Blob([textFileContent], { type: 'text/plain' });
      var textFileURL = URL.createObjectURL(textFileBlob);

      var textFile = document.getElementById('textFile');
      textFile.value = textFileContent;
      textFile.download = filename + '.txt';

      // Generate HTML File
      var htmlFileContent = '<!DOCTYPE html>\n<html>\n<head>\n <title>' + filename + '</title>\n</head>\n<body>\n <pre>' + text + '</pre>\n</body>\n</html>';

      var htmlFileBlob = new Blob([htmlFileContent], { type: 'text/html' });
      var htmlFileURL = URL.createObjectURL(htmlFileBlob);

      var htmlFile = document.getElementById('htmlFile');
      htmlFile.value = htmlFileContent;
      htmlFile.download = filename + '.html';
    }
  </script>
</body>
</html>

configuration of website

Menu Type: Dropdown with Full Width Ensure the navigation items in the dropdown menu contain relevant keywords related to the we...