diff options
author | Derek Severin <severinderek@gmail.com> | 2021-11-21 11:51:30 +0300 |
---|---|---|
committer | Derek Severin <severinderek@gmail.com> | 2021-11-21 11:51:30 +0300 |
commit | 5fea815bab2add2ec77f91db12d6d592ebca0b0f (patch) | |
tree | adf55ec2adb34f2cd5acc8feee6dd9cf3bcf00e1 | |
parent | 10540ebd55c28f8a660fbc8ac70de494cb2f1889 (diff) |
'page-jump' links + image no context menu
-rw-r--r-- | layouts/partials/sections/about.html | 4 | ||||
-rw-r--r-- | static/css/theme.css | 11 | ||||
-rw-r--r-- | static/js/theme.js | 11 |
3 files changed, 18 insertions, 8 deletions
diff --git a/layouts/partials/sections/about.html b/layouts/partials/sections/about.html index 47014bb..de8b08f 100644 --- a/layouts/partials/sections/about.html +++ b/layouts/partials/sections/about.html @@ -78,11 +78,11 @@ {{ end }} <div class="profile"> {{ if .avatar }} - {{/* 2-REC: Special "hover easter egg hack" */}} + {{/* 2-REC: Special "hover easter egg" */}} {{ if .avatar2 }} <div class="portrait" style="position:relative; overflow: hidden;"> <img id="avatar1" src="{{ printf "images/%s" .avatar }}"> - <img id="avatar2" src="{{ printf "images/%s" .avatar2 }}"> + <img id="avatar2" src="{{ printf "images/%s" .avatar2 }}" oncontextmenu="return false;"> </div> {{ else }} <img class="portrait" src="{{ printf "/images/%s" .avatar}}"> diff --git a/static/css/theme.css b/static/css/theme.css index 4f4ab48..8af0f5a 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -11,13 +11,13 @@ /* GENERAL - HTML TAGS */ html { - width: 100%; - height: 100%; + width: 100vw; + height: 100vh; } body { - width: 100%; - height: 100%; + width: 100vw; + height: 100vh; font-family: var(--GENERAL-FONT, var(--GENERAL-FONT-1)); } @@ -980,7 +980,6 @@ background-size: cover; #about .portrait { border-radius: var(--about-image-border-radius); border: var(--about-image-border); -//border: 1px solid; //background-color: rgb(64,64,64); position: relative; @@ -1005,7 +1004,7 @@ background-size: cover; #avatar1 { /* 2-REC: setting position here causes problems with height */ - //position: absolute; + /*position: absolute;*/ top:0; left:0; diff --git a/static/js/theme.js b/static/js/theme.js index 9131c0e..18cfaae 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -18,6 +18,17 @@ event.preventDefault(); } }); + /* 2-REC - TODO: don't use 'animate' */ + $('a.page-jump').bind('click', function(event) { + var $anchor = $(this); + var $offset = $($anchor.attr('href')).offset(); + if ($offset) { + $('html, body').stop().animate({ + scrollTop: $offset.top - $('.navbar-header').height() + }, 0, 'easeInOutExpo'); + event.preventDefault(); + } + }); // Highlight the top nav as scrolling occurs $('body').scrollspy({ |