Scamming banner

This commit is contained in:
rustdesk 2024-10-11 18:01:46 +08:00
parent 7db3e58c51
commit ec8e3854d0
4 changed files with 16 additions and 5 deletions

View File

@ -4,7 +4,6 @@ import '../assets/styles/ccElegantBlack.css';
---
<!--<button type="button" class="cc-button">Show preferences modal</button>-->
<script>
import { run } from 'vanilla-cookieconsent';
import { config } from './CookieConsentConfig';
@ -12,5 +11,15 @@ import '../assets/styles/ccElegantBlack.css';
// toggle custom black theme
document.body.classList.add('cc--elegant-black');
run(config);
function checkCookieConsent() {
// this cookie consent use cookie to store the consent status, but our webiste v2 use localStorage
// this is used to compliant with v2
const consentStatus = localStorage.getItem('cookie-accepted');
return consentStatus === 'true';
}
// If consent is not given, run the cookie consent config
if (!checkCookieConsent()) {
run(config);
}
</script>

View File

@ -23,7 +23,9 @@ const Carousel = ({ list }) => {
delay: 2500,
disableOnInteraction: true,
}}
lazy={true}
// https://github.com/nolimits4web/swiper/blob/40a705e5bcadf2ee2ee90591ff9ed95c1aaf9026/src/swiper-element.mjs#L286
// workaround for {true} which cause console error
lazy='true'
scrollbar
modules={[Pagination, Autoplay, Scrollbar, Mousewheel]}
>

View File

@ -12,6 +12,7 @@ import SiteVerification from '~/components/common/SiteVerification.astro';
import Analytics from '~/components/common/Analytics.astro';
import BasicScripts from '~/components/common/BasicScripts.astro';
import CookieConsent from '../components/CookieConsent.astro';
import Scamming from '../components/common/Scamming.jsx';
// Comment the line below to disable View Transitions
import { ViewTransitions } from 'astro:transitions';
@ -42,6 +43,7 @@ const { language, textDirection } = I18N;
</head>
<body class="antialiased text-default bg-page tracking-tight">
<Scamming client:load />
<slot />
<BasicScripts />

View File

@ -1,8 +1,6 @@
---
import Features2 from '~/components/widgets/Features2.astro';
import Features3 from '~/components/widgets/Features3.astro';
import Hero from '~/components/widgets/Hero.astro';
import Stats from '~/components/widgets/Stats.astro';
import Steps2 from '~/components/widgets/Steps2.astro';
import Layout from '~/layouts/PageLayout.astro';