hero
This commit is contained in:
parent
ccc4337079
commit
81ae180f83
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,6 +11,7 @@ node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
yarn.lock
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
|
@ -10,6 +10,7 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap-icons": "^1.11.3",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
@ -19,9 +20,12 @@
|
||||
"@typescript-eslint/eslint-plugin": "^7.0.2",
|
||||
"@typescript-eslint/parser": "^7.0.2",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"autoprefixer": "^10.4.18",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.5",
|
||||
"postcss": "^8.4.35",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.1.4"
|
||||
}
|
||||
|
6
postcss.config.js
Normal file
6
postcss.config.js
Normal file
@ -0,0 +1,6 @@
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
42
src/App.css
42
src/App.css
@ -1,42 +0,0 @@
|
||||
#root {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 6em;
|
||||
padding: 1.5em;
|
||||
will-change: filter;
|
||||
transition: filter 300ms;
|
||||
}
|
||||
.logo:hover {
|
||||
filter: drop-shadow(0 0 2em #646cffaa);
|
||||
}
|
||||
.logo.react:hover {
|
||||
filter: drop-shadow(0 0 2em #61dafbaa);
|
||||
}
|
||||
|
||||
@keyframes logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
a:nth-of-type(2) .logo {
|
||||
animation: logo-spin infinite 20s linear;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
.read-the-docs {
|
||||
color: #888;
|
||||
}
|
34
src/App.tsx
34
src/App.tsx
@ -1,35 +1,9 @@
|
||||
import { useState } from 'react'
|
||||
import reactLogo from './assets/react.svg'
|
||||
import viteLogo from '/vite.svg'
|
||||
import './App.css'
|
||||
|
||||
function App() {
|
||||
const [count, setCount] = useState(0)
|
||||
import MainPage from "./pages/MainPage";
|
||||
|
||||
function App () {
|
||||
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.tsx</code> and save to test HMR
|
||||
</p>
|
||||
</div>
|
||||
<p className="read-the-docs">
|
||||
Click on the Vite and React logos to learn more
|
||||
</p>
|
||||
</>
|
||||
<MainPage />
|
||||
)
|
||||
}
|
||||
|
||||
export default App
|
||||
export default App;
|
BIN
src/assets/img/background.png
Normal file
BIN
src/assets/img/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 MiB |
BIN
src/assets/img/ocs/lunar-oc.png
Normal file
BIN
src/assets/img/ocs/lunar-oc.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 365 KiB |
BIN
src/assets/img/ocs/nola_3.png
Normal file
BIN
src/assets/img/ocs/nola_3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
15
src/components/MainBody.tsx
Normal file
15
src/components/MainBody.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
import React, { ReactNode } from "react";
|
||||
import BackroundImg from "../assets/img/background.png";
|
||||
|
||||
export default function MainBody({ children }: { children?: ReactNode }) {
|
||||
return (
|
||||
<div
|
||||
className="bg-background text-white bg-repeat-y"
|
||||
style={{
|
||||
backgroundImage: `url(${BackroundImg})`
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
23
src/components/forms/Button.tsx
Normal file
23
src/components/forms/Button.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import { CSSProperties, MouseEventHandler, ReactNode } from "react";
|
||||
|
||||
interface InButton {
|
||||
className?: string;
|
||||
style?: CSSProperties,
|
||||
onClick?: MouseEventHandler
|
||||
children?: ReactNode
|
||||
}
|
||||
|
||||
export default function Button ({
|
||||
className,
|
||||
style,
|
||||
onClick,
|
||||
children
|
||||
}: InButton) {
|
||||
return (
|
||||
<button
|
||||
className={`px-5 py-4 transition font-roboto-mono bg-finn border hover:bg-secondary border-border rounded-lg ${className}`}
|
||||
style={style}
|
||||
onClick={onClick}
|
||||
>{children}</button>
|
||||
)
|
||||
}
|
51
src/components/landing/Hero.tsx
Normal file
51
src/components/landing/Hero.tsx
Normal file
@ -0,0 +1,51 @@
|
||||
import Button from "../forms/Button";
|
||||
import NolaImg from "../../assets/img/ocs/nola_3.png";
|
||||
|
||||
type ShortNav = {
|
||||
name: string,
|
||||
target: string
|
||||
}
|
||||
|
||||
interface InHero {
|
||||
img: string;
|
||||
shortNav: ShortNav[]
|
||||
}
|
||||
|
||||
export default function Hero ({ img, shortNav }: InHero) {
|
||||
return (
|
||||
<div className="h-screen container flex items-center">
|
||||
<div className="grid grid-cols-8 gap-4 items-center relative">
|
||||
<div className="col-span-4">
|
||||
<h2 className="font-poppins text-6xl font-bold leading-normal">
|
||||
Lunar Vein: Arduino Client
|
||||
</h2>
|
||||
<p className="font-poppins text-xl">
|
||||
Open-source API Based serial communication, it helps you testing the arduino board and some components without any code.
|
||||
<small className="text-xs"> i don't even know anything about electronics and some IoT stuff lol</small>
|
||||
</p>
|
||||
<div className="flex flex-wrap gap-3 mt-5">
|
||||
{shortNav.map(({ name }, i) => (
|
||||
<Button key={i} className="text-sm">{name}</Button>
|
||||
))}
|
||||
</div>
|
||||
<div className="absolute left-0 -bottom-24">
|
||||
Made By
|
||||
<img className="inline" src={NolaImg} />
|
||||
Norman Andrians
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-1"></div>
|
||||
<div className="col-span-3">
|
||||
<picture title="Lunar">
|
||||
<img
|
||||
className="w-full h-auto"
|
||||
src={img}
|
||||
alt="Lunar"
|
||||
srcSet={img}
|
||||
/>
|
||||
</picture>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
10
src/css/index.css
Normal file
10
src/css/index.css
Normal file
@ -0,0 +1,10 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
|
||||
.container {
|
||||
@apply w-[1280px] mx-auto;
|
||||
}
|
30
src/data/control-navigation.json
Normal file
30
src/data/control-navigation.json
Normal file
@ -0,0 +1,30 @@
|
||||
[
|
||||
{
|
||||
"name": "Serial Monitor",
|
||||
"target": "#serial-monitor"
|
||||
},
|
||||
{
|
||||
"name": "LED",
|
||||
"target": "#led"
|
||||
},
|
||||
{
|
||||
"name": "RGB LED",
|
||||
"target": "#rgb-led"
|
||||
},
|
||||
{
|
||||
"name": "Piezo",
|
||||
"target": "#piezo"
|
||||
},
|
||||
{
|
||||
"name": "Moto Servo",
|
||||
"target": "#moto-servo"
|
||||
},
|
||||
{
|
||||
"name": "Photoresistor",
|
||||
"target": "#photoresistor"
|
||||
},
|
||||
{
|
||||
"name": "Ultrasonic sensor",
|
||||
"target": "#ultrasonic-sensor"
|
||||
}
|
||||
]
|
@ -1,68 +0,0 @@
|
||||
:root {
|
||||
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
font-weight: 400;
|
||||
|
||||
color-scheme: light dark;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
background-color: #242424;
|
||||
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
a {
|
||||
font-weight: 500;
|
||||
color: #646cff;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
a:hover {
|
||||
color: #535bf2;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
place-items: center;
|
||||
min-width: 320px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 3.2em;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 8px;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.6em 1.2em;
|
||||
font-size: 1em;
|
||||
font-weight: 500;
|
||||
font-family: inherit;
|
||||
background-color: #1a1a1a;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.25s;
|
||||
}
|
||||
button:hover {
|
||||
border-color: #646cff;
|
||||
}
|
||||
button:focus,
|
||||
button:focus-visible {
|
||||
outline: 4px auto -webkit-focus-ring-color;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
:root {
|
||||
color: #213547;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
a:hover {
|
||||
color: #747bff;
|
||||
}
|
||||
button {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import App from './App.tsx'
|
||||
import './index.css'
|
||||
import './css/index.css'
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<React.StrictMode>
|
||||
|
19
src/pages/MainPage.tsx
Normal file
19
src/pages/MainPage.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import MainBody from "../components/MainBody";
|
||||
import Hero from "../components/landing/Hero";
|
||||
|
||||
import LunarImg from "../assets/img/ocs/lunar-oc.png";
|
||||
|
||||
import ControlNav from "../data/control-navigation.json";
|
||||
|
||||
function MainPage () {
|
||||
return (<>
|
||||
<MainBody>
|
||||
<Hero
|
||||
img={LunarImg}
|
||||
shortNav={ControlNav}
|
||||
/>
|
||||
</MainBody>
|
||||
</>)
|
||||
}
|
||||
|
||||
export default MainPage;
|
26
tailwind.config.js
Normal file
26
tailwind.config.js
Normal file
@ -0,0 +1,26 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: [
|
||||
"./index.html",
|
||||
"./src/**/*.{ts,tsx,js,jsx}"
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
'primary': '#3A3AFF',
|
||||
'secondary': '#0B0B1D66',
|
||||
'finn': '#00000066',
|
||||
'danger': '#FF016C',
|
||||
'disabled': '#7373B0',
|
||||
'border': '#FFFFFF66',
|
||||
'background': '#06060C'
|
||||
},
|
||||
fontFamily: {
|
||||
'poppins': '"Poppins", sans-serif',
|
||||
'roboto-mono': '"Roboto Mono", monospace',
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user