Pattern mechanism 1.0

by velo_ninja

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TempManager + Pattern Manager (Stabilize Mode)</title>
<style>
body { font-family: Arial, sans-serif; margin: 0; padding: 0; background: #f5f5f5; }
.wrapperTop, .wrapperCenter, .wrapperBottom { padding: 10px; }
.wrapperTop { background: #8f8; }
.wrapperCenter { background: #88f; }
.wrapperBottom {
  background: orange;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.control-section, .json-section, .pattern-section { padding: 10px; background: #fff; border-radius: 8px; box-shadow: 0 0 5px rgba(0,0,0,0.1);}
textarea { width: 100%; height: 150px; resize: vertical; font-family: monospace; }
button, input, select { margin: 3px; padding: 4px 6px; font-size: 0.9em; }
table { border-collapse: collapse; width: 100%; margin-top: 5px; }
th, td { border: 1px solid #aaa; padding: 4px 6px; text-align: center; vertical-align: top; }
th { background: #ddd; position: sticky; top: 0; z-index: 5; }
</style>
</head>
<body>

<!-- Top wrapper: controls -->
<div class="wrapperTop" id="wrapperTop"></div>

<!-- Center wrapper: table -->
<div class="wrapperCenter">
  <div id="tableContainer" class="control-section">
    <h3>Temperature Table</h3>
  </div>
</div>

<!-- Bottom wrapper: JSON + pattern manager -->
<div class="wrapperBottom">
  <div class="json-section">
    <h3>Dataset JSON Input</h3>
    <textarea id="datasetInput" placeholder="Paste JSON dataset here..."></textarea>
    <button id="applyJSONBtn">Apply JSON</button>
    <button id="resetManualBtn">Reset Manual Mode</button>
  </div>

  <div class="json-section">
    <h3>Live JSON Preview</h3>
    <textarea id="jsonPreview" readonly></textarea>
  </div>

  <div class="pattern-section">
    <h3>Pattern Manager</h3>
    <textarea id="patternInput" placeholder="Enter new pattern JSON here..."></textarea>
    <label>Assign Function:</label>
    <select id="functionSelect"></select>
  ...

CSS

/* --- Professional Control Styling --- */
  .control-section {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px 12px 8px 0;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }

  .control-section span {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    min-width: 90px;
  }

  .control-section button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
  }

  .control-section button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  }

  .control-section button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(102, 126, 234, 0.3);
  }

  .control-section input[type="number"] {
    width: 70px;
    height: 32px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: #2c3e50;
    transition: all 0.2s ease;
  }

  .control-section input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  }

  input[type="text"] {
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    transition: border-color 0.2s ease;
  }

  input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
  }

  textarea.json-preview {
    width: 100%;
    height: 150px;
    font-family: 'Courier New', monospace;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    font-size:...

JavaScript

[
  {"Zone":"Head 1-1","Temperature":200,"Target":210,"Min":200,"Max":220},
  {"Zone":"Head 1-2","Temperature":201,"Target":210,"Min":200,"Max":220},
  {"Zone":"Head 2-1","Temperature":199,"Target":210,"Min":200,"Max":220},
  {"Zone":"Head 2-2","Temperature":202,"Target":210,"Min":200,"Max":220},
  {"Zone":"Extruder 1-1","Temperature":210,"Target":210,"Min":200,"Max":220}
]