Compare commits

...

2 Commits

Author SHA1 Message Date
Gianmarco Pettinato
64389fa258 base mobile menu done 2023-01-22 01:17:22 +01:00
Gianmarco Pettinato
cd55feca1e robe 2023-01-17 21:35:04 +01:00
36 changed files with 2324 additions and 14006 deletions

13
.eslintignore Normal file
View File

@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

20
.eslintrc copy.cjs Normal file
View File

@ -0,0 +1,20 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
}
};

13
.prettierignore Normal file
View File

@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

9
.prettierrc copy Normal file
View File

@ -0,0 +1,9 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}

15237
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,47 +2,49 @@
"name": "mycv",
"version": "0.0.1",
"scripts": {
"update-model": "json2ts ./src/model/schema.json ./src/model/job.d.ts",
"dev": "svelte-kit dev --host 0.0.0.0",
"build": "svelte-kit build",
"preview": "svelte-kit preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
"update-model": "json2ts ./src/lib/model/schema.json ./src/lib/model/job.d.ts",
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "playwright test",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test:unit": "vitest",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"@babel/preset-env": "^7.15.8",
"@sveltejs/adapter-static": "^1.0.0-next.20",
"@sveltejs/kit": "next",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/svelte": "^3.0.3",
"@types/jest": "^27.0.2",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"babel-jest": "^27.3.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-svelte3": "^3.2.1",
"jest": "^27.3.0",
"prettier": "^2.4.1",
"prettier-plugin-svelte": "^2.4.0",
"svelte": "^3.42.6",
"svelte-check": "^2.2.6",
"svelte-jester": "^2.1.5",
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-auto": "^1.0.0",
"@sveltejs/kit": "^1.0.0",
"@types/markdown-it": "^12.2.3",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte3": "^4.0.0",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"sass": "^1.57.1",
"svelte": "^3.54.0",
"svelte-check": "^3.0.1",
"svelte-meta-tags": "^2.5.5",
"svelte-preprocess": "^4.9.4",
"svelte-preprocess-markdown": "^2.7.3",
"svelte-scrollto": "^0.2.0",
"ts-jest": "^27.0.7",
"tslib": "^2.3.1",
"typescript": "^4.4.3"
"tslib": "^2.4.1",
"typescript": "^4.9.3",
"vite": "^4.0.0",
"vitest": "^0.25.3"
},
"type": "module",
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1",
"@fortawesome/svelte-fontawesome": "^0.2.0",
"json-schema-to-typescript": "^10.1.5",
"markdown-it": "^12.2.0",
"punycode": "^2.1.1"
"punycode": "^2.1.1",
"typesafe-i18n": "^5.20.0"
}
}

11
playwright.config.ts Normal file
View File

@ -0,0 +1,11 @@
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
webServer: {
command: 'npm run build && npm run preview',
port: 4173
},
testDir: 'tests'
};
export default config;

View File

@ -1,15 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<html lang="%lang%">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<link rel="stylesheet" href="/main.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Gianmarco Pettinato</title>
%svelte.head%
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>
<body id="svelte">
%svelte.body%
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@ -9,8 +9,9 @@ $text-color: #011936;
$border-color: #256EFF;
$button-border-color: #256EFF;
$min-tablet: 768px;
$min-tablet: 900px;
$min-desktop: 1024px;
$min-ultrawide: 1700px;
$default-border-radius:5px;
:root {

View File

@ -1,80 +0,0 @@
<script lang="ts"></script>
<div class="contacts">
<img src="/profile_pic.webp" alt="profile" class="profile" />
<div class="links">
<ul>
<li>
<a href="mailto://gianmarco@pettinato.eu"
><i class="fas fa-at" /> e-mail: gianmarco@pettinato.eu</a
>
</li>
<li>
<a href="https://t.me/jatus_93"><i class="fab fa-telegram-plane" /> telegram: @jatus_93</a>
</li>
<li>
<a href="https://twitter.com/jatus_93"><i class="fab fa-twitter" /> twitter: @jatus_93</a>
</li>
<li>
<a href="https://www.linkedin.com/in/gianmarco-pettinato/"
><i class="fab fa-linkedin-in" /> linkedin: Gianmarco Pettinato</a
>
</li>
</ul>
</div>
</div>
<style lang="scss">
@import '../app.scss';
img.profile {
border-radius: 50%;
max-width: 150px;
// border: solid 1px $border-color;
}
.contacts {
background-color: $basecolor2;
// border: solid 1px $border-color;
border-radius: $default-border-radius;
padding: 30px;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
margin: auto;
}
.links {
text-align: left;
ul {
padding: 0;
list-style-type: none;
line-height: 20px;
white-space: nowrap;
li {
padding: 0;
margin: 10px;
margin-left: 0px;
margin-right: 0px;
a {
font-size: 18px !important;
}
}
}
}
@media (min-width: $min-tablet) {
.contacts {
flex-direction: row;
margin: auto;
}
.links {
ul {
li {
a {
font-size: auto !important;
}
}
}
}
}
</style>

View File

@ -1,89 +0,0 @@
<script lang="ts">
import { scrollto } from 'svelte-scrollto';
export let currentLanguage = 'it';
export const menu = {
home: { it: 'Home', en: 'Home' },
job: { it: 'Esperienze', en: 'Experiences' },
school: { it: 'Formazione', en: 'Training' },
blog: { it: 'Blog', en: 'Blog' },
portfolio: { it: 'Portfolio', en: 'Portfolio' }
};
</script>
<div class="div-menu">
<div class="wrapper">
<a class="menu-element" href="/#top">
<span class="hide">{menu.home[currentLanguage]}</span><i class="fas fa-home" /></a
>
<a class="menu-element" href="#jobs"
><span class="hide">{menu.job[currentLanguage]}</span><i class="fas fa-user-tie" /></a
>
<a class="menu-element" href="#training"
><span class="hide">{menu.school[currentLanguage]}</span><i
class="fas fa-graduation-cap"
/></a
>
<a class="menu-element" href="#portfolio"
><span class="hide">{menu.portfolio[currentLanguage]}</span><i class="fas fa-user-clock" /></a
>
<a class="menu-element" href="/blog" alt={menu.blog[currentLanguage]}
><span class="hide">{menu.blog[currentLanguage]}</span><i class="fas fa-address-card" /></a
>
</div>
</div>
<style lang="scss">
@import '../app.scss';
@import '/node_modules/@fortawesome/fontawesome-free/css/all.css';
.hide {
@media (max-width: $min-tablet) {
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
}
}
.div-menu {
width: 100%;
max-width: 1024px;
}
.wrapper {
width: 100%;
display: flex;
}
a {
border-radius: $default-border-radius;
width: 50px;
margin: auto;
text-align: center;
padding: 5px;
i {
font-size: 22px;
margin: 5px;
}
}
a:hover {
background-color: $text-color;
color: white;
}
@media (min-width: $min-tablet) {
a {
width: 130px;
i {
font-size: unset;
}
}
}
@media (min-width: $min-desktop) {
a {
width: 150px;
}
}
</style>

View File

@ -20,7 +20,7 @@
align-items: center;
justify-content: center;
outline: 0.1px solid black;
background-image: linear-gradient(to right, #000000 2px, blue 100%);
background-image: linear-gradient(to right, transparent 40px, #000000 2px);
}
.inside {
width: 80px;

View File

@ -1,7 +1,13 @@
<script lang="ts">
import Contacts from './Contacts.svelte';
import Skills from './Skills.svelte';
export let currentLanguage = 'it';
export let currentLanguage: CurrentLanguage = 'it';
import { FontAwesomeIcon } from '@fortawesome/svelte-fontawesome';
import { faDownload } from '@fortawesome/free-solid-svg-icons';
import { library, findIconDefinition } from '@fortawesome/fontawesome-svg-core';
library.add(faDownload);
const downloadDefinition = findIconDefinition({ prefix: 'fas', iconName: 'download' });
import type { CurrentLanguage, LanguagePair } from '$lib/types';
const whoIt =
"Ciao! Sono Gianmarco Pettinato, mi sono laureato in scienze informatiche e sono uno sviluppatore full-stack.\
Ho famigliarità con diversi linguaggi e framework, sia front-end che back-end.\
@ -17,13 +23,19 @@
Among my skill-set, there is the administration of the CI/CD environment with Docker.\
I'm interested in the IoT world and Wearable tech. In my free time, I like to manage my GNU/Linux home server and build PCs.";
const who = {
const who: LanguagePair = {
it: whoIt,
en: whoEn
};
const cvUrl: LanguagePair = { it: '/curriculum_it.pdf', en: '/curriculum_en.pdf' };
</script>
<div class="aboutMe">
<div class="title">
<h1>Gianmarco Pettinato</h1>
<h2>Software developer</h2>
</div>
<Contacts />
<div class="whoIAm">
<p>
@ -32,22 +44,15 @@
</div>
<div class="cv">
<div>
<a rel="external" href="/curriculum_it.pdf"
>curriculum_it.pdf <i class="fas fa-download" />
</a>
</div>
<div>
<a rel="external" href="/curriculum_en.pdf"
>curriculum_en.pdf <i class="fas fa-download" />
<a rel="external" href={cvUrl[currentLanguage]}
>curriculum<i><FontAwesomeIcon icon={downloadDefinition} /></i>
</a>
</div>
</div>
<Skills />
</div>
<style lang="scss">
@import '/node_modules/@fortawesome/fontawesome-free/css/all.css';
@import '../app.scss';
@import '../../app.scss';
.cv {
width: 80%;
margin: auto;
@ -64,5 +69,11 @@
border-radius: $default-border-radius;
padding: 30px;
margin: 10px;
.title {
display: none;
@media (min-width: $min-tablet) {
display: unset;
}
}
}
</style>

View File

@ -0,0 +1,104 @@
<script lang="ts">
import { FontAwesomeIcon } from '@fortawesome/svelte-fontawesome';
import { faAt } from '@fortawesome/free-solid-svg-icons';
import { faTelegramPlane, faTwitter, faLinkedin } from '@fortawesome/free-brands-svg-icons';
import * as svgCore from '@fortawesome/fontawesome-svg-core';
svgCore.library.add(faTelegramPlane);
svgCore.library.add(faTwitter);
svgCore.library.add(faLinkedin);
svgCore.library.add(faAt);
const telegramLookup: svgCore.IconLookup = { prefix: 'fab', iconName: 'telegram-plane' };
const twitterLookup: svgCore.IconLookup = { prefix: 'fab', iconName: 'twitter' };
const linkedinLookup: svgCore.IconLookup = { prefix: 'fab', iconName: 'linkedin' };
const atLookup: svgCore.IconLookup = { prefix: 'fas', iconName: 'at' };
const telegramIconDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(telegramLookup);
const twitterIconDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(twitterLookup);
const linkedinIconDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(linkedinLookup);
const atIconDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(atLookup);
</script>
<div class="contacts">
<img src="/profile_pic.webp" alt="profile" class="profile" />
<div class="links">
<ul>
<li>
<a href="mailto://gianmarco@pettinato.eu"
><i><FontAwesomeIcon icon={atIconDefinition} /></i> e-mail: gianmarco@pettinato.eu</a
>
</li>
<li>
<a href="https://t.me/jatus_93"
><i><FontAwesomeIcon icon={telegramIconDefinition} /></i> telegram: @jatus_93</a
>
</li>
<li>
<a href="https://twitter.com/jatus_93"
><i><FontAwesomeIcon icon={twitterIconDefinition} /></i> twitter: @jatus_93</a
>
</li>
<li>
<a href="https://www.linkedin.com/in/gianmarco-pettinato/"
><i><FontAwesomeIcon icon={linkedinIconDefinition} /></i> linkedin: Gianmarco Pettinato</a
>
</li>
</ul>
</div>
</div>
<style lang="scss">
@import '../../app.scss';
img.profile {
border-radius: 50%;
max-width: 150px;
// border: solid 1px $border-color;
}
.contacts {
background-color: $basecolor2;
// border: solid 1px $border-color;
border-radius: $default-border-radius;
padding: 30px;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
margin: auto;
}
.links {
text-align: left;
ul {
padding: 0;
list-style-type: none;
line-height: 20px;
white-space: nowrap;
li {
padding: 0;
margin: 10px;
margin-left: 0px;
margin-right: 0px;
a {
font-size: 18px !important;
}
}
}
}
@media (min-width: $min-tablet) {
.contacts {
flex-direction: row;
margin: auto;
}
.links {
ul {
li {
a {
font-size: auto !important;
}
}
}
}
}
</style>

View File

@ -7,9 +7,10 @@
breaks: true,
linkify: true
});
import type { Schema } from 'src/model/job';
import type { Schema } from '$lib/model/job';
import type { CurrentLanguage } from '$lib/types';
export let job: Schema;
export let currentLanguage = '';
export let currentLanguage: CurrentLanguage = 'it';
</script>
<div class="job-container">
@ -23,7 +24,7 @@
{@html md.render(job.content[currentLanguage])}
</div>
<div class="added-info">
{#if job.year.lenght != 0}
{#if job.year}
Date: {job.year.start}{#if job.year.end.length != 0}; {job.year.end} {/if}
{/if}
<div>
@ -57,7 +58,7 @@
</div>
<style lang="scss">
@import '../app.scss';
@import '../../app.scss';
.text-content {
margin: auto;
text-align: justify;

View File

@ -1,7 +1,8 @@
<script lang="ts">
import type { Schema } from 'src/model/job';
import type { Schema } from '$lib/model/job';
import type { CurrentLanguage } from '$lib/types';
import JobElement from './JobElement.svelte';
export let currentLanguage = '';
export let currentLanguage: CurrentLanguage = 'it';
export let isBlogContainer = false;
export let jobs: Schema[] = [];
</script>
@ -19,7 +20,7 @@
</div>
<style lang="scss">
@import '../app.scss';
@import '../../app.scss';
.jobs-container {
display: flex;
justify-content: space-between;

View File

@ -0,0 +1,20 @@
<script lang="ts">
import type { CurrentLanguage } from '$lib/types';
export let currentLanguage: CurrentLanguage = 'it';
</script>
<div>
<button
class="custom-button {currentLanguage == 'it' ? 'custom-button-active' : ''}"
on:click={() => {
currentLanguage = 'it';
}}>it</button
>
<button
class="custom-button {currentLanguage == 'en' ? 'custom-button-active' : ''}"
on:click={() => {
currentLanguage = 'en';
}}>en</button
>
</div>

View File

@ -0,0 +1,119 @@
<script lang="ts">
import { FontAwesomeIcon } from '@fortawesome/svelte-fontawesome';
import * as svgIcons from '@fortawesome/free-solid-svg-icons';
import * as svgCore from '@fortawesome/fontawesome-svg-core';
import type { CurrentLanguage, LanguagePair, MenuEntry } from '$lib/types';
svgCore.library.add(svgIcons.faHome);
svgCore.library.add(svgIcons.faUserTie);
svgCore.library.add(svgIcons.faGraduationCap);
svgCore.library.add(svgIcons.faUserClock);
svgCore.library.add(svgIcons.faAddressCard);
svgCore.library.add(svgIcons.faBars);
svgCore.library.add(svgIcons.faGlobeEurope);
const homeLookup: svgCore.IconLookup = { prefix: 'fas', iconName: 'home' };
const userTieLookup: svgCore.IconLookup = { prefix: 'fas', iconName: 'user-tie' };
const graduationCapLookup: svgCore.IconLookup = { prefix: 'fas', iconName: 'graduation-cap' };
const userClockLookUp: svgCore.IconLookup = { prefix: 'fas', iconName: 'user-clock' };
const addressCardLookUp: svgCore.IconLookup = { prefix: 'fas', iconName: 'address-card' };
const homeIconDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(homeLookup);
const userTieDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(userTieLookup);
const graduationDefinition: svgCore.IconDefinition =
svgCore.findIconDefinition(graduationCapLookup);
const userClockDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(userClockLookUp);
const addressCardDefinition: svgCore.IconDefinition =
svgCore.findIconDefinition(addressCardLookUp);
export let currentLanguage: CurrentLanguage = 'it';
const menu: Record<MenuEntry, LanguagePair> = {
home: { it: 'Home', en: 'Home' },
job: { it: 'Esperienze', en: 'Experiences' },
school: { it: 'Formazione', en: 'Training' },
blog: { it: 'Blog', en: 'Blog' },
portfolio: { it: 'Portfolio', en: 'Portfolio' }
};
</script>
<div>
<ul class="wrapper">
<li>
<a class="menu-element" href="#top">
<i>
<FontAwesomeIcon icon={homeIconDefinition} />
</i>
<span>{menu.home[currentLanguage]}</span></a
>
</li>
<li>
<a class="menu-element" href="#jobs"
><i>
<FontAwesomeIcon icon={userTieDefinition} />
</i><span>{menu.job[currentLanguage]}</span></a
>
</li>
<li>
<a class="menu-element" href="#training"
><i>
<FontAwesomeIcon icon={graduationDefinition} />
</i><span>{menu.school[currentLanguage]}</span></a
>
</li>
<li>
<a class="menu-element" href="#portfolio"
><i>
<FontAwesomeIcon icon={userClockDefinition} />
</i><span>{menu.portfolio[currentLanguage]}</span></a
>
</li>
<li>
<a class="menu-element" href="/blog"
><i>
<FontAwesomeIcon icon={addressCardDefinition} />
</i><span>{menu.blog[currentLanguage]}</span></a
>
</li>
</ul>
</div>
<style lang="scss">
@import '../../app.scss';
$menu-size: 1004px;
.wrapper {
width: 100%;
margin: 0;
padding: 0;
@media (min-width: $menu-size) {
width: $menu-size;
margin: auto;
}
}
a {
display: flex;
justify-content: center;
align-items: center;
background-color: white;
font-size: larger;
width: 100%;
height: 50px;
outline: 1px solid;
i {
margin-right: 10%;
}
}
a:hover {
background-color: rgb(176, 176, 176);
outline: 1px solid;
}
ul {
display: flex;
list-style-type: none;
width: 100%;
}
li {
display: inline-block;
width: 20%;
}
</style>

View File

@ -0,0 +1,164 @@
<script lang="ts">
import { tweened } from 'svelte/motion';
import { FontAwesomeIcon } from '@fortawesome/svelte-fontawesome';
import * as svgIcons from '@fortawesome/free-solid-svg-icons';
import * as svgCore from '@fortawesome/fontawesome-svg-core';
import type { CurrentLanguage, LanguagePair, MenuEntry } from '$lib/types';
export let currentLanguage: CurrentLanguage = 'it';
svgCore.library.add(svgIcons.faBars);
svgCore.library.add(svgIcons.faHome);
svgCore.library.add(svgIcons.faUserTie);
svgCore.library.add(svgIcons.faGraduationCap);
svgCore.library.add(svgIcons.faUserClock);
svgCore.library.add(svgIcons.faAddressCard);
svgCore.library.add(svgIcons.faBars);
svgCore.library.add(svgIcons.faX);
svgCore.library.add(svgIcons.faGlobeEurope);
const barsLookup: svgCore.IconLookup = { prefix: 'fas', iconName: 'bars' };
const globeLookup: svgCore.IconLookup = { prefix: 'fas', iconName: 'globe-europe' };
const homeLookup: svgCore.IconLookup = { prefix: 'fas', iconName: 'home' };
const userTieLookup: svgCore.IconLookup = { prefix: 'fas', iconName: 'user-tie' };
const graduationCapLookup: svgCore.IconLookup = { prefix: 'fas', iconName: 'graduation-cap' };
const userClockLookUp: svgCore.IconLookup = { prefix: 'fas', iconName: 'user-clock' };
const addressCardLookUp: svgCore.IconLookup = { prefix: 'fas', iconName: 'address-card' };
const xLookUp: svgCore.IconLookup = { prefix: 'fas', iconName: 'x' };
const homeIconDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(homeLookup);
const userTieDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(userTieLookup);
const graduationDefinition: svgCore.IconDefinition =
svgCore.findIconDefinition(graduationCapLookup);
const userClockDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(userClockLookUp);
const addressCardDefinition: svgCore.IconDefinition =
svgCore.findIconDefinition(addressCardLookUp);
const barsDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(barsLookup);
const xDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(xLookUp);
const globeDefinition: svgCore.IconDefinition = svgCore.findIconDefinition(globeLookup);
const menu: Record<MenuEntry, LanguagePair> = {
home: { it: 'Home', en: 'Home' },
job: { it: 'Esperienze', en: 'Experiences' },
school: { it: 'Formazione', en: 'Training' },
blog: { it: 'Blog', en: 'Blog' },
portfolio: { it: 'Portfolio', en: 'Portfolio' }
};
let menuContainer: Element;
let menuOpen = false;
function setOpen() {
menuOpen = !menuOpen;
const animation = menuContainer.animate([{ height: '0px' }, { height: '360px' }], {
duration: 100,
fill: 'both'
});
if (menuOpen) animation.play();
else animation.reverse();
}
</script>
<div class="menu-container">
<div class="header">
<button on:click={setOpen} tabindex="0" title="menu toggle">
{#if !menuOpen}<FontAwesomeIcon icon={barsDefinition} size="lg" />
{:else}
<FontAwesomeIcon icon={xDefinition} size="lg" />
{/if}
</button>
<div class="title">
<h1>Gianmarco Pettinato</h1>
<h2>Software developer</h2>
</div>
</div>
<ul class="wrapper" bind:this={menuContainer}>
<li>
<a class="menu-element" href="#top">
<i>
<FontAwesomeIcon icon={homeIconDefinition} />
</i>
<span>{menu.home[currentLanguage]}</span></a
>
</li>
<li>
<a class="menu-element" href="#jobs"
><i>
<FontAwesomeIcon icon={userTieDefinition} />
</i><span>{menu.job[currentLanguage]}</span></a
>
</li>
<li>
<a class="menu-element" href="#training"
><i>
<FontAwesomeIcon icon={graduationDefinition} />
</i><span>{menu.school[currentLanguage]}</span></a
>
</li>
<li>
<a class="menu-element" href="#portfolio"
><i>
<FontAwesomeIcon icon={userClockDefinition} />
</i><span>{menu.portfolio[currentLanguage]}</span></a
>
</li>
<li>
<a class="menu-element" href="/blog"
><i>
<FontAwesomeIcon icon={addressCardDefinition} />
</i><span>{menu.blog[currentLanguage]}</span></a
>
</li>
</ul>
</div>
<style lang="scss">
@import '../../app.scss';
.header {
display: flex;
width: 100%;
padding-top: 10px;
height: 10%;
justify-content: space-between;
align-items: center;
button {
height: 80px;
width: 80px;
border: none;
font-size: 40px;
background: none;
}
}
.menu-container {
margin: 0;
padding: 0;
width: 80%;
margin: auto;
}
ul {
list-style-type: none;
overflow: hidden;
margin: 0;
padding: 0;
margin: auto;
}
a {
padding-left: 10px;
display: flex;
justify-content: start;
align-items: center;
background-color: white;
font-size: larger;
height: 60px;
border: 1px solid;
i {
margin-right: 10%;
}
}
a:hover {
background-color: rgb(176, 176, 176);
outline: 1px solid;
}
.wrapper {
height: 0px;
}
</style>

View File

@ -0,0 +1,37 @@
<script lang="ts"></script>
<div>
Hello
<div>
<h4>HTML</h4>
<div class="round_base">
<div class="inside"><div>percentage</div></div>
</div>
</div>
</div>
<style lang="scss">
.round_base {
width: 100px;
height: 100px;
background-color: yellow;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
outline: 0.1px solid black;
background-image: linear-gradient(to right, #000000 2px, blue 100%);
}
.inside {
width: 80px;
height: 80px;
background-color: white;
border-radius: 50%;
text-align: center;
vertical-align: middle;
outline: 0.1px solid black;
display: flex;
align-items: center;
justify-content: center;
}
</style>

View File

@ -1,13 +1,15 @@
<script lang="ts">
import MarkdownIt from 'markdown-it';
import data from '../model/training.json';
import type { Schema } from '$lib/model/job';
import type { CurrentLanguage } from '$lib/types';
const md = new MarkdownIt({
html: true,
xhtmlOut: true,
typographer: true
});
import data from '../model/training.json';
import type { Schema } from 'src/model/job';
export let currentLanguage = 'it';
export let currentLanguage: CurrentLanguage = 'it';
const training: Schema[] = data as Schema[];
</script>
@ -28,7 +30,7 @@
.training {
padding: 10px;
}
@import '../app.scss';
@import '../../app.scss';
.element {
border-radius: $default-border-radius;
background-color: white;

View File

@ -10,26 +10,21 @@ export interface Schema {
year: {
start: string;
end: string;
[k: string]: unknown;
};
title: {
en: string;
it: string;
[k: string]: unknown;
};
content: {
en: string;
it: string;
[k: string]: unknown;
};
collaborators: {
name: string;
surname: string;
ref: string;
[k: string]: unknown;
}[];
languages: string[];
tecnologies: string[];
images: string[];
[k: string]: unknown;
}

View File

@ -35,8 +35,6 @@
},
"title": {"en":"Jatus.tech my start-up","it":"La mia start-up Jatus.tech"},
"content": {
"en":"In 2021, I worked to open a start-up with an app idea.\n To do so, I learned a lot of different skills, including how to set up a server with all my services running in **Docker**, set up a **GitLab** server, **design and build** an application infrastructure, and set up a private registry for **npm** and **docker images**.\n Furthermore, I configured all the **automation pipelines** to streamline the software distribution in virtualized environments and build the application **proof of concept** to demo to potential customers.",
"it":"Nel corso del 2021 ho lavorato, per avviare una attività indipendente che si basa su una mia idea di servizio. Per far ciò, durante questo periodo ho imparato a creare un'infrastruttura di lavoro, su un server **GNU\/Linux** dove centralizzare le risorse con **GitLab** in container **Docker**.\n Per semplificare la distribuzione di elementi di sviluppo ho integrato un *repository* privato di pacchetti **npm** e immagini **Docker**. Oltre alle mansioni da sistemista e devops ho progettato e scritto il **Proof of concept** del mio servizio per dimostrarlo a potenziali clienti"
"en":"In 2021, I worked to open a start-up with an app idea.\nTo do so, I acquired skills in design and developing a software solution for the problem. I learnt how to set up a **CI/CD** pipeline with **Docker** and **Gitlab** and took confidence in **serverless** technologies like AWS.",
"it":"Nel corso del 2021 ho lavorato per avviare una mia attività indipendente, basata su unidea per una app che ritenevo, e ritengo, fattibile. In questo periodo ho dovuto ricoprire diversi ruoli per portar avanti questiniziativa. Di conseguenza ho imparato a svolgere le mansioni di analista e architetto, **devops** e sviluppo. \n In particolare, ho acquisito dimestichezza con i sistemi di **CI/CD** basati su **Docker** e nelluso di tecnologie **serverless**."
},

View File

@ -18,7 +18,8 @@
"required": [
"start",
"end"
]
],
"additionalProperties": false
},
"title": {
"type": "object",
@ -33,7 +34,8 @@
"required": [
"en",
"it"
]
],
"additionalProperties": false
},
"content": {
"type": "object",
@ -48,7 +50,8 @@
"required": [
"en",
"it"
]
],
"additionalProperties": false
},
"collaborators": {
"type": "array",
@ -69,7 +72,8 @@
"name",
"surname",
"ref"
]
],
"additionalProperties": false
}
},
"languages": {
@ -99,5 +103,6 @@
"languages",
"tecnologies",
"images"
]
],
"additionalProperties": false
}

13
src/lib/types.ts Normal file
View File

@ -0,0 +1,13 @@
export type CurrentLanguage = 'it' | 'en';
export type MenuEntry = 'home' | 'job' | 'school' | 'blog' | 'portfolio';
export type LanguagePair = {
[key in CurrentLanguage]: string;
};
const e: Record<MenuEntry, LanguagePair> = {
home: { it: 'Home', en: 'Home' },
job: { it: 'Esperienze', en: 'Experiences' },
school: { it: 'Formazione', en: 'Training' },
blog: { it: 'Blog', en: 'Blog' },
portfolio: { it: 'Portfolio', en: 'Portfolio' }
};

View File

@ -1,15 +1,17 @@
<script lang="ts">
import { MetaTags } from 'svelte-meta-tags';
import AboutMe from '$elem/AboutMe.svelte';
import Jobs from '$elem/Jobs.svelte';
import Menu from '$elem/Menu.svelte';
import Training from '$elem/Training.svelte';
import Data_jobs from '../model/jobs.json';
import Data_portfolio from '../model/portfolio.json';
import type { Schema } from 'src/model/job';
import type { CurrentLanguage } from '$lib/types';
import AboutMe from '$lib/elements/AboutMe.svelte';
import Jobs from '$lib/elements/Jobs.svelte';
import Menu from '$lib/elements/Menu.svelte';
import MenuMobile from '$lib/elements/MenuMobile.svelte';
import Training from '$lib/elements/Training.svelte';
import Data_jobs from '$lib/model/jobs.json';
import Data_portfolio from '$lib/model/portfolio.json';
import type { Schema } from '$lib/model/job';
let jobs: Schema[] = Data_jobs as Schema[];
let portfolio: Schema[] = Data_portfolio as Schema[];
let currentLanguage: string = 'it';
let currentLanguage: CurrentLanguage = 'it';
let titles = {
home: {
it: 'Gianmarco Pettinato',
@ -61,27 +63,14 @@
<main>
<!-- svelte-ignore a11y-invalid-attribute -->
<div class="language-selector" id="language-selector">
<button
class="custom-button {currentLanguage == 'it' ? 'custom-button-active' : ''}"
on:click={() => {
currentLanguage = 'it';
}}>it</button
>
<button
class="custom-button {currentLanguage == 'en' ? 'custom-button-active' : ''}"
on:click={() => {
currentLanguage = 'en';
}}>en</button
>
</div>
<div class="menu">
<div class="menu menu-desktop">
<Menu {currentLanguage} />
</div>
<div class="menu menu-mobile">
<MenuMobile {currentLanguage} />
</div>
<div id="home" class="default">
<h1>{titles.home[currentLanguage]}</h1>
<h2>Software developer</h2>
<AboutMe {currentLanguage} />
</div>
<div id="jobs" class="default">
@ -100,36 +89,28 @@
<style lang="scss">
@import '../app.scss';
.language-selector {
right: 0;
height: 30px;
text-align: center;
text-transform: uppercase;
padding-top: 10px;
display: flex;
flex-direction: row;
justify-content: end;
position: absolute;
z-index: 999;
@media (max-width: $min-desktop) {
width: 100%;
position: unset;
padding-bottom: 10px;
background-color: $basecolor2;
}
}
.menu {
background-color: $basecolor2;
position: sticky;
position: -webkit-sticky;
top: 0px;
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
border-bottom: solid #999 1px;
}
.menu-desktop {
display: none;
@media (min-width: $min-tablet) {
display: block;
}
}
.menu-mobile {
@media (min-width: $min-tablet) {
display: none;
}
}
.custom-button {
border: 0;
background: none;

View File

@ -1,11 +1,13 @@
<script lang="ts">
import { MetaTags } from 'svelte-meta-tags';
import Menu from '$elem/Menu.svelte';
import Jobs from '$elem/Jobs.svelte';
let currentLanguage: string = 'it';
import type { CurrentLanguage } from '$lib/types';
import Data_portfolio from '../../lib/model/portfolio.json';
import type { Schema } from '$lib/model/job';
import Menu from '$lib/elements/Menu.svelte';
import Jobs from '$lib/elements/Jobs.svelte';
let currentLanguage: CurrentLanguage = 'it';
let isBlogContainer = true;
import Data_portfolio from '../../model/portfolio.json';
import type { Schema } from 'src/model/job';
let jobs: Schema[] = Data_portfolio as Schema[];
let title = { it: 'I miei articoli', en: 'my blog posts' };
</script>
@ -68,7 +70,7 @@
<Menu {currentLanguage} />
</div>
<div id="portfolio" class="default">
<h2>{title[currentLanguage]}</h2>
<h2>{title.it}</h2>
<Jobs {jobs} {currentLanguage} {isBlogContainer} />
</div>
</main>

View File

@ -1,9 +1,10 @@
<script lang="ts">
import { MetaTags } from 'svelte-meta-tags';
import Menu from '$elem/Menu.svelte';
let currentLanguage: string = 'it';
import { page } from '$app/stores';
console.log($page)
import Menu from '$lib/elements/Menu.svelte';
let currentLanguage: CurrentLanguage = 'it';
import { page } from '$app/stores';
import type { CurrentLanguage } from '$lib/types';
console.log($page);
</script>
<MetaTags
@ -66,7 +67,7 @@
</main>
<style lang="scss">
@import '../../app.scss';
@import '../../../app.scss';
.language-selector {
right: 0;
height: 30px;

View File

@ -1,36 +1,20 @@
import preprocess from 'svelte-preprocess';
import adapter from '@sveltejs/adapter-static';
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite';
import {markdown} from 'svelte-preprocess-markdown';
import path from 'path';
import preprocess from 'svelte-preprocess';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: [preprocess({
preprocess: [vitePreprocess(), markdown(),preprocess({
sass: true,
typescript: true,
}), markdown()],
typescript: true,
})],
kit: {
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
vite:{
resolve:{
alias:{
$elem: path.resolve('src/elements'),
// $model: path.resolve('src/model')
}
}
},
hostHeader: 'X-Forwarded-Host',
adapter: adapter({
// default options are shown
pages: 'build',
assets: 'build',
fallback: null
}),
adapter: adapter()
}
};

37
svelte.config.old.js Normal file
View File

@ -0,0 +1,37 @@
import preprocess from 'svelte-preprocess';
import adapter from '@sveltejs/adapter-static';
import {markdown} from 'svelte-preprocess-markdown';
import path from 'path';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: [preprocess({
sass: true,
typescript: true,
}), markdown()],
kit: {
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
vite:{
resolve:{
alias:{
$elem: path.resolve('src/elements'),
// $model: path.resolve('src/model')
}
}
},
hostHeader: 'X-Forwarded-Host',
adapter: adapter({
// default options are shown
pages: 'build',
assets: 'build',
fallback: null
}),
}
};
export default config;

6
tests/test.ts Normal file
View File

@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test';
test('index page has expected h1', async ({ page }) => {
await page.goto('/');
expect(await page.textContent('h1')).toBe('Welcome to SvelteKit');
});

View File

@ -1,33 +1,17 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"moduleResolution": "node",
"module": "es2020",
"lib": ["es2020", "DOM"],
"target": "es2019",
/**
svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript
to enforce using \`import type\` instead of \`import\` for Types.
*/
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"resolveJsonModule": true,
/**
To have warnings/errors of the Svelte compiler at the correct position,
enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"allowJs": true,
"checkJs": true,
"paths": {
"$lib": ["src/lib"],
"$lib/*": ["src/lib/*"],
"$elem/*":["src/elements/*"],
"$model/*":["src/model/*"]
}
},
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}

11
vite.config.ts Normal file
View File

@ -0,0 +1,11 @@
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';
const config: UserConfig = {
plugins: [sveltekit()],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
}
};
export default config;