-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45eadbe
commit 25de386
Showing
13 changed files
with
257 additions
and
0 deletions.
There are no files selected for viewing
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,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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,2 @@ | ||
save-exact = true | ||
package-lock = false |
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,23 @@ | ||
# Frontend Mentor Social Link Profile | ||
|
||
Here is the implementation in [Bau.js](https://github.com/grucloud/bau) of the [Frontend Mentor Social Link Profile code challenge](https://www.frontendmentor.io/challenges/social-links-profile-UG32l9m6dQ/hub) | ||
|
||
## Workflow | ||
|
||
Install the dependencies: | ||
|
||
```sh | ||
npm install | ||
``` | ||
|
||
Start a development server: | ||
|
||
```sh | ||
npm run dev | ||
``` | ||
|
||
Build a production version: | ||
|
||
```sh | ||
npm run build | ||
``` |
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,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link | ||
rel="icon" | ||
type="image/png" | ||
href="./assets/images/favicon-32x32.png" | ||
/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Social Link Profile | FrontendMentor</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
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,20 @@ | ||
{ | ||
"name": "frontendmentor-social-link-profile", | ||
"private": true, | ||
"version": "0.85.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.0.2", | ||
"vite": "^5.2.11" | ||
}, | ||
"dependencies": { | ||
"@grucloud/bau": "^0.85.0", | ||
"@grucloud/bau-css": "^0.85.0", | ||
"@grucloud/bau-ui": "^0.85.0" | ||
} | ||
} |
Binary file added
BIN
+3.61 KB
examples/social-link-profile/public/assets/images/avatar-jessica.jpeg
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { createContext, type Context } from "@grucloud/bau-ui/context"; | ||
import socialLinksProfile from "./socialLinksProfile"; | ||
|
||
import "./style.css"; | ||
|
||
const context = createContext(); | ||
|
||
const app = (context: Context) => { | ||
const { bau } = context; | ||
const { main } = bau.tags; | ||
|
||
const SocialLinksProfile = socialLinksProfile(context); | ||
|
||
return function () { | ||
return main(SocialLinksProfile()); | ||
}; | ||
}; | ||
|
||
const App = app(context); | ||
document.getElementById("app")?.replaceChildren(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { type Context } from "@grucloud/bau-ui/context"; | ||
|
||
export default function (context: Context) { | ||
const { bau, css } = context; | ||
const { h1, a, p, article, img, figure, figcaption, ul, li } = bau.tags; | ||
|
||
const LINKS = [ | ||
{ | ||
name: "GitHub", | ||
href: "https://github.com", | ||
}, | ||
{ | ||
name: "LinkedIn", | ||
href: "https://linkedin.com", | ||
}, | ||
{ | ||
name: "Instagram", | ||
href: "https://instagram.com", | ||
}, | ||
]; | ||
|
||
const className = css` | ||
margin: auto; | ||
max-width: 700px; | ||
padding: 1.5rem; | ||
display: flex; | ||
max-width: 500px; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 1rem; | ||
background-color: var(--grey-800); | ||
border-radius: 1rem; | ||
figure { | ||
display: flex; | ||
flex-direction: column; | ||
.profile-picture { | ||
width: 96px; | ||
border-radius: 50%; | ||
margin: auto; | ||
} | ||
figcaption { | ||
text-align: center; | ||
.location { | ||
color: var(--green); | ||
} | ||
} | ||
} | ||
p { | ||
text-align: center; | ||
} | ||
ul { | ||
align-self: stretch; | ||
padding: 0; | ||
li { | ||
list-style: none; | ||
background-color: var(--grey-700); | ||
border-radius: 0.5rem; | ||
margin: 1rem 0; | ||
display: flex; | ||
a { | ||
padding: 0.4rem 0; | ||
width: 100%; | ||
color: white; | ||
text-decoration: none; | ||
font-weight: 500; | ||
text-align: center; | ||
&:hover { | ||
text-decoration: underline; | ||
} | ||
} | ||
} | ||
} | ||
`; | ||
|
||
return function myComponent() { | ||
return article( | ||
{ class: className }, | ||
figure( | ||
img({ | ||
class: "profile-picture", | ||
src: "./assets/images/avatar-jessica.jpeg", | ||
alt: "Jessica Rendal", | ||
}), | ||
figcaption( | ||
h1("Jessica Rendal"), | ||
p({ class: "location" }, "London United Kingdom") | ||
) | ||
), | ||
p("Front-end developper and avid reader."), | ||
ul(LINKS.map(({ name, href }) => li(a({ href }, name)))) | ||
); | ||
}; | ||
} |
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,25 @@ | ||
@import url("https://fonts.googleapis.com/css2?family=Inter:[email protected]&display=swap"); | ||
|
||
* { | ||
margin: 0; | ||
box-sizing: border-box; | ||
} | ||
:root { | ||
--green: hsl(75, 94%, 57%); | ||
|
||
--white: hsl(0, 0%, 100%); | ||
|
||
--grey-700: hsl(0, 0%, 20%); | ||
--grey-800: hsl(0, 0%, 12%); | ||
--grey-900: hsl(0, 0%, 8%); | ||
} | ||
body { | ||
font-family: "Inter", sans-serif; | ||
background-color: var(--grey-900); | ||
color: var(--white); | ||
min-height: 100vh; | ||
padding: 2rem; | ||
@media (max-width: 600px) { | ||
padding: 0.4rem; | ||
} | ||
} |
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 @@ | ||
/// <reference types="vite/client" /> |
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,23 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"module": "ESNext", | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"skipLibCheck": true, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": ["src"] | ||
} |
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 { defineConfig } from "vite"; | ||
|
||
export default defineConfig(({ command, mode, ssrBuild }) => { | ||
return { | ||
server: { | ||
open: true, | ||
}, | ||
}; | ||
}); |