Skip to content

Commit

Permalink
initial landing-page setup
Browse files Browse the repository at this point in the history
  • Loading branch information
spearwolf committed Jun 16, 2024
1 parent 7134c6d commit 7490a6e
Show file tree
Hide file tree
Showing 18 changed files with 894 additions and 1 deletion.
24 changes: 24 additions & 0 deletions apps/landing-page/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# build output
dist/

# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# jetbrains setting folder
.idea/
4 changes: 4 additions & 0 deletions apps/landing-page/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions apps/landing-page/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
54 changes: 54 additions & 0 deletions apps/landing-page/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Astro Starter Kit: Basics

```sh
npm create astro@latest -- --template basics
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)

## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

```text
/
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
```

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the `public/` directory.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
16 changes: 16 additions & 0 deletions apps/landing-page/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {defineConfig} from 'astro/config';

// eslint-disable-next-line import/no-unresolved
import react from '@astrojs/react';

// eslint-disable-next-line import/no-unresolved
import tailwind from '@astrojs/tailwind';

// https://astro.build/config
export default defineConfig({
server: {
host: true,
port: 4322,
},
integrations: [react(), tailwind()],
});
50 changes: 50 additions & 0 deletions apps/landing-page/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "landing-page",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^3.5.0",
"@astrojs/tailwind": "^5.1.0",
"@spearwolf/twopoint5d": "workspace:*",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/three": "^0.165.0",
"astro": "^4.10.2",
"@astrojs/check": "^0.7.0",
"nanostores": "^0.10.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.4.4",
"three": "~0.165.0",
"typescript": "^5.4.5"
},
"nx": {
"targets": {
"dev": {
"dependsOn": [
"^build"
]
},
"start": {
"dependsOn": [
"^build"
]
},
"preview": {
"dependsOn": [
"build"
]
}
}
},
"devDependencies": {
"@tailwindcss/aspect-ratio": "^0.4.2"
}
}
22 changes: 22 additions & 0 deletions apps/landing-page/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "landing-page",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"root": "apps/landing-page",
"sourceRoot": "apps/landing-page/src",
"projectType": "application",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/landing-page/**/*.js",
"apps/landing-page/**/*.jsx",
"apps/landing-page/**/*.ts",
"apps/landing-page/**/*.tsx"
]
}
}
},
"tags": []
}
9 changes: 9 additions & 0 deletions apps/landing-page/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions apps/landing-page/src/components/Card.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
interface Props {
title: string;
body: string;
href: string;
}
const { href, title, body } = Astro.props;
---

<li class="link-card">
<a href={href}>
<h2>
{title}
<span>&rarr;</span>
</h2>
<p>
{body}
</p>
</a>
</li>
<style>
.link-card {
list-style: none;
display: flex;
padding: 1px;
background-color: #23262d;
background-image: none;
background-size: 400%;
border-radius: 7px;
background-position: 100%;
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.link-card > a {
width: 100%;
text-decoration: none;
line-height: 1.4;
padding: calc(1.5rem - 1px);
border-radius: 8px;
color: white;
background-color: #23262d;
opacity: 0.8;
}
h2 {
margin: 0;
font-size: 1.25rem;
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
p {
margin-top: 0.5rem;
margin-bottom: 0;
}
.link-card:is(:hover, :focus-within) {
background-position: 0;
background-image: var(--accent-gradient);
}
.link-card:is(:hover, :focus-within) h2 {
color: rgb(var(--accent-light));
}
</style>
1 change: 1 addition & 0 deletions apps/landing-page/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="astro/client" />
51 changes: 51 additions & 0 deletions apps/landing-page/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
interface Props {
title: string;
}
const { title } = Astro.props;
---

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Astro description" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
<slot />
</body>
</html>
<style is:global>
:root {
--accent: 136, 58, 234;
--accent-light: 224, 204, 250;
--accent-dark: 49, 10, 101;
--accent-gradient: linear-gradient(
45deg,
rgb(var(--accent)),
rgb(var(--accent-light)) 30%,
white 60%
);
}
html {
font-family: system-ui, sans-serif;
background: #13151a;
background-size: 224px;
}
code {
font-family:
Menlo,
Monaco,
Lucida Console,
Liberation Mono,
DejaVu Sans Mono,
Bitstream Vera Sans Mono,
Courier New,
monospace;
}
</style>
Loading

0 comments on commit 7490a6e

Please sign in to comment.