perbaikan header

This commit is contained in:
krizzn65 2026-02-16 11:53:56 +07:00
parent b90cdc07d7
commit 282019870d
9 changed files with 629 additions and 109 deletions

View File

@ -8,6 +8,7 @@
"name": "frontend",
"version": "0.0.0",
"dependencies": {
"@iconify/react": "^6.0.2",
"axios": "^1.13.5",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
@ -17,6 +18,7 @@
"react-dom": "^18.2.0",
"react-icons": "^5.5.0",
"react-router-dom": "^6.8.1",
"styled-components": "^6.3.9",
"tailwind-merge": "^3.4.1",
"tailwindcss": "^3.4.19",
"tailwindcss-animate": "^1.0.7",
@ -347,6 +349,12 @@
"license": "MIT",
"optional": true
},
"node_modules/@emotion/unitless": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.10.0.tgz",
"integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==",
"license": "MIT"
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.27.3",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz",
@ -981,6 +989,27 @@
"url": "https://github.com/sponsors/nzakas"
}
},
"node_modules/@iconify/react": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/@iconify/react/-/react-6.0.2.tgz",
"integrity": "sha512-SMmC2sactfpJD427WJEDN6PMyznTFMhByK9yLW0gOTtnjzzbsi/Ke/XqsumsavFPwNiXs8jSiYeZTmLCLwO+Fg==",
"license": "MIT",
"dependencies": {
"@iconify/types": "^2.0.0"
},
"funding": {
"url": "https://github.com/sponsors/cyberalien"
},
"peerDependencies": {
"react": ">=16"
}
},
"node_modules/@iconify/types": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz",
"integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==",
"license": "MIT"
},
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.13",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
@ -1501,6 +1530,12 @@
"@types/react": "^18.0.0"
}
},
"node_modules/@types/stylis": {
"version": "4.2.7",
"resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.7.tgz",
"integrity": "sha512-VgDNokpBoKF+wrdvhAAfS55OMQpL6QRglwTwNC3kIgBrzZxA4WsFj+2eLfEA/uMUDzBcEhYmjSbwQakn/i3ajA==",
"license": "MIT"
},
"node_modules/@vitejs/plugin-react": {
"version": "5.1.4",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.4.tgz",
@ -1794,6 +1829,15 @@
"node": ">= 6"
}
},
"node_modules/camelize": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz",
"integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001769",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001769.tgz",
@ -1959,6 +2003,26 @@
"node": ">= 8"
}
},
"node_modules/css-color-keywords": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz",
"integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==",
"license": "ISC",
"engines": {
"node": ">=4"
}
},
"node_modules/css-to-react-native": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz",
"integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==",
"license": "MIT",
"dependencies": {
"camelize": "^1.0.0",
"css-color-keywords": "^1.0.0",
"postcss-value-parser": "^4.0.2"
}
},
"node_modules/cssesc": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
@ -1975,7 +2039,6 @@
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
"dev": true,
"license": "MIT"
},
"node_modules/debug": {
@ -3750,6 +3813,12 @@
"semver": "bin/semver.js"
}
},
"node_modules/shallowequal": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz",
"integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==",
"license": "MIT"
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@ -3795,6 +3864,88 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/styled-components": {
"version": "6.3.9",
"resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.3.9.tgz",
"integrity": "sha512-J72R4ltw0UBVUlEjTzI0gg2STOqlI9JBhQOL4Dxt7aJOnnSesy0qJDn4PYfMCafk9cWOaVg129Pesl5o+DIh0Q==",
"license": "MIT",
"dependencies": {
"@emotion/is-prop-valid": "1.4.0",
"@emotion/unitless": "0.10.0",
"@types/stylis": "4.2.7",
"css-to-react-native": "3.2.0",
"csstype": "3.2.3",
"postcss": "8.4.49",
"shallowequal": "1.1.0",
"stylis": "4.3.6",
"tslib": "2.8.1"
},
"engines": {
"node": ">= 16"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/styled-components"
},
"peerDependencies": {
"react": ">= 16.8.0",
"react-dom": ">= 16.8.0"
},
"peerDependenciesMeta": {
"react-dom": {
"optional": true
}
}
},
"node_modules/styled-components/node_modules/@emotion/is-prop-valid": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.4.0.tgz",
"integrity": "sha512-QgD4fyscGcbbKwJmqNvUMSE02OsHUa+lAWKdEUIJKgqe5IwRSKd7+KhibEWdaKwgjLj0DRSHA9biAIqGBk05lw==",
"license": "MIT",
"dependencies": {
"@emotion/memoize": "^0.9.0"
}
},
"node_modules/styled-components/node_modules/@emotion/memoize": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz",
"integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==",
"license": "MIT"
},
"node_modules/styled-components/node_modules/postcss": {
"version": "8.4.49",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz",
"integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.7",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.1"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/stylis": {
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.6.tgz",
"integrity": "sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ==",
"license": "MIT"
},
"node_modules/sucrase": {
"version": "3.35.1",
"resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz",

View File

@ -10,6 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@iconify/react": "^6.0.2",
"axios": "^1.13.5",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
@ -19,6 +20,7 @@
"react-dom": "^18.2.0",
"react-icons": "^5.5.0",
"react-router-dom": "^6.8.1",
"styled-components": "^6.3.9",
"tailwind-merge": "^3.4.1",
"tailwindcss": "^3.4.19",
"tailwindcss-animate": "^1.0.7",

View File

@ -1,9 +1,12 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { Link, useNavigate } from 'react-router-dom';
import { Component as ReportButton } from './button';
import { Icon } from '@iconify/react';
import { motion } from 'framer-motion';
import { fadeIn, slideUp, slideLeft, slideRight } from '../utils/motionVariants';
const Hero = ({ heroData }) => {
const navigate = useNavigate();
const defaultHero = {
title: 'Aman Bicara, Aman Melapor',
subtitle: 'Satgas PPKPT Politeknik Negeri Jember',
@ -46,11 +49,11 @@ const Hero = ({ heroData }) => {
/>
</div>
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
<div className="grid lg:grid-cols-2 gap-12 lg:gap-20 items-center">
<div className="max-w-[1440px] mx-auto px-8 sm:px-12 lg:px-16 relative z-10">
<div className="grid lg:grid-cols-2 gap-8 lg:gap-12 items-center">
{/* Left Content */}
<motion.div
className="space-y-8"
className="space-y-6"
variants={slideUp}
initial="hidden"
animate="visible"
@ -64,7 +67,7 @@ const Hero = ({ heroData }) => {
transition={{ delay: 0.2 }}
>
<motion.h1
className="text-4xl md:text-5xl lg:text-6xl font-bold text-gray-900 dark:text-white leading-tight"
className="text-5xl md:text-6xl lg:text-7xl font-bold text-gray-900 dark:text-white leading-tight"
variants={slideUp}
initial="hidden"
animate="visible"
@ -74,7 +77,7 @@ const Hero = ({ heroData }) => {
</motion.h1>
<motion.h2
className="text-xl md:text-2xl lg:text-3xl font-semibold text-primary dark:text-primary-light"
className="text-2xl md:text-3xl lg:text-4xl font-semibold text-[#191970] dark:text-blue-300"
variants={slideUp}
initial="hidden"
animate="visible"
@ -85,27 +88,34 @@ const Hero = ({ heroData }) => {
</motion.div>
<motion.p
className="text-lg text-gray-600 dark:text-gray-300 leading-relaxed max-w-xl"
className="text-xl text-gray-600 dark:text-gray-300 leading-relaxed max-w-2xl"
variants={fadeIn}
initial="hidden"
animate="visible"
transition={{ delay: 0.5 }}
>
{hero.description}
{hero.description ? (
hero.description
) : (
<>
Kami siap mendengar dan membantu Anda dengan{' '}
<span className="highlight-marker" style={{ '--delay': '1' }}>profesionalisme</span> dan{' '}
<span className="highlight-marker" style={{ '--delay': '1.6' }}>kerahasiaan terjamin</span>.{' '}
Setiap laporan akan ditangani dengan{' '}
<span className="highlight-marker" style={{ '--delay': '2.2' }}>empati</span> dan{' '}
<span className="highlight-marker" style={{ '--delay': '2.6' }}>seksama</span>.
</>
)}
</motion.p>
<motion.div
className="flex flex-col sm:flex-row gap-4 pt-4"
className="flex flex-row gap-4 pt-4 items-start"
variants={slideUp}
initial="hidden"
animate="visible"
transition={{ delay: 0.6 }}
>
<motion.a
href="https://wa.me/6281234567890"
target="_blank"
rel="noopener noreferrer"
className="px-8 py-4 bg-danger text-white rounded-xl hover:bg-danger-dark transition-all duration-300 hover:shadow-lg hover:-translate-y-1 font-semibold text-center shadow-soft"
<motion.div
variants={fadeIn}
initial="hidden"
animate="visible"
@ -113,8 +123,16 @@ const Hero = ({ heroData }) => {
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
>
Butuh Bantuan Darurat
</motion.a>
<ReportButton
icon={<Icon icon="solar:phone-calling-bold-duotone" />}
title="Butuh Bantuan Darurat"
size="sm"
className="rounded-full bg-red-600 hover:bg-red-700 border-0"
gradientLight={{ from: "from-red-600", via: "via-red-600", to: "to-red-600" }}
gradientDark={{ from: "from-red-600", via: "via-red-600", to: "to-red-600" }}
onClick={() => window.open('https://wa.me/6281234567890', '_blank')}
/>
</motion.div>
<motion.div
variants={fadeIn}
@ -124,38 +142,20 @@ const Hero = ({ heroData }) => {
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
>
<Link
to="/artikel"
className="px-8 py-4 bg-primary text-white rounded-xl hover:bg-primary-dark transition-all duration-300 hover:shadow-lg hover:-translate-y-1 font-semibold text-center shadow-soft inline-block w-full sm:w-auto"
>
Buat Laporan
</Link>
<ReportButton
icon={<Icon icon="solar:document-add-bold-duotone" />}
title="Buat Laporan"
size="sm"
className="rounded-full bg-[#191970] hover:bg-blue-900 border-0"
gradientLight={{ from: "from-[#191970]", via: "via-[#191970]", to: "to-[#191970]" }}
gradientDark={{ from: "from-[#191970]", via: "via-[#191970]", to: "to-[#191970]" }}
onClick={() => navigate('/artikel')}
/>
</motion.div>
</motion.div>
{/* Trust Indicators */}
<motion.div
className="flex flex-wrap gap-6 pt-8"
variants={fadeIn}
initial="hidden"
animate="visible"
transition={{ delay: 0.9 }}
>
<div className="flex items-center space-x-2">
<div className="w-2 h-2 bg-accent rounded-full"></div>
<span className="text-sm text-gray-600 dark:text-gray-300 font-medium">100% Rahasia</span>
</div>
<div className="flex items-center space-x-2">
<div className="w-2 h-2 bg-accent rounded-full"></div>
<span className="text-sm text-gray-600 dark:text-gray-300 font-medium">Profesional</span>
</div>
<div className="flex items-center space-x-2">
<div className="w-2 h-2 bg-accent rounded-full"></div>
<span className="text-sm text-gray-600 dark:text-gray-300 font-medium">24/7 Support</span>
</div>
</motion.div>
</motion.div>
{/* Right Content - Logo & Branding */}
@ -173,7 +173,7 @@ const Hero = ({ heroData }) => {
<img
src="/gambar_header.png"
alt="header gambar"
className="w-full max-w-[500px] h-auto object-cover"
className="w-full max-w-[550px] h-auto object-cover"
/>
</motion.div>
@ -181,26 +181,12 @@ const Hero = ({ heroData }) => {
<div className="absolute inset-0 bg-gradient-to-br from-purple-100/50 dark:from-purple-900/20 to-accent/10 dark:to-accent/20 rounded-3xl blur-2xl -z-10"></div>
</motion.div>
</div>
{/* Brand Stats Banner - Glassmorphic Light Design */}
</div>
{/* Scroll Indicator */}
<motion.div
className="absolute bottom-8 left-1/2 transform -translate-x-1/2"
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 1.5, duration: 0.8 }}
>
<motion.div
animate={{ y: [0, 10, 0] }}
transition={{ duration: 2, repeat: Infinity }}
className="flex flex-col items-center space-y-2"
>
<span className="text-sm text-gray-400 dark:text-gray-500 font-medium">Scroll ke bawah</span>
<div className="w-6 h-10 border-2 border-gray-400 dark:border-gray-500 rounded-full flex justify-center">
<div className="w-1 h-3 bg-gray-600 dark:bg-gray-400 rounded-full mt-2"></div>
</div>
</motion.div>
</motion.div>
</section>
);
};

View File

@ -5,7 +5,7 @@ import { Link, useNavigate, useLocation } from 'react-router-dom';
import { motion, AnimatePresence } from 'framer-motion';
import { useAuth } from '../hooks/useAuth';
import { fadeIn, slideDown } from '../utils/motionVariants';
import ThemeToggle from './ThemeToggle';
import Switch from './sky-toggle';
import LoginModal from './LoginModal';
@ -47,33 +47,39 @@ const Navbar = () => {
useEffect(() => {
let ticking = false;
const handleScroll = () => {
// Logic for switching navbar type (Standard vs Expandable)
// Switch when approaching 'about' section or scrolled past 1st screen
const aboutSection = document.getElementById('about');
const threshold = aboutSection ? aboutSection.offsetTop - 400 : window.innerHeight - 200;
setIsScrolled(window.scrollY > threshold);
if (!ticking) {
requestAnimationFrame(() => {
// Logic for switching navbar type (Standard vs Expandable)
const aboutSection = document.getElementById('about');
const threshold = aboutSection ? aboutSection.offsetTop - 400 : window.innerHeight - 200;
setIsScrolled(window.scrollY > threshold);
// ScrollSpy Logic
const sections = navLinks.map(link => link.href.substring(1));
let currentSection = "";
// ScrollSpy Logic
const sections = navLinks.map(link => link.href.substring(1));
let currentSection = "";
for (const section of sections) {
const element = document.getElementById(section);
if (element) {
const rect = element.getBoundingClientRect();
if (rect.top <= 150 && rect.bottom >= 150) {
currentSection = "#" + section;
for (const section of sections) {
const element = document.getElementById(section);
if (element) {
const rect = element.getBoundingClientRect();
if (rect.top <= 150 && rect.bottom >= 150) {
currentSection = "#" + section;
}
}
}
}
}
if (currentSection && currentSection !== activeLink) {
setActiveLink(currentSection);
if (currentSection && currentSection !== activeLink) {
setActiveLink(currentSection);
}
ticking = false;
});
ticking = true;
}
};
window.addEventListener('scroll', handleScroll);
window.addEventListener('scroll', handleScroll, { passive: true });
return () => window.removeEventListener('scroll', handleScroll);
}, [navLinks, activeLink]);
@ -103,15 +109,15 @@ const Navbar = () => {
return (
<>
<AnimatePresence>
<AnimatePresence mode="wait">
{isScrolled ? (
<motion.div
key="expandable-tabs"
initial={{ opacity: 0, scale: 0.8, y: -20, x: "-50%" }}
animate={{ opacity: 1, scale: 1, y: 0, x: "-50%" }}
exit={{ opacity: 0, scale: 0.8, y: -20, x: "-50%", transition: { duration: 0.1 } }}
transition={{ duration: 0.2, ease: "easeOut" }}
className="fixed top-4 left-1/2 z-50 transform -translate-x-1/2"
initial={{ opacity: 0, y: -10, x: "-50%" }}
animate={{ opacity: 1, y: 0, x: "-50%" }}
exit={{ opacity: 0, y: -10, x: "-50%", transition: { duration: 0.15 } }}
transition={{ duration: 0.25, ease: [0.25, 0.46, 0.45, 0.94] }}
className="fixed top-4 left-1/2 z-50 transform -translate-x-1/2 will-change-transform"
>
<ExpandableTabs
tabs={tabs}
@ -125,18 +131,18 @@ const Navbar = () => {
}}
trailingElement={
<div className="flex items-center gap-2">
<ThemeToggle />
<Switch />
{isAuthenticated ? (
<>
<button
onClick={handleDashboardRedirect}
className="px-4 py-2 text-sm font-medium bg-[#191970] text-white rounded-full hover:bg-blue-900 transition-colors"
className="px-5 py-2.5 text-sm font-medium bg-primary text-white rounded-full hover:bg-primary-dark transition-all duration-300 hover:shadow-lg"
>
Dashboard
</button>
<button
onClick={handleLogout}
className="px-4 py-2 text-sm font-medium border border-[#191970] text-[#191970] rounded-full hover:bg-gray-100 transition-colors"
className="px-5 py-2.5 text-sm font-medium border-2 border-primary text-primary rounded-full hover:bg-primary hover:text-white transition-all duration-300"
>
Keluar
</button>
@ -144,7 +150,7 @@ const Navbar = () => {
) : (
<button
onClick={() => setIsLoginModalOpen(true)}
className="px-6 py-2 text-sm font-medium bg-[#191970] text-white rounded-full hover:bg-blue-900 transition-colors shadow-lg"
className="px-6 py-2.5 text-sm font-medium bg-[#191970] text-white rounded-full hover:bg-blue-900 transition-all duration-300 hover:shadow-lg"
>
Masuk
</button>
@ -156,11 +162,11 @@ const Navbar = () => {
) : (
<motion.nav
key="navbar"
initial={{ opacity: 0, scale: 0.9, y: -20 }}
animate={{ opacity: 1, scale: 1, y: 0 }}
exit={{ opacity: 0, scale: 0.9, y: -20, transition: { duration: 0.1 } }}
transition={{ duration: 0.2, ease: "easeOut" }}
className="fixed top-0 left-0 right-0 z-50 transition-all duration-300 bg-white/50 backdrop-blur-md border-b border-white/20 shadow-sm"
initial={{ opacity: 0, y: -10 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -10, transition: { duration: 0.15 } }}
transition={{ duration: 0.25, ease: [0.25, 0.46, 0.45, 0.94] }}
className="fixed top-0 left-0 right-0 z-50 transition-colors duration-300 bg-white/50 backdrop-blur-md border-b border-white/20 shadow-sm will-change-transform"
>
<div className="w-full px-4">
<div className="flex items-center justify-between h-20">
@ -199,7 +205,7 @@ const Navbar = () => {
{/* Right Section - Auth & Theme */}
<div className="hidden md:flex items-center space-x-4">
<ThemeToggle />
<Switch />
{isAuthenticated ? (
<>
@ -219,7 +225,7 @@ const Navbar = () => {
) : (
<button
onClick={() => setIsLoginModalOpen(true)}
className="px-6 py-2.5 bg-primary text-white rounded-full hover:bg-primary-dark transition-all duration-300 hover:shadow-lg font-medium text-sm"
className="px-6 py-2.5 bg-[#191970] text-white rounded-full hover:bg-blue-900 transition-all duration-300 hover:shadow-lg font-medium text-sm"
>
Masuk
</button>

View File

@ -0,0 +1,53 @@
import React from "react";
export const Component = ({
icon,
title,
subtitle,
size = "md",
className = "",
...props
}) => {
const sizes = {
sm: "px-10 py-4 rounded-full text-base",
md: "p-4 rounded-2xl",
lg: "p-6 rounded-3xl",
};
return (
<button
{...props}
className={`group relative overflow-hidden cursor-pointer transition-all duration-300 ease-out
shadow-lg hover:shadow-xl hover:scale-[1.02] hover:-translate-y-1 active:scale-95
border-0 flex items-center justify-between gap-6
${sizes[size]}
${className}`}>
{/* Subtle internal glow/shine for depth, but keeping base color solid */}
<div className="absolute inset-0 bg-gradient-to-r from-transparent via-white/10 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-1000 ease-out"></div>
{/* Content - flat structure for perfect alignment */}
<div className="relative z-10 flex items-center gap-3">
{icon && React.cloneElement(icon, {
className: "w-6 h-6 text-white/90 group-hover:text-white transition-colors shrink-0",
})}
<span className="text-white font-bold text-base whitespace-nowrap">{title}</span>
</div>
{/* Arrow - Re-added as requested */}
<div className="relative z-10 opacity-70 group-hover:opacity-100 group-hover:translate-x-1 transition-all duration-300">
<svg
viewBox="0 0 24 24"
stroke="currentColor"
fill="none"
className="w-4 h-4 text-white">
<path
d="M9 5l7 7-7 7"
strokeWidth={2}
strokeLinejoin="round"
strokeLinecap="round"></path>
</svg>
</div>
</button>
);
};

View File

@ -0,0 +1,251 @@
import React from 'react';
import styled from 'styled-components';
import { useTheme } from '../contexts/ThemeContext';
const Switch = () => {
const { toggleTheme, isDark } = useTheme();
const handleChange = () => {
toggleTheme();
};
return (
<StyledWrapper>
<label className="theme-switch">
<input
type="checkbox"
className="theme-switch__checkbox"
checked={isDark}
onChange={handleChange}
/>
<div className="theme-switch__container">
<div className="theme-switch__clouds" />
<div className="theme-switch__stars-container">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 55" fill="none">
<path
fillRule="evenodd"
clipRule="evenodd"
d="M135.831 3.00688C135.055 3.85027 134.111 4.29946 133 4.35447C134.111 4.40947 135.055 4.85867 135.831 5.71123C136.607 6.55462 136.996 7.56303 136.996 8.72727C136.996 7.95722 137.172 7.25134 137.525 6.59129C137.886 5.93124 138.372 5.39954 138.98 5.00535C139.598 4.60199 140.268 4.39114 141 4.35447C139.88 4.2903 138.936 3.85027 138.16 3.00688C137.384 2.16348 136.996 1.16425 136.996 0C136.996 1.16425 136.607 2.16348 135.831 3.00688ZM31 23.3545C32.1114 23.2995 33.0551 22.8503 33.8313 22.0069C34.6075 21.1635 34.9956 20.1642 34.9956 19C34.9956 20.1642 35.3837 21.1635 36.1599 22.0069C36.9361 22.8503 37.8798 23.2903 39 23.3545C38.2679 23.3911 37.5976 23.602 36.9802 24.0053C36.3716 24.3995 35.8864 24.9312 35.5248 25.5913C35.172 26.2513 34.9956 26.9572 34.9956 27.7273C34.9956 26.563 34.6075 25.5546 33.8313 24.7112C33.0551 23.8587 32.1114 23.4095 31 23.3545ZM0 36.3545C1.11136 36.2995 2.05513 35.8503 2.83131 35.0069C3.6075 34.1635 3.99559 33.1642 3.99559 32C3.99559 33.1642 4.38368 34.1635 5.15987 35.0069C5.93605 35.8503 6.87982 36.2903 8 36.3545C7.26792 36.3911 6.59757 36.602 5.98015 37.0053C5.37155 37.3995 4.88644 37.9312 4.52481 38.5913C4.172 39.2513 3.99559 39.9572 3.99559 40.7273C3.99559 39.563 3.6075 38.5546 2.83131 37.7112C2.05513 36.8587 1.11136 36.4095 0 36.3545ZM56.8313 24.0069C56.0551 24.8503 55.1114 25.2995 54 25.3545C55.1114 25.4095 56.0551 25.8587 56.8313 26.7112C57.6075 27.5546 57.9956 28.563 57.9956 29.7273C57.9956 28.9572 58.172 28.2513 58.5248 27.5913C58.8864 26.9312 59.3716 26.3995 59.9802 26.0053C60.5976 25.602 61.2679 25.3911 62 25.3545C60.8798 25.2903 59.9361 24.8503 59.1599 24.0069C58.3837 23.1635 57.9956 22.1642 57.9956 21C57.9956 22.1642 57.6075 23.1635 56.8313 24.0069ZM81 25.3545C82.1114 25.2995 83.0551 24.8503 83.8313 24.0069C84.6075 23.1635 84.9956 22.1642 84.9956 21C84.9956 22.1642 85.3837 23.1635 86.1599 24.0069C86.9361 24.8503 87.8798 25.2903 89 25.3545C88.2679 25.3911 87.5976 25.602 86.9802 26.0053C86.3716 26.3995 85.8864 26.9312 85.5248 27.5913C85.172 28.2513 84.9956 28.9572 84.9956 29.7273C84.9956 28.563 84.6075 27.5546 83.8313 26.7112C83.0551 25.8587 82.1114 25.4095 81 25.3545ZM136 36.3545C137.111 36.2995 138.055 35.8503 138.831 35.0069C139.607 34.1635 139.996 33.1642 139.996 32C139.996 33.1642 140.384 34.1635 141.16 35.0069C141.936 35.8503 142.88 36.2903 144 36.3545C143.268 36.3911 142.598 36.602 141.98 37.0053C141.372 37.3995 140.886 37.9312 140.525 38.5913C140.172 39.2513 139.996 39.9572 139.996 40.7273C139.996 39.563 139.607 38.5546 138.831 37.7112C138.055 36.8587 137.111 36.4095 136 36.3545ZM101.831 49.0069C101.055 49.8503 100.111 50.2995 99 50.3545C100.111 50.4095 101.055 50.8587 101.831 51.7112C102.607 52.5546 102.996 53.563 102.996 54.7273C102.996 53.9572 103.172 53.2513 103.525 52.5913C103.886 51.9312 104.372 51.3995 104.98 51.0053C105.598 50.602 106.268 50.3911 107 50.3545C105.88 50.2903 104.936 49.8503 104.16 49.0069C103.384 48.1635 102.996 47.1642 102.996 46C102.996 47.1642 102.607 48.1635 101.831 49.0069Z"
fill="currentColor" />
</svg>
</div>
<div className="theme-switch__circle-container">
<div className="theme-switch__sun-moon-container">
<div className="theme-switch__moon">
<div className="theme-switch__spot" />
<div className="theme-switch__spot" />
<div className="theme-switch__spot" />
</div>
</div>
</div>
</div>
</label>
</StyledWrapper>
);
}
const StyledWrapper = styled.div`
.theme-switch {
--toggle-size: 7px;
/* the size is adjusted using font-size,
this is not transform scale,
so you can choose any size */
--container-width: 5.625em;
--container-height: 2.5em;
--container-radius: 6.25em;
/* radius 0 - minecraft mode :) */
--container-light-bg: #3D7EAE;
--container-night-bg: #1D1F2C;
--circle-container-diameter: 3.375em;
--sun-moon-diameter: 2.125em;
--sun-bg: #ECCA2F;
--moon-bg: #C4C9D1;
--spot-color: #959DB1;
--circle-container-offset: calc((var(--circle-container-diameter) - var(--container-height)) / 2 * -1);
--stars-color: #fff;
--clouds-color: #F3FDFF;
--back-clouds-color: #AACADF;
--transition: .5s cubic-bezier(0, -0.02, 0.4, 1.25);
--circle-transition: .3s cubic-bezier(0, -0.02, 0.35, 1.17);
}
.theme-switch, .theme-switch *, .theme-switch *::before, .theme-switch *::after {
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
font-size: var(--toggle-size);
}
.theme-switch__container {
width: var(--container-width);
height: var(--container-height);
background-color: var(--container-light-bg);
border-radius: var(--container-radius);
overflow: hidden;
cursor: pointer;
-webkit-box-shadow: 0em -0.062em 0.062em rgba(0, 0, 0, 0.25), 0em 0.062em 0.125em rgba(255, 255, 255, 0.94);
box-shadow: 0em -0.062em 0.062em rgba(0, 0, 0, 0.25), 0em 0.062em 0.125em rgba(255, 255, 255, 0.94);
-webkit-transition: var(--transition);
-o-transition: var(--transition);
transition: var(--transition);
position: relative;
}
.theme-switch__container::before {
content: "";
position: absolute;
z-index: 1;
inset: 0;
-webkit-box-shadow: 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset, 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset;
box-shadow: 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset, 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset;
border-radius: var(--container-radius)
}
.theme-switch__checkbox {
display: none;
}
.theme-switch__circle-container {
width: var(--circle-container-diameter);
height: var(--circle-container-diameter);
background-color: rgba(255, 255, 255, 0.1);
position: absolute;
left: var(--circle-container-offset);
top: var(--circle-container-offset);
border-radius: var(--container-radius);
-webkit-box-shadow: inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), 0 0 0 0.625em rgba(255, 255, 255, 0.1), 0 0 0 1.25em rgba(255, 255, 255, 0.1);
box-shadow: inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), 0 0 0 0.625em rgba(255, 255, 255, 0.1), 0 0 0 1.25em rgba(255, 255, 255, 0.1);
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-transition: var(--circle-transition);
-o-transition: var(--circle-transition);
transition: var(--circle-transition);
pointer-events: none;
}
.theme-switch__sun-moon-container {
pointer-events: auto;
position: relative;
z-index: 2;
width: var(--sun-moon-diameter);
height: var(--sun-moon-diameter);
margin: auto;
border-radius: var(--container-radius);
background-color: var(--sun-bg);
-webkit-box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #a1872a inset;
box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #a1872a inset;
-webkit-filter: drop-shadow(0.062em 0.125em 0.125em rgba(0, 0, 0, 0.25)) drop-shadow(0em 0.062em 0.125em rgba(0, 0, 0, 0.25));
filter: drop-shadow(0.062em 0.125em 0.125em rgba(0, 0, 0, 0.25)) drop-shadow(0em 0.062em 0.125em rgba(0, 0, 0, 0.25));
overflow: hidden;
-webkit-transition: var(--transition);
-o-transition: var(--transition);
transition: var(--transition);
}
.theme-switch__moon {
-webkit-transform: translateX(100%);
-ms-transform: translateX(100%);
transform: translateX(100%);
width: 100%;
height: 100%;
background-color: var(--moon-bg);
border-radius: inherit;
-webkit-box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #969696 inset;
box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #969696 inset;
-webkit-transition: var(--transition);
-o-transition: var(--transition);
transition: var(--transition);
position: relative;
}
.theme-switch__spot {
position: absolute;
top: 0.75em;
left: 0.312em;
width: 0.75em;
height: 0.75em;
border-radius: var(--container-radius);
background-color: var(--spot-color);
-webkit-box-shadow: 0em 0.0312em 0.062em rgba(0, 0, 0, 0.25) inset;
box-shadow: 0em 0.0312em 0.062em rgba(0, 0, 0, 0.25) inset;
}
.theme-switch__spot:nth-of-type(2) {
width: 0.375em;
height: 0.375em;
top: 0.937em;
left: 1.375em;
}
.theme-switch__spot:nth-last-of-type(3) {
width: 0.25em;
height: 0.25em;
top: 0.312em;
left: 0.812em;
}
.theme-switch__clouds {
width: 1.25em;
height: 1.25em;
background-color: var(--clouds-color);
border-radius: var(--container-radius);
position: absolute;
bottom: -0.625em;
left: 0.312em;
-webkit-box-shadow: 0.937em 0.312em var(--clouds-color), -0.312em -0.312em var(--back-clouds-color), 1.437em 0.375em var(--clouds-color), 0.5em -0.125em var(--back-clouds-color), 2.187em 0 var(--clouds-color), 1.25em -0.062em var(--back-clouds-color), 2.937em 0.312em var(--clouds-color), 2em -0.312em var(--back-clouds-color), 3.625em -0.062em var(--clouds-color), 2.625em 0em var(--back-clouds-color), 4.5em -0.312em var(--clouds-color), 3.375em -0.437em var(--back-clouds-color), 4.625em -1.75em 0 0.437em var(--clouds-color), 4em -0.625em var(--back-clouds-color), 4.125em -2.125em 0 0.437em var(--back-clouds-color);
box-shadow: 0.937em 0.312em var(--clouds-color), -0.312em -0.312em var(--back-clouds-color), 1.437em 0.375em var(--clouds-color), 0.5em -0.125em var(--back-clouds-color), 2.187em 0 var(--clouds-color), 1.25em -0.062em var(--back-clouds-color), 2.937em 0.312em var(--clouds-color), 2em -0.312em var(--back-clouds-color), 3.625em -0.062em var(--clouds-color), 2.625em 0em var(--back-clouds-color), 4.5em -0.312em var(--clouds-color), 3.375em -0.437em var(--back-clouds-color), 4.625em -1.75em 0 0.437em var(--clouds-color), 4em -0.625em var(--back-clouds-color), 4.125em -2.125em 0 0.437em var(--back-clouds-color);
-webkit-transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
-o-transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
}
.theme-switch__stars-container {
position: absolute;
color: var(--stars-color);
top: -100%;
left: 0.312em;
width: 2.75em;
height: auto;
-webkit-transition: var(--transition);
-o-transition: var(--transition);
transition: var(--transition);
}
/* actions */
.theme-switch__checkbox:checked + .theme-switch__container {
background-color: var(--container-night-bg);
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__circle-container {
left: calc(100% - var(--circle-container-offset) - var(--circle-container-diameter));
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__circle-container:hover {
left: calc(100% - var(--circle-container-offset) - var(--circle-container-diameter) - 0.187em)
}
.theme-switch__circle-container:hover {
left: calc(var(--circle-container-offset) + 0.187em);
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__moon {
-webkit-transform: translate(0);
-ms-transform: translate(0);
transform: translate(0);
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__clouds {
bottom: -4.062em;
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__stars-container {
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}`;
export default Switch;

View File

@ -10,10 +10,10 @@ const buttonVariants = {
paddingLeft: ".5rem",
paddingRight: ".5rem",
},
animate: (isSelected) => ({
gap: isSelected ? ".5rem" : 0,
paddingLeft: isSelected ? "2rem" : "1rem",
paddingRight: isSelected ? "2rem" : "1rem",
animate: (isExpanded) => ({
gap: isExpanded ? ".5rem" : 0,
paddingLeft: isExpanded ? "2rem" : "1rem",
paddingRight: isExpanded ? "2rem" : "1rem",
}),
};
@ -34,6 +34,7 @@ export function ExpandableTabs({
trailingElement
}) {
const [selected, setSelected] = React.useState(null);
const [hovered, setHovered] = React.useState(null);
const outsideClickRef = React.useRef(null);
React.useEffect(() => {
@ -69,6 +70,7 @@ export function ExpandableTabs({
}
const Icon = tab.icon;
const isExpanded = selected === index || hovered === index;
return (
<motion.button
key={tab.title}
@ -76,18 +78,22 @@ export function ExpandableTabs({
variants={buttonVariants}
initial={false}
animate="animate"
custom={selected === index}
custom={isExpanded}
onClick={() => handleSelect(index)}
onMouseEnter={() => setHovered(index)}
onMouseLeave={() => setHovered(null)}
transition={transition}
className={cn(
"relative flex items-center rounded-full py-3 text-base font-medium transition-colors duration-300",
selected === index
? "bg-[#191970] text-white shadow-[0_4px_15px_rgba(25,25,112,0.4)]"
: "text-muted-foreground hover:bg-muted hover:text-foreground"
: hovered === index
? "bg-gray-200 text-foreground"
: "text-muted-foreground hover:text-foreground"
)}>
<Icon size={24} />
<AnimatePresence initial={false}>
{selected === index && (
{isExpanded && (
<motion.span
variants={spanVariants}
initial="initial"

View File

@ -576,3 +576,68 @@ body {
color: hsl(var(--foreground));
}
}
/* Blue Highlighter / Stabilo Effect - Per-letter animated */
.highlight-marker {
position: relative;
display: inline;
padding: 2px 6px;
border-radius: 3px;
font-weight: 600;
color: transparent;
background: linear-gradient(to right, #ffffff 50%, #374151 50%);
background-size: 200% 100%;
background-position: 100% 0;
-webkit-background-clip: text;
background-clip: text;
animation: marker-text-reveal 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
animation-delay: calc(var(--delay, 0) * 1s);
}
.highlight-marker::before {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 0;
height: 100%;
background: rgba(25, 25, 112, 0.85);
border-radius: 3px;
z-index: -1;
animation: marker-sweep 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
animation-delay: calc(var(--delay, 0) * 1s);
}
@keyframes marker-sweep {
0% {
width: 0;
}
100% {
width: 100%;
}
}
@keyframes marker-text-reveal {
0% {
background-position: 100% 0;
}
100% {
background-position: 0% 0;
}
}
/* Dark mode */
.dark .highlight-marker {
background: linear-gradient(to right, #ffffff 50%, #d1d5db 50%);
background-size: 200% 100%;
background-position: 100% 0;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.dark .highlight-marker::before {
background: rgba(80, 100, 220, 0.85);
}

View File

@ -17,9 +17,9 @@ const LandingPage = () => {
const mockHeroData = {
title: 'Aman Bicara, Aman Melapor',
subtitle: 'Satgas PPKPT Politeknik Negeri Jember',
description: 'Kami siap mendengar dan membantu Anda dengan profesionalisme dan kerahasiaan terjamin. Setiap laporan akan ditangani dengan empati dan seksama.'
description: null
};
setHeroData(mockHeroData);
setLoading(false);
}, []);