-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from AmanSingh494/main
Fixed navbar scroll, faqs animation, footer links and their respective styles.
- Loading branch information
Showing
14 changed files
with
178 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
from django.contrib import admin | ||
from django.urls import path,include | ||
from django.urls import path, include | ||
from home import views | ||
|
||
urlpatterns = [ | ||
path("", views.index, name="home"), | ||
path("faqs/", views.faqs, name="faqs"), | ||
|
||
path("popup_detect/", views.popup_detect, name="popup_detect"), | ||
path("report-dp/", views.reportDp, name="report-dp"), | ||
|
||
path("about/", views.about, name="about"), | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
* { | ||
font-family: var(--font-secondary); | ||
} | ||
.content-section section { | ||
display: flex; | ||
align-items: center; | ||
gap: 5rem; | ||
} | ||
.cogniguard-ss { | ||
height: 30rem; | ||
border: 1px solid var(--color-primary); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
} | ||
.content-section { | ||
gap: 3rem; | ||
padding-left: 30rem; | ||
} | ||
.heading-section { | ||
display: flex; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,28 @@ | ||
// function setSpeed(speed) { | ||
// const needle = document.getElementById('needle') | ||
// needle.style.transform = `rotate(${speed}deg)` | ||
// } | ||
// let transparencyScore = prompt('Enter transparency Score (0-100)') | ||
// // adjusting according to transparency score | ||
// if (transparencyScore >= 8) { | ||
// setSpeed(270) | ||
// } else if (transparencyScore <= 4) { | ||
// setSpeed(90) | ||
// } else { | ||
// setSpeed(0) | ||
// } | ||
// animation | ||
const img = document.querySelector('.animate-img') | ||
const p = document.querySelector('.animate-p') | ||
console.log(img.getBoundingClientRect().top, img.offsetHeight) | ||
const animate = (element) => { | ||
const footer = document.querySelector('footer') | ||
const navbar = document.querySelector('.navbar') | ||
const contentScetion = document.querySelector('.content-section') | ||
let flag = true | ||
document.addEventListener('scroll', () => { | ||
console.log( | ||
window.scrollY, | ||
window.innerHeight, | ||
window.scrollY + window.innerHeight, | ||
footer.offsetTop | ||
) | ||
if ( | ||
window.scrollY > | ||
element.getBoundingClientRect().top + element.offsetHeight | ||
window.scrollY + window.innerHeight >= footer.offsetTop && | ||
flag === true | ||
) { | ||
element.classList.add('animate') | ||
} | ||
if ( | ||
window.scrollY < | ||
element.getBoundingClientRect().top + element.offsetHeight + 100 | ||
navbar.style.position = 'absolute' | ||
navbar.style.top = footer.offsetTop - navbar.scrollHeight - 50 + 'px' | ||
flag = false | ||
} else if ( | ||
flag === false && | ||
window.scrollY + window.innerHeight < footer.offsetTop | ||
) { | ||
element.classList.remove('animate') | ||
navbar.style.position = 'fixed' | ||
navbar.style.top = null | ||
flag = true | ||
} | ||
} | ||
const animateAll = () => { | ||
animate(img) | ||
animate(p) | ||
} | ||
document.addEventListener('scroll', animateAll) | ||
}) | ||
// scrllY + innerHeight = offsetHeight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
{% block head %} | ||
<link rel="stylesheet" href="{% static "css/about.css" %}"> | ||
{% endblock head %} | ||
|
||
{% block title %}About{% endblock title %} | ||
|
||
{% block content %} | ||
<section class="content-section"> | ||
<section> | ||
<img class="cogniguard-ss" src="{%static "img/cogniguard-popup.png"%}" alt="web-extension-picture"> | ||
<div> | ||
<p class="font-medium"> | ||
<span class="blue-text font-mid-large font-secondary">Cogniguard</span> is a lightweight but powerful web extension designed to combat | ||
deceptive tactics and promote transparency online. | ||
</p> | ||
</div> | ||
</section> | ||
<section> | ||
<span class="font-medium"> | ||
<p>It empowers you by</p> | ||
<span class="font-mid-medium"> Identifying dark patterns: Uncovers hidden manipulation techniques used by websites, particularly in e-commerce. | ||
</span> | ||
</span> | ||
</section> | ||
</section> | ||
{% endblock content %} | ||
|
||
{% block script %} | ||
<script src="{% static "js/about.js"%}"></script> | ||
{% endblock script %} |
Oops, something went wrong.