Initial commit: landing page Gruperly con Eleventy
This commit is contained in:
79
src/_includes/layouts/base.njk
Normal file
79
src/_includes/layouts/base.njk
Normal file
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es" class="scroll-smooth">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{{ title or site.name }}</title>
|
||||
<meta name="description" content="{{ description or site.description }}" />
|
||||
<script>
|
||||
if (localStorage.getItem('theme') === 'dark' || (!localStorage.getItem('theme') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||||
document.documentElement.classList.add('dark');
|
||||
}
|
||||
</script>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
darkMode: 'class',
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
brand: {
|
||||
50: '#eef4ff',
|
||||
100: '#dbe6fe',
|
||||
200: '#bfd3fe',
|
||||
300: '#93b4fd',
|
||||
400: '#608afa',
|
||||
500: '#3b63f5',
|
||||
600: '#2544ea',
|
||||
700: '#1d33d8',
|
||||
800: '#1e2cb0',
|
||||
900: '#1e2b8b',
|
||||
950: '#171d54',
|
||||
},
|
||||
},
|
||||
fontFamily: {
|
||||
sans: ['Inter', 'ui-sans-serif', 'system-ui', 'sans-serif'],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet" />
|
||||
<style>
|
||||
[x-cloak] { display: none !important; }
|
||||
input[type="range"] { accent-color: #3b63f5; }
|
||||
</style>
|
||||
</head>
|
||||
<body class="font-sans antialiased bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100 transition-colors duration-300">
|
||||
|
||||
{% include "partials/header.njk" %}
|
||||
|
||||
<main>
|
||||
{{ content | safe }}
|
||||
</main>
|
||||
|
||||
{% include "partials/footer.njk" %}
|
||||
|
||||
<script>
|
||||
const themeToggle = document.getElementById('theme-toggle');
|
||||
const iconSun = document.getElementById('icon-sun');
|
||||
const iconMoon = document.getElementById('icon-moon');
|
||||
|
||||
function syncIcons() {
|
||||
const isDark = document.documentElement.classList.contains('dark');
|
||||
iconSun.classList.toggle('hidden', !isDark);
|
||||
iconMoon.classList.toggle('hidden', isDark);
|
||||
}
|
||||
|
||||
themeToggle.addEventListener('click', () => {
|
||||
const isDark = document.documentElement.classList.toggle('dark');
|
||||
localStorage.setItem('theme', isDark ? 'dark' : 'light');
|
||||
syncIcons();
|
||||
});
|
||||
|
||||
syncIcons();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user