-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from NUSComputingDev/feature-template
Add base template
- Loading branch information
Showing
11 changed files
with
1,194 additions
and
76 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,79 @@ | ||
import { useState } from 'react' | ||
import reactLogo from './assets/react.svg' | ||
import viteLogo from '/vite.svg' | ||
import './App.css' | ||
import { useState } from "react"; | ||
import "./App.css"; | ||
import { Routes, Route, Link } from "react-router-dom"; | ||
import menu from "/menu.svg"; //eslint-disable-line | ||
import close from "/close.svg"; //eslint-disable-line | ||
import { Home } from "./pages"; | ||
|
||
function App() { | ||
const [count, setCount] = useState(0) | ||
const [toggle, setToggle] = useState(false); | ||
|
||
return ( | ||
<> | ||
<div> | ||
<a href="https://vitejs.dev" target="_blank"> | ||
<img src={viteLogo} className="logo" alt="Vite logo" /> | ||
</a> | ||
<a href="https://react.dev" target="_blank"> | ||
<img src={reactLogo} className="logo react" alt="React logo" /> | ||
</a> | ||
</div> | ||
<h1>Vite + React</h1> | ||
<div className="card"> | ||
<button onClick={() => setCount((count) => count + 1)}> | ||
count is {count} | ||
</button> | ||
<p> | ||
Edit <code>src/App.jsx</code> and save to test HMR | ||
</p> | ||
</div> | ||
<p className="read-the-docs"> | ||
Click on the Vite and React logos to learn more | ||
</p> | ||
{/* Header */} | ||
<header> | ||
{/* Navigation bar */} | ||
<div className="w-full flex justify-between items-center"> | ||
{/* Logo */} | ||
<div className=" text-white font-bold text-2xl"> | ||
<Link to="/"> | ||
<h1>NUSComputing</h1> | ||
</Link> | ||
</div> | ||
|
||
{/* Navigation Links */} | ||
<div className="relative z-20 text-white md:flex hidden list-none flex-row justify-between items-center flex-initial text-xl"> | ||
<Link to="" className="mx-6 hover:scale-[1.1]"> | ||
Foo | ||
</Link> | ||
<Link to="" className="mx-6 hover:scale-[1.1]"> | ||
Foo | ||
</Link> | ||
<Link to="" className="mx-6 hover:scale-[1.1]"> | ||
Bar | ||
</Link> | ||
</div> | ||
|
||
{/* Mobile Navigation */} | ||
<div className="md:hidden flex flex-1 items-end justify-end"> | ||
<img | ||
src={toggle ? close : menu} | ||
alt="menu" | ||
className="w-[28px] h-[28px] object-contain cursor-pointer" | ||
onClick={() => setToggle(!toggle)} | ||
/> | ||
<div | ||
className={`${ | ||
!toggle ? "hidden" : "flex" | ||
} p-6 mx-4 my-2 top-20 right-0 absolute z-20 rounded-xl`} | ||
> | ||
<div className="flex justify-end items-center flex-1 flex-col gap-4 text-white"> | ||
<Link to="" className="mx-6 hover:scale-[1.1]"> | ||
Foo | ||
</Link> | ||
<Link to="" className="mx-6 hover:scale-[1.1]"> | ||
Foo | ||
</Link> | ||
<Link to="" className="mx-6 hover:scale-[1.1]"> | ||
Bar | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</header> | ||
|
||
{/* Main content */} | ||
<main className="w-full min-h-[100vh] overflow-hidden"> | ||
<Routes> | ||
<Route path="/" element={<Home />} /> | ||
</Routes> | ||
</main> | ||
|
||
{/* Footer */} | ||
<footer>NUSComputing</footer> | ||
</> | ||
) | ||
); | ||
} | ||
|
||
export default App | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import App from './App.jsx' | ||
import './index.css' | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import App from "./App.jsx"; | ||
import "./index.css"; | ||
import { BrowserRouter } from "react-router-dom"; | ||
|
||
ReactDOM.createRoot(document.getElementById('root')).render( | ||
ReactDOM.createRoot(document.getElementById("root")).render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
) | ||
<BrowserRouter> | ||
<App /> | ||
</BrowserRouter> | ||
</React.StrictMode> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react' | ||
|
||
const Home = () => { | ||
return ( | ||
<div>Home</div> | ||
) | ||
} | ||
|
||
export default Home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Home from './Home' | ||
|
||
export { Home } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
|
||
module.exports = { | ||
content: ['./src/**/*.{js,jsx}'], | ||
theme: { | ||
extend: { | ||
colors: { | ||
primary: '#4a69bd', | ||
}, | ||
transitionTimingFunction: { | ||
'out-flex': 'cubic-bezier(0.05, 0.6, 0.4, 0.9)', | ||
}, | ||
screens: { | ||
xs: '480px', | ||
}, | ||
fontFamily: { | ||
inter: ['Inter var', 'sans-serif'], | ||
}, | ||
boxShadow: { | ||
card: '0 0 1px 0 rgba(189,192,207,0.06),0 10px 16px -1px rgba(189,192,207,0.2)', | ||
cardhover: '0 0 1px 0 rgba(189,192,207,0.06),0 10px 16px -1px rgba(189,192,207,0.4)', | ||
}, | ||
}, | ||
}, | ||
plugins: [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
import tailwindcss from 'tailwindcss' | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react()], | ||
base: "/comclub-website-2024/" | ||
base: "/", | ||
css: { | ||
postcss: { | ||
plugins: [tailwindcss()], | ||
}, | ||
} | ||
}) |