feat: add cookie consent banner and functionality to accept cookies
This commit is contained in:
@@ -35,8 +35,8 @@ function Info() {
|
|||||||
|
|
||||||
<div className="flex-col max-w-10/12">
|
<div className="flex-col max-w-10/12">
|
||||||
<p className="text-white text-base md:text-4xl font-normal">
|
<p className="text-white text-base md:text-4xl font-normal">
|
||||||
Организованный Департаментом спорта Москвы и РАФ,
|
Организованный Департаментом спорта Москвы и РАФ, он объединяет
|
||||||
он объединяет фанатов скорости и семьи.
|
фанатов скорости и семьи.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -66,7 +66,11 @@ function Info() {
|
|||||||
<div className="flex-col md:min-w-2/3 justify-start items-start">
|
<div className="flex-col md:min-w-2/3 justify-start items-start">
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
console.log("test");
|
// open this link in a new tab
|
||||||
|
const url =
|
||||||
|
"https://disk.yandex.ru/d/l8yiw1huY5NU9whttps://disk.yandex.ru/d/l8yiw1huY5NU9w";
|
||||||
|
|
||||||
|
window.open(url, "_blank", "noopener,noreferrer");
|
||||||
}}
|
}}
|
||||||
shadowEnabled={false}
|
shadowEnabled={false}
|
||||||
variant="blue"
|
variant="blue"
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ function Navbar() {
|
|||||||
О фестивале
|
О фестивале
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
{/* <li>
|
||||||
<Link href="/about" className="hover:underline">
|
<Link href="/about" className="hover:underline">
|
||||||
Карта
|
Карта
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li> */}
|
||||||
<li>
|
<li>
|
||||||
<Link href="/events" className="hover:underline">
|
<Link href="/events" className="hover:underline">
|
||||||
соревнования
|
соревнования
|
||||||
|
|||||||
@@ -47,6 +47,62 @@ export default function Document() {
|
|||||||
</div>
|
</div>
|
||||||
</noscript>
|
</noscript>
|
||||||
|
|
||||||
|
{/* Cookie Banner */}
|
||||||
|
<div
|
||||||
|
id="cookie-banner"
|
||||||
|
style={{
|
||||||
|
position: "fixed",
|
||||||
|
bottom: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
background: "#f0f0f0",
|
||||||
|
color: "#000",
|
||||||
|
padding: "15px",
|
||||||
|
fontSize: "14px",
|
||||||
|
display: "none",
|
||||||
|
zIndex: 1000,
|
||||||
|
boxShadow: "0 -2px 8px rgba(0,0,0,0.1)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
maxWidth: "960px",
|
||||||
|
margin: "0 auto",
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center",
|
||||||
|
flexWrap: "wrap",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div style={{ marginRight: "15px" }}>
|
||||||
|
Мы используем cookie для повышения удобства работы с сайтом.
|
||||||
|
Подробнее — в{" "}
|
||||||
|
<a
|
||||||
|
href="https://tech-fest.sport.mos.ru/privacy.html"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
политике конфиденциальности
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
id="cookie-accept"
|
||||||
|
style={{
|
||||||
|
marginTop: "10px",
|
||||||
|
padding: "8px 16px",
|
||||||
|
background: "#eb3333",
|
||||||
|
color: "white",
|
||||||
|
border: "none",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "4px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Хорошо
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{ display: "none" }}
|
style={{ display: "none" }}
|
||||||
itemScope
|
itemScope
|
||||||
@@ -74,6 +130,24 @@ export default function Document() {
|
|||||||
</div>
|
</div>
|
||||||
<Main />
|
<Main />
|
||||||
<NextScript />
|
<NextScript />
|
||||||
|
|
||||||
|
{/* Cookie Banner Script */}
|
||||||
|
<script
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: `
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
if (!localStorage.getItem("cookieAccepted")) {
|
||||||
|
document.getElementById("cookie-banner").style.display = "block";
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("cookie-accept").addEventListener("click", function () {
|
||||||
|
localStorage.setItem("cookieAccepted", "true");
|
||||||
|
document.getElementById("cookie-banner").style.display = "none";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</body>
|
</body>
|
||||||
</Html>
|
</Html>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user