Skip to content

Commit

Permalink
Added and update fixed notificationbar (#79)
Browse files Browse the repository at this point in the history
Signed-off-by: Mohin Uddin <mohin@appscode.com>
  • Loading branch information
mohin7 authored Apr 29, 2021
1 parent 4c4b105 commit 774c610
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 48 deletions.
95 changes: 48 additions & 47 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,58 +81,59 @@
</p>
<![endif]-->

<!-- notification start -->
<div onclick="goToWebinarPage()" class="notification-area notification is-primary" id="notification-area" style="display:none">
<div class="container section">
<div class="notification-inner is-flex is-align-items-center is-justify-content-center">
<p>Join our upcoming webinar! Get your seat right now! <a href="/webinar/">Click</a> to register.</p>
</div>
</div>
<button class="delete" onclick="event.stopPropagation(); closeItem('#notification-area')"></button>
</div>

<script type="text/javascript">
// close action start
function closeItem(item) {
const selcetedItem = document.querySelector(item)
selcetedItem.style.display = 'none'
}
// close action end

// redirect to webinar pagte
function goToWebinarPage() {
window.open("/webinar/", "_blank");
}

(function () {
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
var result = JSON.parse(xhr.responseText);
if (result.schedules) {
let endDate = new Date(result.schedules[0]).getTime();
let startDate = new Date().getTime();
let timeRemaining = parseInt((endDate - startDate) / 1000);
if (timeRemaining >= 0) {
document.querySelector('#notification-area').style.display = 'block';
}
}
}
}
}
// console.log('GET', 'https://license-issuer.appscode.com/_/webinars/');
xhr.open('GET', 'https://license-issuer.appscode.com/_/webinars/');
xhr.send();
}());
</script>
<!-- notification end -->
<!-- header area start -->
{{ block "header" . }}
<header>
{{ block "header-top" . }}
<!-- header top start -->
<div class="header-top {{if not .Params.product_name}}fixed-menu{{else}}fixed-menu-z-index{{end}}">
<!-- notification start -->
<div onclick="goToWebinarPage()" class="notification-area notification is-primary" id="notification-area"
style="display:none">
<div class="container section">
<div class="notification-inner is-flex is-align-items-center is-justify-content-center">
<p>Join our upcoming webinar! Get your seat right now! <a href="/webinar/">Click</a> to register.</p>
</div>
</div>
<button class="delete" onclick="event.stopPropagation(); closeItem('#notification-area')"></button>
</div>
<script type="text/javascript">
// close action start
function closeItem(item) {
const selcetedItem = document.querySelector(item)
selcetedItem.style.display = 'none'
}
// close action end

// redirect to webinar pagte
function goToWebinarPage() {
window.open("/webinar/", "_blank");
}

(function () {
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
var result = JSON.parse(xhr.responseText);
if (result.schedules) {
let endDate = new Date(result.schedules[0]).getTime();
let startDate = new Date().getTime();
let timeRemaining = parseInt((endDate - startDate) / 1000);
if (timeRemaining >= 0) {
document.querySelector('#notification-area').style.display = 'block';
}
}
}
}
}
// console.log('GET', 'https://license-issuer.appscode.com/_/webinars/');
xhr.open('GET', 'https://license-issuer.appscode.com/_/webinars/');
xhr.send();
}());
</script>
<!-- notification end -->
<!-- notification end -->
<div class="container section">
<nav class="navbar">
<div class="navbar-brand">
Expand Down Expand Up @@ -764,4 +765,4 @@ <h4>Legal</h4>
<!--End of Tawk.to Script-->
</body>

</html>
</html>
1 change: 1 addition & 0 deletions static/assets/sass/base/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ video:focus {
padding: 0;
border-radius: 0;
margin-bottom: 0;
margin-top: -6px;
.delete {
right: 15px;
top: 11px;
Expand Down
1 change: 1 addition & 0 deletions static/assets/sass/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/assets/sass/main.css.map

Large diffs are not rendered by default.

0 comments on commit 774c610

Please sign in to comment.