1
0
mirror of https://github.com/restoreddev/phpapprentice.git synced 2025-08-02 21:07:43 +02:00

Merge pull request #30 from restoreddev/develop

Fixed style for IE, added arrow navigation and tweaked writer's credit
This commit is contained in:
Andrew
2019-01-11 19:41:53 -06:00
committed by GitHub
5 changed files with 26 additions and 15 deletions

View File

@@ -185,6 +185,7 @@ button:hover .icon svg {
} }
.icon { .icon {
width: 1em; width: 1em;
height: 1.25em;
display: inline-block; display: inline-block;
} }
.home-title { .home-title {

View File

@@ -41,18 +41,26 @@ var onLoad = function () {
document.onkeydown = function (e) { document.onkeydown = function (e) {
e = e || window.event; e = e || window.event;
var isEscape = false; switch (e.key) {
if ("key" in e) { case 'Esc':
isEscape = (e.key == "Escape" || e.key == "Esc"); case 'Escape':
} else { var modal = document.querySelector('.modal');
isEscape = (e.keyCode == 27); if (modal && !modal.classList.contains('closed')) {
} modal.classList.add('closed');
}
if (isEscape) { break;
var modal = document.querySelector('.modal'); case 'ArrowRight':
if (modal && !modal.classList.contains('closed')) { var link = document.querySelector('#next-link');
modal.classList.add('closed'); if (link) {
} window.location.href = link.href;
}
break;
case 'ArrowLeft':
var link = document.querySelector('#prev-link');
if (link) {
window.location.href = link.href;
}
break;
} }
}; };

View File

@@ -31,7 +31,7 @@
</p> </p>
<hr /> <hr />
<p> <p>
phpapprentice.com was created and is managed by <a href="https://twitter.com/restoreddev">Andrew Davis</a>. Created and managed by <a href="https://twitter.com/restoreddev" target="_blank">Andrew Davis @restoreddev</a>.
</p> </p>
</div> </div>
</div> </div>

View File

@@ -10,13 +10,13 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="navigate-links"> <div class="navigate-links">
<?php if (!empty($previous)): ?> <?php if (!empty($previous)): ?>
<a href="<?= page_path($previous) ?>" title="Previous"> <a href="<?= page_path($previous) ?>" title="Previous" id="prev-link">
<div class="icon"><?= icon('cheveron-outline-left') ?></div> <div class="icon"><?= icon('cheveron-outline-left') ?></div>
Previous Previous
</a> </a>
<?php endif ?> <?php endif ?>
<?php if (!empty($next)): ?> <?php if (!empty($next)): ?>
<a href="<?= page_path($next) ?>" title="Next"> <a href="<?= page_path($next) ?>" title="Next" id="next-link">
Next Next
<div class="icon"><?= icon('cheveron-outline-right') ?></div> <div class="icon"><?= icon('cheveron-outline-right') ?></div>
</a> </a>

View File

@@ -26,6 +26,8 @@
</a> </a>
<?php partial('menu_button') ?> <?php partial('menu_button') ?>
</div> </div>
<hr />
<p>Created and managed by <a href="https://twitter.com/restoreddev" target="_blank">Andrew Davis @restoreddev</a>
</div> </div>
</div> </div>