‏إظهار الرسائل ذات التسميات how-to. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات how-to. إظهار كافة الرسائل

يستخدم العد التنازلي في مواقع الويب في العروض التقديمية مثل تخفيضات رأس السنة ويستخدم بكثرة في تخفيضات الاستضافات وخاصة العروض التقديمية الخاصة بالمنتجات كما يمكننا استخدامه في اي مجال في الويب حسب الحاجة اليه

مثال حي

{{ displaydays }}
الايام
{{ displayhours }}
الساعات
{{ displayminutes }}
الدقائق
{{ displayseconds }}
الثواني
انتهى الوقت


الكود كامل للمثال في الاعلى مع الشرح داخل الكود



<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" /> 
<!--   خاصية التجاوب مع جميع الاجهزة  --> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<!-- استدعاء مكتبة الخطوط من جوجل -->
<link href="https://fonts.googleapis.com/css2?family=Lemonada:wght@300&display=swap" rel="stylesheet">
<!-- استدعاء مكتبة فيو الإصدار الثالث -->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>

<!--html countdown html-->  
<div id="roninge"> 
      <div class="container"> 
    
            <div  class=" section">
              <!--html تظهار الوقت بالعد التنازلي html-->  
              <div v-if="showtimer" class="countdown-cont">
                <div class="countdown-block">
                <!-- عرض متغير الأيام -->
                  <div class="countdown-digit">{{ displaydays }}</div>
                  <div class="countdown-label">الايام</div>
                </div>
                <div class="countdown-block">
                  <div data-js="countdown-hour" class="countdown-digit">
                  <!--عرض متغير الساعات -->
                    {{ displayhours }}
                  </div>
                  <div class="countdown-label"> الساعات</div>
                </div> 
                <div class="countdown-block">
                <!-- عرض متغير الدقائق -->
                  <div class="countdown-digit">{{ displayminutes }}</div>
                  <div class="countdown-label"> الدقائق</div>
                </div>
                <div class="countdown-block">
                <!-- عرض متغير الثواني -->
                  <div class="countdown-digit">{{ displayseconds }}</div>
                  <div class="countdown-label">الثواني</div>
                </div>
              </div>
              <!--html اظهار رسالة الوقت انتهى html-->  
              <h1 v-if="expired" class="countdown-endtext">
               انتهى الوقت
              </h1>
            </div> 
          </div>
  </div>
<!--script javascript script-->  
<script>
  const Counter = {  
  data() {
    return { 
    //اعلان المتغيرات التي ستحمل قيمة الاوقات
      expired: false,
      showtimer: false,
      displaydays: 0,
      displayhours: 0,
      displayminutes: 0,
      displayseconds: 0,
    };
  },
  mounted() {
// تشغييل دالة اظهار العد التنازلي
    this.showroninge();
  },
  methods: {   
//اضافة رقم صفر اذا كان الرقم فردي
    shack: function(num) {
      return num < 10 ? "0" + num : num;
    },

//دالة اظهار العد التنازلي
    showroninge: function() {
    
// تحديث العد التنازلي كل ثانية
    const timer = setInterval(() => {
        
// الحصول على الوقت منذ بدايته سنة 1970 الى يومنا بالملي ثانية
    const now = new Date().getTime();
        
// حدد التاريخ الذي نقوم بالعد التنازلي إليه 
   const end = new Date("2024-03-11").getTime();
        
// ابحث عن المسافة بين الآن وتاريخ العد التنازلي        
   const distance = end - now;
// إذا انتهى العد التنازلي ،  أوقف المؤقت واطبع رسالة انتهى الوقت      
    if (distance < 0) {
          clearInterval(timer);
          this.expired = true;
          this.showtimer = false;
          return;
        }

// حسابات الوقت للأيام والساعات والدقائق والثواني
    const days = Math.floor(distance / 864e5);
    const hours = Math.floor((distance % 864e5) / 36e5);
    const minutes = Math.floor((distance % 36e5) / 6e4);
    const seconds = Math.floor((distance % 6e4) / 1e3); 
      
 // ارسال القيم الى متغيرات الداتة وعرضها في المتصفح
    this.displayminutes = this.shack(minutes);
    this.displayseconds = this.shack(seconds);
    this.displayhours   = this.shack(hours);
    this.displaydays    = this.shack(days);
//اخفاء نص انتهى الوقت 
    this.expired        = false;
//اضهار بلوك الوقت 
    this.showtimer      = true;
      }, 1000);
    },
  },
 }
Vue.createApp(Counter).mount('#roninge');
</script>  
 <!--style css style-->
<style>
*{
   padding:0px;
   margin:0px;
   box-sizing:border-box;
   }
body{ 
 font-family: 'Lemonada', cursive; 
} 
.countdown-cont {
    display: grid;
    grid-template-columns: repeat(4 , 1fr);
    gap: 15px;
    text-align: center;
    max-width: 660px; 
    z-index:1;
    margin:auto;
    position:relative ;
  
}
.countdown-digit {
    font-size: xxx-large;
    background: #282c3473;
    border-radius: 6px;
    color: azure;
    margin-bottom: 5px;
    padding: 25px 10px;
    font-weight: bolder;
}
.countdown-label {    
    color:#fff;
}
.section{
  margin:3em 1.5em;
}
.container{ 
 background: linear-gradient(320deg, #42b983, #5077a0);
 padding: 25px 0px
    
}
.container img{
   width:100% ;
   height:auto;
}
@media (max-width:460px){
  .countdown-digit {
    font-size: x-large;  
    margin-bottom: 5px;
    padding: 15px 5px;
}
.section{
    margin:1em 1em;
}
}
</style>
</body>
</html> 

كيفية تكبير الصورة  How To Create an Image Zoom 

تعلم كيفية إنشاء تكبير الصورة.

 تكبير الصورة

 مرر الماوس فوق الصورة لتكبيرها:

الكود كامل والشرح في الفيديو اسفل

<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<body dir='rtl'>
<!--html-->
<div class="image-wrap">
    <div class="image">
       <img src="https://i.ibb.co/3mLyp3f/oranges.jpg">
    </div>
    <div class="image">
     <img src="https://i.ibb.co/3mLyp3f/oranges.jpg">
  </div>
</div>
<!--css-->
 <style>
   *{margin:0px; padding:px; box-sizing:border-box;}
   img{width:100%; height:auto;}
   .image-wrap{
     display:grid;
     grid-template-columns:repeat(2,1fr);
     gap:15px;
   }
   @media (max-width:460px){
     .image-wrap{ 
         grid-template-columns:repeat(1,1fr); 
     }
   }
   .image{
      width  :100%; 
      height :100%;
      background-size:100%;
      background-repeat:no-repeat;
      background-position:center; 
   
   }
   .image:hover{
      background-size:300%; 
   }
 </style>
 <!--script-->
 <script>
   const images = document.querySelectorAll(".image img"); 
   images.forEach((image)=>{
     const bgimg = image.src ;
     const parentimage = image.parentElement ;
     image.addEventListener("mousemove",(e) => {
          image.style.opacity = 0 ;
          parentimage.style.backgroundImage = "url('"+bgimg+"')";
          
          let width  = image.offsetWidth ;
          let height = image.offsetHeight ;
          let mouseX = e.offsetX ;
          let mouseY = e.offsetY ;
          let bgPosX = (mouseX / width * 100);
          let bgPosY = (mouseY / height * 100);
       
    parentimage.style.backgroundPosition = `${bgPosX}% ${bgPosY}%`;
           
});  
     
     
   });
 </script>
</body> 
</html>

مشاهدة الشرح بدون صوت

تخطيط الشبكة Grid Layout
توفر CSS Grid Layout Module نظام تخطيط قائم على الشبكة ، مع صفوف وأعمدة ، مما يسهل تصميم صفحات الويب دون الحاجة إلى استخدام  floats و positioning.
مثال عملي للتخطيط بالGrid 
الكود الكامل 

 
<!DOCTYPE html>
<html>
<head>
  <base href="https://test-app-host.web.app/img/">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/boxicons@latest/css/boxicons.min.css" /> 
  <link href="https://fonts.googleapis.com/css2?family=Almarai:wght@300&family=Cairo:wght@200&display=swap" rel="stylesheet">  
   <style>
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0; 
}
 body, button, div, html, input, label, p, select, span, textarea {
    
   font-family: 'Almarai', sans-serif;
   font-family: 'Cairo', sans-serif;
}
a {
    color: #2c3e50;
   text-decoration:none;
} 
ol, ul {
    padding: 0;
    margin: 0;
}
ul {
    list-style: none;
}
html, img {
    max-width: 100%;
}
span {
    font-style: inherit;
    font-weight: inherit;
}
img {
    height: auto;
    max-width: 100%;
}   
 .container{
     
    width: 100%;
    flex-grow: 1;
    margin: 0 auto;
    position: relative;
    width: auto;
     }
 
.product-center {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 15px;
    
}    
 .product {
    height: auto;
    background-color: #fff;
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 15%);
    border-radius: 5px;
    transition: all .3s ease-in-out;
    padding: 0!important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}  
 .product:hover{
    box-shadow:0 .5rem 1.5rem rgba(0,0,0,.25)
  }
 .product:hover .product-header:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    border-radius: 1rem 1rem 0 0;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all 0.5s ease-in-out;
    z-index: 1;
}     
 .product-header {
    position: relative;
    background-color: #f6f2f1;
    transition: all .3s ease-in-out;
    z-index: 0;
}
 .product-header img {
    width: 100%;
    height: auto;
 
}     
 .product-footer {
    padding: 10px;
   line-height:1.8rem;
}   
 .nav, .nav-b {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
}    
 .section {
    padding: 3rem 1.5rem;
}    
 .product:hover .icons {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}
 .product-header .icons {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%) scale(0);
    z-index: 2;
    opacity: 0;
    transition: all .5s ease-in-out;
}
 .product-header .icons span {
    background-color: #fff;
    color:#799;
    font-size: 1.7rem;
    display: block;
    border-radius:  50%  ; 
    padding: 0.8rem 0.8rem; 
    cursor: pointer;
    transition: all .3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}
 .product-header .icons span:not(:last-child) {
    margin-bottom: 1rem;
}
 .product-header .icons span:hover {
    background-color: #ff7d9d;
    color: #fff;
}    
 .product-header .icons span i {
    transition: all 500ms ease-in-out;
}
 .product-header .icons a {
    display: block;
    margin-bottom: 1rem;
}
 .rating {
    color: #ffc107;
    font-size:18px;
}
 .tag:not(body).is-danger {
    background-color: #f14668;
    color: #fff;
    padding-left: 0.75em;
    padding-right: 0.75em;
    border-radius:3px;
      font-size: 12px;
}
  
@media screen and (min-width: 1408px){
.container:not(.is-max-desktop):not(.is-max-widescreen) {
    max-width: 1344px;
}  }    
@media screen and (min-width: 1216px){
     .container:not(.is-max-desktop) {
    max-width: 1152px;
}
     }
@media only screen and (min-width: 1200px){
.container {
    max-width: 1170px;
}}
@media screen and (min-width: 1024px){
.container {
    max-width: 960px;
}}     
@media (max-width: 850px){
     .product-center {
    grid-template-columns: repeat(3,1fr);
} 
}
@media (max-width: 640px){
.product-center {
    grid-template-columns: repeat(2,1fr);
}
.product-header .icons span {
    background-color: #fff;
    color:#799;
    font-size: 1.3rem;     
}
.product-header .icons span:not(:last-child) {
    margin-bottom: 0.5rem;
}     
}
@media (max-width: 370px){
.product-center {
    grid-template-columns: repeat(1,1fr)!important;
}}


   </style>

</head>
<body dir='rtl'>
<div class="container"> 
<div class="section">
   
<div class="product-center">
  
   <div class="product"> 
     <div class="product-header"> 
        <img src="product-1.ede54a5b.jpg" alt=""> 
        <ul class="icons">
             <span><i class="bx bx-heart"></i></span>
           <span><i class="bx bx-shopping-bag"></i></span>
           <span><i class="bx bx-search"></i></span>
       </ul>
     </div>
     <div class="product-footer"> 
        <a href="#"><h3>لحم طازج بقري</h3></a>
        <div class="nav">
      <div class="rating">
          <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bx-star"></i>
     </div>  
      <div>( 65 )</div>
   </div>
        <div class="nav">
      <h4 class="price">$50</h4>
      <h4 class="tag is-danger">sall 20% </h4>
   </div> 
   </div>
</div>
   <div class="product"> 
     <div class="product-header"> 
        <img src="product-4.6fe66382.jpg" alt=""> 
       <ul class="icons">
           <span><i class="bx bx-heart"></i></span>
           <span><i class="bx bx-shopping-bag"></i></span>
           <span><i class="bx bx-search"></i></span>
       </ul>
    </div>
     <div class="product-footer"> 
        <a href="#"><h3>عنب طازج</h3></a>
      <div class="nav">
      <div class="rating">
          <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bx-star"></i>
     </div>   
      <div>( 65 )</div>
   </div>
      <div class="nav">
        <h4 class="price">$50</h4>
        <h4 class="tag is-danger">sall 20% </h4>
     </div> 
   </div>
</div> 
   <div class="product"> 
     <div class="product-header"> 
        <img src="product-2.eebc4b18.jpg" alt=""> 
          <ul class="icons">
           <span><i class="bx bx-heart"></i></span>
           <span><i class="bx bx-shopping-bag"></i></span>
           <span><i class="bx bx-search"></i></span>
       </ul>
    </div>
     <div class="product-footer"> 
        <a href="#"><h3>عنب طازج</h3></a>
      <div class="nav">
      <div class="rating">
          <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bx-star"></i>
     </div>  
      <div>( 65 )</div>
   </div>
      <div class="nav">
        <h4 class="price">$50</h4>
        <h4 class="tag is-danger">sall 20% </h4>
     </div> 
   </div>
</div> 
   <div class="product"> 
     <div class="product-header"> 
        <img src="product-3.ff13436e.jpg" alt=""> 
          <ul class="icons">
           <span><i class="bx bx-heart"></i></span>
           <span><i class="bx bx-shopping-bag"></i></span>
           <span><i class="bx bx-search"></i></span>
       </ul>
    </div>
     <div class="product-footer"> 
        <a href="#"><h3>عنب طازج</h3></a>
      <div class="nav">
      <div class="rating">
          <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bxs-star"></i>
         <i class="bx bx-star"></i>
     </div>   
      <div>( 65 )</div>
   </div>
      <div class="nav">
        <h4 class="price">$50</h4>
        <h4 class="tag is-danger">sall 20% </h4>
     </div> 
   </div>
</div> 
     
</div>
</div>  
</div> 
</body>
</html>