began structuring index page. posts now show correctly on a 1920x1080 screen.

This commit is contained in:
Lorenzo Dellacà
2020-08-13 14:23:29 +02:00
parent 359e6108c9
commit 3b02a75451
13 changed files with 2756 additions and 2647 deletions

20
assets/js/arrow-fade.js Normal file → Executable file
View File

@@ -1,10 +1,10 @@
// JavaScript Document
$(document).ready(function(){
$(window).scroll(function(){
if($(this).scrollTop() > $(window).height()*0.3){
$(".arrow-down").css({"opacity" : "0"});
} else {
$(".arrow-down").css({"opacity" : "0.4"});
}
})
})
// JavaScript Document
$(document).ready(function(){
$(window).scroll(function(){
if($(this).scrollTop() > $(window).height()*0.3){
$(".arrow-down").css({"opacity" : "0"});
} else {
$(".arrow-down").css({"opacity" : "0.4"});
}
})
})

1316
assets/js/jquery-3.5.1.js vendored Normal file → Executable file

File diff suppressed because it is too large Load Diff

76
assets/js/policy-popup.js Normal file → Executable file
View File

@@ -1,38 +1,38 @@
function openPolicyPopup() {
if(getCookie("consentGiven") === "true") return;
$("#mind-policy-popup").fadeIn(1000); // Enable the div
}
function agreePolicyPopup() {
const _paq = window._paq || [];
_paq.push(['rememberConsentGiven', 43800]);
$("#mind-policy-popup").fadeOut(1000); // Disable the div
setCookie("consentGiven", "true", 1825) // todo: check if already present? also, firefox was throwing a warning...
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) === ' ') {
c = c.substring(1);
}
if (c.indexOf(name) === 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function setCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/;SameSite=Lax";
}
function openPolicyPopup() {
if(getCookie("consentGiven") === "true") return;
$("#mind-policy-popup").fadeIn(1000); // Enable the div
}
function agreePolicyPopup() {
const _paq = window._paq || [];
_paq.push(['rememberConsentGiven', 43800]);
$("#mind-policy-popup").fadeOut(1000); // Disable the div
setCookie("consentGiven", "true", 1825) // todo: check if already present? also, firefox was throwing a warning...
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) === ' ') {
c = c.substring(1);
}
if (c.indexOf(name) === 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function setCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/;SameSite=Lax";
}

View File

@@ -0,0 +1,45 @@
var scroll_pos = 0;
var transparent = true;
var offset = 100;
function makeTransparent()
{
$("#navbar").removeClass('navbar-colored').addClass('navbar-transparent');
transparent = true;
}
function makeOpaque()
{
$("#navbar").removeClass('navbar-transparent').addClass('navbar-colored');
transparent = false;
}
$(document).ready(function() {
scroll_pos = $(this).scrollTop();
if(scroll_pos > offset)
{
makeOpaque();
}
else
{
makeTransparent();
}
$(document).scroll(function() {
scroll_pos = $(this).scrollTop();
if(transparent)
{
if(scroll_pos > offset)
{
makeOpaque();
}
}
else
{
if(scroll_pos <= offset)
{
makeTransparent();
}
}
});
});

File diff suppressed because one or more lines are too long