Skip to content

Commit

Permalink
feat: integrate Tailwind CSS and update styling for Home and App comp…
Browse files Browse the repository at this point in the history
…onents
  • Loading branch information
michojekunle committed Jan 24, 2025
1 parent e362878 commit f45db69
Show file tree
Hide file tree
Showing 6 changed files with 1,570 additions and 291 deletions.
11 changes: 8 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"eject": "react-scripts eject"
},
"options": {
"allowedHosts": ["localhost", ".localhost"],
"allowedHosts": [
"localhost",
".localhost"
],
"proxy": "http://localhost:8000"
},
"browserslist": {
Expand All @@ -46,8 +49,8 @@
]
},
"devDependencies": {
"@babel/preset-env": "^7.26.0",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-env": "^7.26.0",
"@tanstack/eslint-plugin-query": "^5.60.1",
"@testing-library/jest-dom": "^6.6.2",
"@types/jest": "^29.5.14",
Expand All @@ -60,6 +63,8 @@
"globals": "^15.11.0",
"jest": "^27.5.1",
"prettier": "^3.3.3",
"starknet": "^6.11.0"
"starknet": "^6.11.0",
"tailwind": "^3.0.0",
"tailwindcss": "^3.0.0"
}
}
10 changes: 9 additions & 1 deletion frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@ function App() {
const isNarrowSidebar = narrowSidebarPaths.includes(location.pathname);

return (
<div className={`${location.pathname === '/' ? 'home' : isNarrowSidebar ? 'App narrow-sidebar' : 'App'}`}>
<div
className={`bg-dashboard-bg font-text ${
location.pathname === '/'
? 'relative flex flex-col justify-center text-secondary text-center w-full pointer-events-auto'
: isNarrowSidebar
? 'bg-[url("../public/desktop-background.png")] bg-no-repeat bg-cover min-h-screen bg-center pl-[60px]'
: 'bg-[url("../public/desktop-background.png")] bg-no-repeat bg-cover min-h-screen bg-center'
}`}
>
<Notifier />
{showModal &&
createPortal(
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/home/home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function Home() {
];

return (
<div className="home">
<div className="relative flex flex-col justify-center text-secondary text-center w-full pointer-events-auto">
<div className="container">
<div>
{decorationData.map((decoration, index) => (
Expand Down
56 changes: 55 additions & 1 deletion frontend/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
@import url('https://fonts.googleapis.com/css2?family=Allerta+Stencil&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Rethink+Sans:ital,wght@0,400..800;1,400..800&display=swap');
/* @import url('https://fonts.googleapis.com/css2?family=Allerta+Stencil&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Rethink+Sans:ital,wght@0,400..800;1,400..800&display=swap');
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
--text-font: 'Rethink Sans', sans-serif;
Expand Down Expand Up @@ -116,4 +120,54 @@ a.svelte-1mtuslq.svelte-1mtuslq {
background-position: 50% 40%;
height: 100%;
}
} */


@import url('https://fonts.googleapis.com/css2?family=Allerta+Stencil&family=Inter:wght@100..900&family=Open+Sans:wght@300..800&family=Rethink+Sans:wght@400..800&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Tailwind configuration in tailwind.config.js */
:root {
--backdrop-filter: blur(12px);
--card-box-shadow: inset 4px 4px 9px 0 rgba(153, 234, 255, 0.25), 0 4px 4px 0 rgba(0, 0, 0, 0.15);
--thumb-image: url('./assets/icons/slider-thumb.svg');
}

body {
@apply overflow-x-hidden;
}

main {
@apply overflow-hidden;
}

* {
@apply m-0 p-0 box-border font-sans;
}

a {
@apply no-underline;
}

li {
@apply list-none;
}

a.svelte-1mtuslq.svelte-1mtuslq {
@apply hidden;
}

.App {
@apply min-h-screen bg-cover bg-center;
background-image: url('../public/desktop-background.png');
}

@media (max-width: 768px) {
.App {
background-image: url('../public/mobile-background.png');
@apply bg-center h-auto;
}
}
127 changes: 127 additions & 0 deletions frontend/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
const plugin = require('tailwindcss/plugin');

module.exports = {
content: ['./src/**/*.{html,js,ts,jsx,tsx}'], // Update paths based on your project
theme: {
extend: {
colors: {
primary: '#fff',
'dashboard-bg': 'rgba(11, 12, 16, 1)',
'primary-color': '#0b0c10',
black: '#000',
brand: '#74d6fd',
pink: '#e01dee',
secondary: '#e7ecf0',
'secondary-color': '#1a1c24',
'collateral-color': '#1d9259',
'borrow-color': '#f42222',
'spinner-bgn': 'rgba(0, 0, 0, 0.5)',
'spinner-content': '#393939',
'footer-bg-color': '#00000d',
'footer-text-color': '#e7ebf5',
'footer-line-color': 'rgba(231, 235, 245, 0.2)',
'footer-divider-bg': '#201338',
gray: '#83919f',
'light-purple': '#36294e',
'dark-purple': '#120721',
'light-blue': '#74d5fd',
'slider-gray': '#393942',
'status-opened': '#1edc9e',
'status-closed': '#433b5a',
'status-pending': '#83919f',
'success-color': '#4caf50',
'error-color': '#ff5a5f',
'color-overlay': 'rgba(0, 0, 0, 0.5)',
bg: '#120721',
'border-color': '#201338',
'stormy-gray': '#83919f',
'deep-purple': '#120721',
'dark-background': '#130713',
'light-dark-background': '#130713',
'text-gray': '#798795',
'modal-border': '#170f2e',
'warning-colour': '#bdc000',
'warning-colour-alt': '#272a0a',
'warning-text-colour': '#f0f0f0',
'nav-button-hover': '#49abd2',
'nav-divider-bg': '#36294e',
'header-bg': 'rgba(7, 0, 22, 0.8)',
'second-primary': '#fdfdfd',
'plain-button-bg': '#0e0a16',
'header-button-bg': '#120721',
},
fontFamily: {
text: ['Rethink Sans', 'sans-serif'],
primary: ['Open Sans', 'sans-serif'],
third: ['Allerta Stencil', 'sans-serif'],
inter: ['Inter', 'sans-serif'],
},
backgroundImage: {
app: "url('../public/desktop-background.png')",
'app-mobile': "url('../public/mobile-background.png')",
gradient: 'linear-gradient(73deg, #74d6fd 1.13%, #e01dee 103.45%)',
'button-gradient': 'linear-gradient(55deg, #74d6fd 0%, #e01dee 100%)',
'button-gradient-hover': 'linear-gradient(55deg, #74d6fd 0%, #74d6fd 100%)',
'button-gradient-active': 'linear-gradient(55deg, #58c4ef 0%, #58c4ef 100%)',
'second-gradient': 'linear-gradient(55deg, #e01dee 0%, #49abd2 49%)',
'border-gradient': 'linear-gradient(90deg, #49abd2 0%, #df1ced 99.5%)',
'blue-pink-gradient': 'linear-gradient(90deg, #74d6fd 0%, #e01dee 100%)',
'blue-pink-gradient-alt': 'linear-gradient(90deg, #49abd2 0%, #e01dee 100%)',
'blue-pink-gradient-alt2': 'linear-gradient(90deg, #49abd2 100%, #e01dee 100%)',
'card-bg-gradient': 'linear-gradient(135deg, rgba(116, 214, 253, 0.5) 0%, rgba(11, 12, 16, 0.5) 100%)',
},
boxShadow: {
card: 'inset 4px 4px 9px 0 rgba(153, 234, 255, 0.25), 0 4px 4px 0 rgba(0, 0, 0, 0.15)',
},
blur: {
card: '42.1875px',
backdrop: '12px',
},
borderWidth: {
'purple-border': '1px',
'midnight-purple-border': '1px',
'midnight-purple-hover-border': '1px',
},
},
},
plugins: [
plugin(function ({ addBase, addComponents }) {
// Add Base styles
addBase({
body: {
overflowX: 'hidden',
},
main: {
overflow: 'hidden',
},
'*': {
margin: '0',
padding: '0',
boxSizing: 'border-box',
fontFamily: "var(--font-family, 'Open Sans', sans-serif)",
},
a: {
textDecoration: 'none',
},
li: {
listStyleType: 'none',
},
});

// Add Custom Components
addComponents({
'.app': {
'@apply min-h-screen bg-cover bg-center': {},
backgroundImage: "url('../public/desktop-background.png')",
},
'@media (max-width: 768px)': {
'.app': {
backgroundImage: "url('../public/mobile-background.png')",
backgroundPosition: '50% 40%',
height: '100%',
},
},
});
}),
],
};
Loading

0 comments on commit f45db69

Please sign in to comment.