Skip to content

Instantly share code, notes, and snippets.

@mehedithedue
Last active January 19, 2020 09:46
Show Gist options
  • Save mehedithedue/48b939ada87752cfe42cf68ed42bbf55 to your computer and use it in GitHub Desktop.
Save mehedithedue/48b939ada87752cfe42cf68ed42bbf55 to your computer and use it in GitHub Desktop.
This is a mujib borsho countdown timer
(function () {document.write('<style>@font-face{font-family: "SolaimanLipi";url("https://www.omicronlab.com/download/fonts/SolaimanLipi_20-04-07.ttf") format("truetype"), font-weight: normal; font-style: normal}@media only screen and (min-width: 992px){.mujib_borsho_slogan{margin: 4.5% 0 0 0; font-size: 22px; line-height: 1.1; color: #46600c; text-align: right}small.time-title{font-size: 12px; color: #46600c}#mujib_borsho_countdown_days, #mujib_borsho_countdown_hours, #mujib_borsho_countdown_minutes, #mujib_borsho_countdown_seconds{font-family: SolaimanLipi, sans-serif !important; color: #115214; font-size: 30px}#mujib_borsho_bat ul#mujib_borsho_list li{padding: 1px !important}}@media only screen and (max-width: 480px){.mujib_borsho_slogan{font-size: 16px; color: #3f6d05}}@media only screen and (max-width: 600px){.mujib_borsho_slogan{font-size: 17px; color: #3f6d05}.mujib_borsho_slogan #slogan_arrow{display: none}ul#mujib_borsho_list li{padding: 0}#mujib_borsho_countdown_days, #mujib_borsho_countdown_hours, #mujib_borsho_countdown_minutes, #mujib_borsho_countdown_seconds{font-family: SolaimanLipi, sans-serif !important; color: #115214; font-size: 20px}small.time-title{font-size: 10px; color: #46600c}}</style> <div id="mujib_borsho_bat" class="row"><a href="http://mujib100.gov.bd/" target="_blank"><div class="col-md-12"><div class="panel panel-default" style="border:none;"><div class="panel-body col-md-12" style=" background: rgba(242, 242, 206, 0.5);"><div id="mujib_borsho_slogan_area" class="col-md-5 col-sm-12 col-xs-12 col-md-offset-1" style="padding:0px;"><h4 class="mujib_borsho_slogan"> জাতির পিতার জন্মশতবার্ষিকীর ক্ষণগণনা <i id="slogan_arrow" class="fa fa-chevron-right" aria-hidden="true"></i></h4></div><div class="col-md-4" id="mujib_borsho_countdown_area"><ul class="list-inline box" id="mujib_borsho_list"><li class="text-center"><div style="height: 60px;"><div class="time-bg"><label style="margin-bottom: 0px;" id="mujib_borsho_countdown_days">0</label><strong> : </strong></div><small class="time-title">দিন</small><div style="clear: both"></div></div></li><li class="text-center"><div class="time-bg"><label style="margin-bottom: 0px;" id="mujib_borsho_countdown_hours">0</label><strong> : </strong></div><small class="time-title">ঘন্টা</small><div style="clear: both"></div></li><li class="text-center"><div class="time-bg"><label style="margin-bottom: 0px;" id="mujib_borsho_countdown_minutes">0</label><strong> : </strong></div><small class="time-title"> মিনিট</small></li><li class="text-center" style="width: 7%;"><div class="time-bg"><label style="margin-bottom: 0px;" id="mujib_borsho_countdown_seconds">0</label></div><small class="time-title">সেকেন্ড</small></li><li class="text-center" style="width: 30%"><img style="height:65px;width:auto !important;margin-left: 20px;" class="img-responsive" src="http://www.mujib100.gov.bd/assets/images/logo.png" alt=""></li></ul></div></div></div></div></a></div>');var countDownDate=new Date("2020, 03, 17, 00:00:00").getTime(); var divWidth=document.getElementById("mujib_borsho_bat").offsetWidth; if (divWidth < 450){var mujib_borsho_slogan_area=document.getElementById("mujib_borsho_slogan_area"); mujib_borsho_slogan_area.classList.remove("col-md-5"); mujib_borsho_slogan_area.classList.remove("col-md-offset-1"); mujib_borsho_slogan_area.classList.add("col-md-12"); mujib_borsho_slogan_area.style.fontSize='18px'; mujib_borsho_slogan_area.style.textAlign='left'; document.getElementById("slogan_arrow").style.display='none'; var mujib_borsho_countdown_area=document.getElementById("mujib_borsho_countdown_area"); mujib_borsho_countdown_area.classList.remove("col-md-4"); mujib_borsho_countdown_area.classList.add("col-md-12");}var bangla_number=['০০', '০১', '০২', '০৩', '০৪', '০৫', '০৬', '০৭', '০৮', '০৯', '১০', '১১', '১২', '১৩', '১৪', '১৫', '১৬', '১৭', '১৮', '১৯', '২০', '২১', '২২', '২৩', '২৪', '২৫', '২৬', '২৭', '২৮', '২৯', '৩০', '৩১', '৩২', '৩৩', '৩৪', '৩৫', '৩৬', '৩৭', '৩৮', '৩৯', '৪০', '৪১', '৪২', '৪৩', '৪৪', '৪৫', '৪৬', '৪৭', '৪৮', '৪৯', '৫০', '৫১', '৫২', '৫৩', '৫৪', '৫৫', '৫৬', '৫৭', '৫৮', '৫৯', '৬০', '৬১', '৬২', '৬৩', '৬৪', '৬৫', '৬৬', '৬৭', '৬৮', '৬৯', '৭০', '৭১', '৭২', '৭৩', '৭৪', '৭৫', '৭৬', '৭৭', '৭৮', '৭৯', '৮০', '৮১', '৮২', '৮৩', '৮৪', '৮৫', '৮৬', '৮৭', '৮৮', '৮৯', '৯০']; if ((countDownDate - new Date().getTime()) > 0){var x=setInterval(function (){var now=new Date().getTime(); var distance=countDownDate - now; var days=Math.floor(distance / (1000 * 60 * 60 * 24)); var hours=Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes=Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds=Math.floor((distance % (1000 * 60)) / 1000); document.getElementById('mujib_borsho_countdown_days').innerHTML=bangla_number[days]; document.getElementById('mujib_borsho_countdown_hours').innerHTML=bangla_number[hours]; document.getElementById('mujib_borsho_countdown_minutes').innerHTML=bangla_number[minutes]; document.getElementById('mujib_borsho_countdown_seconds').innerHTML=bangla_number[seconds];}, 1000);}else{document.getElementById('mujib_borsho_bat').remove();}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment