Skip to content

Commit

Permalink
Update demo to use bootstrap v4
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Pinto committed Apr 14, 2020
1 parent 9d5a029 commit 88a7b32
Show file tree
Hide file tree
Showing 6 changed files with 555 additions and 473 deletions.
1 change: 1 addition & 0 deletions ads.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
google.com, pub-2338199678296542, DIRECT, f08c47fec0942fa0
78 changes: 39 additions & 39 deletions app/main.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
$(document)
.ready(function () {
var hashTimer;
var iconPrefix = '.glyphicon-';
// var hashTimer;
var iconPrefix = '.fa-';
var t8 = window.toastr8;

_checkAds();
/* smooth scrolling sections */
$('#navbar-collapsible li')
.on('activate.bs.scrollspy', _scrollspy)
.find('a[href*="#"]:not([href="#"])')
.click(_hrefClick);
// $('#navbar-collapsible li')
// .on('activate.bs.scrollspy', _scrollspy)
// .find('a[href*="#"]:not([href="#"])')
// .click(_hrefClick);

$(iconPrefix + 'cloud').click(ajaxDemo);
$(iconPrefix + 'comment').click(alertDemo);
$(iconPrefix + 'ok').click(confirmDemo);
$(iconPrefix + 'pencil').click(promptDemo);
$(iconPrefix + 'screenshot').click(iframeDemo);
$(iconPrefix + 'check').click(confirmDemo);
$(iconPrefix + 'pencil-alt').click(promptDemo);
$(iconPrefix + 'internet-explorer').click(iframeDemo);
///////////////////* Implementation *///////////////////

// Demos
Expand All @@ -42,7 +42,7 @@ $(document)

return eModal
.alert('You welcome! Want clean code?', title)
.then(function () { t8.facebook('Alert modal is visible.', title); });
.then(function () { t8.info('Alert modal is visible.', title); });
}

function confirmDemo() {
Expand All @@ -52,7 +52,7 @@ $(document)
.confirm('It is simple enough?', 'Confirm modal')
.then(
function (/* DOM */) { t8.success('Thank you for your OK pressed!', title); },
function (/*null*/) { t8.skype('Thank you for your Cancel pressed!', title) }
function (/*null*/) { t8.warning('Thank you for your Cancel pressed!', title) }
);
}

Expand All @@ -70,37 +70,37 @@ $(document)
return eModal
.prompt({ size: eModal.size.sm, message: 'What\'s your name?', title: title })
.then(
function (input) { t8.github({ message: 'Hi ' + input + '!', title: title, imgURI: 'https://avatars0.githubusercontent.com/u/4276775?v=3&s=89' }) },
function (/**/) { t8.android('Why don\'t you tell me your name?', title); });
function (input) { t8.success({ message: 'Hi ' + input + '!', title: title, imgURI: 'https://avatars0.githubusercontent.com/u/4276775?v=3&s=89' }) },
function (/**/) { t8.error('Why don\'t you tell me your name?', title); });
}

//#region Page Events
function _hrefClick(e) {
e.preventDefault();
var hash = this.hash;

if (hash !== location.hash) {
var query = '#main';
var scroll = $(this.hash).offset().top - 50 + $(query).scrollTop();

$(query)
.stop()
.animate({ scrollTop: scroll }, 1000);
}
}

function _scrollspy() {
var el = this;
clearTimeout(hashTimer);

hashTimer = setTimeout(function () {
var hash = $(el).find('a').get(0).hash;
var $el = $(hash).prop('id', '');

window.location.hash = hash;
$el.prop('id', hash.slice(1));
}, 400);
}
// function _hrefClick(e) {
// e.preventDefault();
// var hash = this.hash;

// if (hash !== location.hash) {
// var query = '#main';
// var scroll = $(this.hash).offset().top - 50 + $(query).scrollTop();

// $(query)
// .stop()
// .animate({ scrollTop: scroll }, 1000);
// }
// }

// function _scrollspy() {
// var el = this;
// clearTimeout(hashTimer);

// hashTimer = setTimeout(function () {
// var hash = $(el).find('a').get(0).hash;
// var $el = $(hash).prop('id', '');

// window.location.hash = hash;
// $el.prop('id', hash.slice(1));
// }, 400);
// }

function _checkAds() {
setTimeout(function () {
Expand Down
2 changes: 1 addition & 1 deletion app/main.min.js

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

19 changes: 12 additions & 7 deletions content/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ html, body {
position: relative;
}

.modal-header {
display: flex;
}

.github-button {
display: flex;
position: absolute;
right: 30px;
border: 1px solid;
Expand All @@ -35,17 +40,17 @@ html, body {
background-color: #fff;
}

.glyphicon.pointer {
.pointer {
color: #dd4814;
}

.glyphicon.pointer:hover {
color: #ae3910;
}
.pointer:hover {
color: #ae3910;
}

#main > section.container-fluid {
padding-top: 50px;
padding-bottom: 50px;
padding-top: 100px;
padding-bottom: 75px;
min-height: calc(100% - 1px);
}

Expand Down Expand Up @@ -112,7 +117,7 @@ footer {
position: absolute;
left: 0;
right: 0;
top: 51px;
top: 0px;
bottom: 0;
overflow-x: hidden;
overflow-y: auto;
Expand Down
2 changes: 1 addition & 1 deletion content/css/styles.min.css

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

Loading

0 comments on commit 88a7b32

Please sign in to comment.