templates/home/volumetricweight.html.twig line 1

  1. {% extends 'theme.html.twig' %}
  2. {% block title %}Volumetric Weight - {{ parent() }} {% endblock %}
  3. {% block body %}
  4. {% apply inline_css %}
  5. <style>
  6. table {
  7.   border-collapse: collapse;
  8.   width: 100%;
  9. }
  10. th, td {
  11.   padding: 8px;
  12.   text-align: left;
  13.   border-bottom: 1px solid #ddd;
  14. }
  15. #snackbar {
  16.   visibility: hidden;
  17.   min-width: 250px;
  18.   margin-left: -125px;
  19.   background-color: #FF0000;
  20.   color: #fff;
  21.   text-align: center;
  22.   border-radius: 2px;
  23.   padding: 16px;
  24.   position: fixed;
  25.   z-index: 1;
  26.   left: 50%;
  27.   bottom: 30px;
  28.   font-size: 17px;
  29. }
  30. #snackbar.show {
  31.   visibility: visible;
  32.   -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
  33.   animation: fadein 0.5s, fadeout 0.5s 2.5s;
  34. }
  35. @-webkit-keyframes fadein {
  36.   from {bottom: 0; opacity: 0;} 
  37.   to {bottom: 30px; opacity: 1;}
  38. }
  39. @keyframes fadein {
  40.   from {bottom: 0; opacity: 0;}
  41.   to {bottom: 30px; opacity: 1;}
  42. }
  43. @-webkit-keyframes fadeout {
  44.   from {bottom: 30px; opacity: 1;} 
  45.   to {bottom: 0; opacity: 0;}
  46. }
  47. @keyframes fadeout {
  48.   from {bottom: 30px; opacity: 1;}
  49.   to {bottom: 0; opacity: 0;}
  50. }
  51. input {font-weight:bold;}
  52. </style>
  53. {% endapply %}
  54. <div class="dilevars-page-title d-flex align-items-center  header-layout-2 title-align-center title-color-white">
  55.     <div class="dilevars-page-title-layer container">
  56.         <div class="row">
  57.             <div class="col-md-12">            
  58.                 <h1 class="page-title">
  59.                     Volumetric Weight                </h1>
  60.                                     <div class="page-breadcrumbs">
  61.                     <div class="breadcrumb"><a href="{{path('app_home')}}">Home</a> >  <span class="current">Volumetric Weight</span></div>                    </div>
  62.                                 </div>                
  63.         </div>
  64.     </div>
  65. </div>
  66.     <div id="content" class="site-content"><div class="container">
  67.     <div class="row">
  68.         <div class="col-sm-12">
  69.             <div id="primary" class="content-area">
  70.                 <main id="main" >
  71.                 <article id="post-273" class="row post-273 project type-project status-publish has-post-thumbnail hentry project-category-advices">
  72.     
  73.     <div class="col-md-12">
  74.         <div class="row">
  75.             <div class="col-lg-12">
  76.                 <div class="dilevars-project-content">
  77.                             <div data-elementor-type="wp-post" data-elementor-id="273" class="elementor elementor-273">
  78.                         <div class="elementor-inner">
  79.                 <div class="elementor-section-wrap">
  80.                                     <section class="elementor-section elementor-top-section elementor-element elementor-element-6bad1cee elementor-section-boxed elementor-section-height-default elementor-section-height-default cd-bg-color-transparent" data-id="6bad1cee" data-element_type="section">
  81.                         <div class="elementor-container elementor-column-gap-default">
  82.                             <div class="elementor-row">
  83.                     <div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-37b3068e cd-bg-color-transparent" data-id="37b3068e" data-element_type="column">
  84.             <div class="elementor-column-wrap elementor-element-populated">
  85.                             <div class="elementor-widget-wrap">
  86.                         <div class="elementor-element elementor-element-1e7f45c8 elementor-widget elementor-widget-heading" data-id="1e7f45c8" data-element_type="widget" data-widget_type="heading.default">
  87.                 <div class="elementor-widget-container">
  88.             <h3 class="elementor-heading-title elementor-size-default">Volumetric Weight</h3>        </div>
  89.                 </div>
  90.                         </div>
  91.                     </div>
  92.         </div>
  93.                                 </div>
  94.                     </div>
  95.         </section>
  96.         <hr>
  97.                 <section class="elementor-section elementor-top-section elementor-element elementor-element-10c5160d elementor-section-boxed elementor-section-height-default elementor-section-height-default cd-bg-color-transparent" data-id="10c5160d" data-element_type="section">
  98.                         <div class="elementor-container elementor-column-gap-default">
  99.                             <div class="elementor-row">
  100.                                 
  101.                                 <table style="width: 100%; border: 0px solid; color: #000!important;">
  102.                                     <tr>
  103.                                       <td style="width: 20%; font-weight:bold;">
  104.                                         Height
  105.                                      </td>
  106.                                     <td style="width: 5%; font-weight:bold;">
  107.                                      :
  108.                                    </td>
  109.                                    <td style="width: 50%; ">
  110.                                      <input type="text"  id="height"  class="form-control" placeholder="Height" required style="width:100%; height: 50px; margin-bottom: 0px;">
  111.                                    </td>
  112.                                    <td style="width: 25%; font-weight:bold;">
  113.                                    cm
  114.                                    </td>
  115.                                    </tr>
  116.                                    <tr>
  117.                                   <td style="font-weight:bold;">
  118.                                   Width
  119.                                  </td>
  120.                                  <td style="font-weight:bold;">
  121.                                    :
  122.                                  </td>
  123.                                 <td>
  124.                                  <input type="text"  id="weight"  class="form-control" placeholder="Width" required style="width:100%; height: 50px; margin-bottom: 0px;">
  125.                                 </td>
  126.                                 <td style="font-weight:bold;">
  127.                                 cm
  128.                                 </td>
  129.                                 </tr>
  130.                                  <tr>
  131.                                   <td style="font-weight:bold;">
  132.                                  Length
  133.                                  </td>
  134.                                  <td style="font-weight:bold;">
  135.                                    :
  136.                                  </td>
  137.                                 <td>
  138.                                  <input type="text"  id="length"  class="form-control" placeholder=" Length" required style="width:100%; height: 50px; margin-bottom: 0px;">
  139.                                 </td>
  140.                                 <td style="font-weight:bold;">
  141.                                 cm
  142.                                 </td>
  143.                                 </tr>
  144.                                  <tr>
  145.                                   <td>
  146.                                
  147.                                  </td>
  148.                                  <td>
  149.                                  
  150.                                  </td>
  151.                                 <td style ="text-align:right;">
  152.                                <input type="submit" id="calculate" class="btn btn-primary text-white px-4" onclick="myFunction()" value="CALCULATE">
  153.                                 </td>
  154.                                 <td>
  155.                                 
  156.                                 </td>
  157.                                 </tr>
  158.                                  <tr>
  159.                                   <td style="font-weight:bold;">
  160.                                 Volumetric Weight
  161.                                  </td>
  162.                                  <td style="font-weight:bold;">
  163.                                    :
  164.                                  </td>
  165.                                 <td>
  166.                                  <input type="text"  id="result"  class="form-control" readonly style="width:100%; height: 50px; margin-bottom: 0px;">
  167.                                 </td>
  168.                                 <td style="font-weight:bold;">
  169.                                        kg
  170.                                 </td>
  171.                                 </tr>
  172.                                  <tr>
  173.                                   <td colspan="4">
  174.                                     The volumetric weight is calculated using the formula:<br>
  175.                                     Length x Width x Height in centimeters / 5000 = Volumetric weight in kilograms<br><br>
  176.                                     <img  src="{{asset('/public/theme/dilevars/demo2/wp-content/uploads/sites/6/2020/08/vw.jpg')}}" />
  177.                 
  178.                                  </td>
  179.                                 
  180.                                 </tr>
  181.                                 </table>
  182.                                 </div>
  183.                     </div>
  184.         </section>
  185.                 
  186.                 
  187.         <div id="snackbar"></div>
  188.                                     </div>
  189.             </div>
  190.                     </div>
  191.                         </div>
  192.             </div>
  193.         </div>
  194.     </div>
  195. </article><!-- #post-273 -->
  196.         
  197. </main><!-- #main -->
  198.             </div><!-- #primary -->
  199.         </div>
  200.     </div>
  201. </div>
  202.     </div><!-- #content -->
  203. <script>
  204. function myFunction() {
  205.   if(document.getElementById("height").value  === '' || isNaN(document.getElementById("height").value))
  206.     {
  207.     document.getElementById("snackbar").innerHTML = "Please Enter Numeric Height Values";
  208.         var x = document.getElementById("snackbar");
  209.         x.className = "show";
  210.         setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
  211.         document.getElementById("height").focus();
  212.         
  213.     }
  214.   else if(document.getElementById("weight").value  === '' || isNaN(document.getElementById("weight").value))
  215.     {
  216.     document.getElementById("snackbar").innerHTML = "Please Enter Numeric Width Values";
  217.         var y = document.getElementById("snackbar");
  218.         y.className = "show";
  219.         setTimeout(function(){ y.className = y.className.replace("show", ""); }, 3000);
  220.         document.getElementById("weight").focus();
  221.         
  222.     }
  223.   else if(document.getElementById("length").value  === '' || isNaN(document.getElementById("length").value))
  224.     {
  225.     document.getElementById("snackbar").innerHTML= "Please Enter Numeric Length Values";
  226.         var z = document.getElementById("snackbar");
  227.         z.className = "show";
  228.         setTimeout(function(){ z.className = z.className.replace("show", ""); }, 3000);
  229.         document.getElementById("length").focus();
  230.         
  231.     }
  232.   else
  233.   {
  234.       var height = document.getElementById("height").value;
  235.       var weight = document.getElementById("weight").value;
  236.       var length = document.getElementById("length").value;
  237.       document.getElementById("result").value = (height * weight * length)/5000;
  238.   }
  239. }
  240. </script>
  241. {% endblock %}