Tính kích thước kính dán bể dấu keo

Zalo 0971539681 Tư vấn & Hỗ trợ
Nhằm chia sẻ cho những bạn đang mới chơi có bộ công cụ nhanh – gọn – lẹ để tính toán các kích thước của bể kính thuỷ sinh giấu keo, không kiềng. Chúng tôi cung cấp một ứng dụng giúp bạn có thể nhanh cho tìm ra kích thước chuẩn xác nhất.
.

Tính kích thước kính dán bể dấu keo

Để có kết quả chính xác. Vui lòng nhập đầy đủ thông tin!

Chiều dài (cm):
Chiều rộng (cm):
Chiều cao (cm):
Độ dày keo (mm):
Độ dày kính (mm):
Kết quả
01 Tấm đáy kích thước:
-- x -- (mm)
02 Tấm mặt trước - sau kích thước:
-- x -- (mm)
02 Tấm bên kích thước:
-- x -- (mm)


Share code bên dưới.

<style>
.calculator{max-width:600px;margin:20px auto;background-color:#fff;padding:20px;border-radius:8px;box-shadow:0 0 20px rgba(0,0,0,0.1)}.title-detail{text-align:center;color:#007bff;font-size:24px;margin-bottom:20px}.row-x{display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:15px}.cal-name{flex:0 0 45%;text-align:right;padding-right:15px;font-weight:bold;color:#343a40}.cal-input{flex:0 0 50%;padding:10px;border:1px solid #ced4da;border-radius:4px;transition:border-color 0.15s ease-in-out,box-shadow 0.15s ease-in-out}.cal-input:focus{border-color:#007bff;outline:0;box-shadow:0 0 0 0.2rem rgba(0,123,255,0.25)}.p{color:#6c757d;display:block;margin-bottom:15px}.notification{color:red;text-align:center;margin-top:10px}.cal-btn{background-color:#28a745;color:white;padding:10px 15px;border:none;border-radius:4px;cursor:pointer;font-size:16px;transition:background-color 0.3s ease}.cal-btn:hover{background-color:#218838}.results{font-size:20px;font-weight:bold;margin-bottom:15px;color:#007bff}.info{padding:3px;border:1px solid #007bff;border-radius:4px;margin-top:0;color:#007bff} 
</style>
<p class="title-detail"> Tính kích thước kính dán bể dấu keo </p>
<div class="calculator">
  <p>Để có kết quả chính xác. Vui lòng nhập đầy đủ thông tin!</p>
  <div class="row-x p-2 justify-content-center">
    <div class="cal-name">Chiều dài (cm):</div>
    <div>
      <input type="number" id="length" class="cal-input" />
    </div>
  </div>
  <div class="row-x p-2 justify-content-center">
    <div class="cal-name">Chiều rộng (cm):</div>
    <div>
      <input type="number" id="width" class="cal-input">
    </div>
  </div>
  <div class="row-x p-2 justify-content-center">
    <div class="cal-name">Chiều cao (cm):</div>
    <div>
      <input type="number" id="height" class="cal-input">
    </div>
  </div>
  <div class="row-x p-2 justify-content-center">
    <div class="cal-name">Độ dày keo (mm):</div>
    <div>
      <input type="number" id="glue-thickness" class="cal-input">
    </div>
  </div>
  <div class="row-x p-2 justify-content-center">
    <div class="cal-name">Độ dày kính (mm):</div>
    <div>
      <input type="number" id="glass-thickness" class="cal-input">
    </div>
  </div>
  <div class="row-x p-2 justify-content-center">
    <div class="notification"></div>
  </div>
  <div class="row-x pt-3">
    <button class="cal-btn">Tính</button>
  </div>
  <div class="cal-results">
    <div class="results">Kết quả</div>
    <div class="row-x">
      <div><span>01 </span>Tấm đáy kích thước:</div>
      <div class="info tam-day">-- x -- (mm)</div>
    </div>
    <div class="row-x">
      <div><span>02 </span>Tấm mặt trước - sau kích thước:</div>
      <div class="info tam-truoc-sau">-- x -- (mm)</div>
    </div>
    <div class="row-x">
      <div><span>02 </span>Tấm bên kích thước:</div>
      <div class="info tam-ben">-- x -- (mm)</div>
    </div>
  </div>
</div>
<script>
  ! function(e) {
    var n = !1;
    if ("function" == typeof define && define.amd && (define(e), n = !0), "object" == typeof exports && (module.exports = e(), n = !0), !n) {
      var o = window.Cookies,
        t = window.Cookies = e();
      t.noConflict = function() {
        return window.Cookies = o, t
      }
    }
  }(function() {
    function e() {
      for (var e = 0, n = {}; e < arguments.length; e++) {
        var o = arguments[e];
        for (var t in o) n[t] = o[t]
      }
      return n
    }
    return function n(o) {
      function t(n, r, i) {
        var c;
        if ("undefined" != typeof document) {
          if (arguments.length > 1) {
            if ("number" == typeof(i = e({
                path: "/"
              }, t.defaults, i)).expires) {
              var a = new Date;
              a.setMilliseconds(a.getMilliseconds() + 864e5 * i.expires), i.expires = a
            }
            i.expires = i.expires ? i.expires.toUTCString() : "";
            try {
              c = JSON.stringify(r), /^[\{\[]/.test(c) && (r = c)
            } catch (m) {}
            r = o.write ? o.write(r, n) : encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), n = (n = (n = encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)).replace(/[\(\)]/g, escape);
            var f = "";
            for (var s in i) i[s] && (f += "; " + s, !0 !== i[s] && (f += "=" + i[s]));
            return document.cookie = n + "=" + r + f
          }
          n || (c = {});
          for (var p = document.cookie ? document.cookie.split("; ") : [], d = /(%[0-9A-Z]{2})+/g, u = 0; u < p.length; u++) {
            var l = p[u].split("="),
              C = l.slice(1).join("=");
            '"' === C.charAt(0) && (C = C.slice(1, -1));
            try {
              var g = l[0].replace(d, decodeURIComponent);
              if (C = o.read ? o.read(C, g) : o(C, g) || C.replace(d, decodeURIComponent), this.json) try {
                C = JSON.parse(C)
              } catch (m) {}
              if (n === g) {
                c = C;
                break
              }
              n || (c[g] = C)
            } catch (m) {}
          }
          return c
        }
      }
      return t.set = t, t.get = function(e) {
        return t.call(t, e)
      }, t.getJSON = function() {
        return t.apply({
          json: !0
        }, [].slice.call(arguments))
      }, t.defaults = {}, t.remove = function(n, o) {
        t(n, "", e(o, {
          expires: -1
        }))
      }, t.withConverter = n, t
    }(function() {})
  });
  window.addEventListener('load', function() {
    // Lấy kết quả trước đã nhập
    if (Cookies.get('tam-day')) {
      $('.results').html('Kết quả (đã nhập trước đó)');
      $('.tam-day').html(Cookies.get('tam-day'));
      $('.tam-truoc-sau').html(Cookies.get('tam-truoc-sau'));
      $('.tam-ben').html(Cookies.get('tam-ben'));
    }
    // Fill dữ liệu đã nhập
    document.getElementById("length").value = Cookies.get("chieuDai");
    document.getElementById("width").value = Cookies.get("chieuRong");
    document.getElementById("height").value = Cookies.get("chieuCao");
    document.getElementById("glue-thickness").value = Cookies.get("doDayKeo");
    document.getElementById("glass-thickness").value = Cookies.get("doDayKinh");
    $('.cal-btn').on('click', function() {
      var chieuDai = parseInt(document.getElementById('length').value);
      var chieuRong = parseInt(document.getElementById('width').value);
      var chieuCao = document.getElementById('height').value;
      var doDayKeo = Math.round(parseInt(document.getElementById('glue-thickness').value)) / 10;
      var doDayKinh = Math.round(parseInt(document.getElementById('glass-thickness').value)) / 10;
      if (chieuDai === undefined || chieuRong === undefined || chieuCao === undefined || doDayKeo === undefined || doDayKinh === undefined) {
        $('.notification').html('<p>Vui lòng nhập đầy đủ các thông số</p>');
      } else if (chieuDai <= 0 || chieuRong <= 0 || chieuCao <= 0 || doDayKeo <= 0 || doDayKinh <= 0) {
        $('.notification').html('<p>Vui lòng nhập lại các thông số. Các thông số phải lớn hơn 0</p>');
      } else if (doDayKeo > 0.5) {
        $('.notification').html('<p>Độ dày của keo quá dày. Bạn hãy nhập lại thông số!</p>');
      } else if (doDayKinh < 0.2) {
        $('.notification').html('<p>Kính quá mỏng. Bạn vui lòng lựa chọn kính dày hơn!</p>');
      } else if (doDayKinh > chieuRong / 2) {
        $('.notification').html('<p>Kính quá dày. Bạn vui lòng lựa chọn kính mỏng hơn!</p>');
      } else {
        $('.results').html('Kết quả');
        var below_R = chieuRong - 2 * (doDayKinh + doDayKeo);
        var below_D = chieuDai - 2 * (doDayKinh + doDayKeo);
        $('.notification').html('');
        $('.tam-day').html(below_D + ' x ' + below_R + ' (cm)');
        $('.tam-truoc-sau').html(chieuDai + ' x ' + chieuCao + ' (cm)');
        $('.tam-ben').html(chieuCao + ' x ' + below_R + ' (cm)');
        // Set cookie chỉ số:
        Cookies.set('chieuDai', chieuDai);
        Cookies.set('chieuRong', chieuRong);
        Cookies.set('chieuCao', chieuCao);
        Cookies.set('doDayKeo', parseInt(document.getElementById('glue-thickness').value));
        Cookies.set('doDayKinh', parseInt(document.getElementById('glass-thickness').value));
        Cookies.set('tam-day', below_D + ' x ' + below_R + ' (cm)');
        Cookies.set('tam-truoc-sau', chieuDai + ' x ' + chieuCao + ' (cm)');
        Cookies.set('tam-ben', chieuCao + ' x ' + below_R + ' (cm)');
      }
    });
  })
</script>

Bài liên quan ngẫu nhiên

Nhận xét

Contact Me on Zalo