mirror of
https://github.com/safing/web
synced 2025-09-01 10:39:03 +00:00
Hotfix floating button
This commit is contained in:
parent
efaf5140f7
commit
0df553a33b
3 changed files with 9 additions and 4 deletions
|
@ -15,7 +15,11 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function scrollFunction() {
|
function scrollFunction() {
|
||||||
var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
|
{% if include.heightref %}
|
||||||
|
var h = document.getElementById('{{ include.heightref }}').offsetTop
|
||||||
|
{% else %}
|
||||||
|
var h = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) / 4
|
||||||
|
{% endif %}
|
||||||
if (document.body.scrollTop > h || document.documentElement.scrollTop > h) {
|
if (document.body.scrollTop > h || document.documentElement.scrollTop > h) {
|
||||||
document.getElementById("floating-button").classList.add("visible");
|
document.getElementById("floating-button").classList.add("visible");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#floating-button {
|
#floating-button {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 25px;
|
|
||||||
top: 25px;
|
top: 25px;
|
||||||
|
right: 25px;
|
||||||
box-shadow: 1px 2px 3px 1px #718399;
|
box-shadow: 1px 2px 3px 1px #718399;
|
||||||
background-color: $discreet;
|
background-color: $discreet;
|
||||||
// width: 64px; DEFINED BELOW!
|
// width: 64px; DEFINED BELOW!
|
||||||
|
@ -40,7 +40,8 @@
|
||||||
@media only screen and (max-width: 767px) {
|
@media only screen and (max-width: 767px) {
|
||||||
#floating-button {
|
#floating-button {
|
||||||
width: 51px;
|
width: 51px;
|
||||||
right: -4px;
|
top: 10px;
|
||||||
|
right: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ title: Safing
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% include header.html home=true %}
|
{% include header.html home=true %}
|
||||||
{% include floating_button.html download=true %}
|
{% include floating_button.html heightref="portmaster" download=true %}
|
||||||
<div class='content' style='background-image: url("/assets/img/shortlandscape.png"); background-size: 100%;background-repeat: no-repeat;'>
|
<div class='content' style='background-image: url("/assets/img/shortlandscape.png"); background-size: 100%;background-repeat: no-repeat;'>
|
||||||
<div class='ui grid'>
|
<div class='ui grid'>
|
||||||
<div class='computer only sixteen wide column' style='height: 10rem;'></div>
|
<div class='computer only sixteen wide column' style='height: 10rem;'></div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue