Browse Source

build: add es2019 lib

main
nicolas.marsal 3 years ago
parent
commit
3960cf4d61
No known key found for this signature in database
GPG Key ID: 268AB819B6453541
  1. 3
      src/assets/main.css
  2. 19
      src/components/common/WordCloud.vue
  3. 19
      src/components/experiences/MyExperiences.vue
  4. 8
      src/data/skills.ts
  5. 20
      src/stores/counter.ts
  6. 2
      tsconfig.config.json
  7. 5
      tsconfig.json
  8. 3
      vite.config.ts

3
src/assets/main.css

@ -14,6 +14,7 @@
font-size: 40px; font-size: 40px;
text-align: center; text-align: center;
padding-top: 12px; padding-top: 12px;
font-variant: small-caps;
} }
.main-left { .main-left {
@ -201,11 +202,13 @@
font-size: 36px; font-size: 36px;
text-align: left; text-align: left;
padding-left: 16px; padding-left: 16px;
font-variant: small-caps;
} }
.last-name { .last-name {
font-size: 40px; font-size: 40px;
text-align: right; text-align: right;
margin-right: 16px; margin-right: 16px;
font-variant: small-caps;
} }
.hobby { .hobby {

19
src/components/common/WordCloud.vue

@ -14,6 +14,11 @@
fontSize: word.size + 'px', fontSize: word.size + 'px',
fontFamily: word.font, fontFamily: word.font,
cursor: 'pointer', cursor: 'pointer',
fill:
selectedSkillStore.skill?.name === word.text
? '#FF0000'
: '#000000',
userSelect: 'none',
}" }"
:transform="`translate(${word.x}, ${word.y})rotate(${word.rotate})`" :transform="`translate(${word.x}, ${word.y})rotate(${word.rotate})`"
text-anchor="middle" text-anchor="middle"
@ -36,7 +41,7 @@
import cloud from "d3-cloud"; import cloud from "d3-cloud";
import skills from "@/data/skills"; import skills from "@/data/skills";
import { defineComponent } from "vue"; import { defineComponent } from "vue";
import type { Skill } from "@/data/types"; import { useSelectedSkill } from "@/stores/counter";
export default defineComponent({ export default defineComponent({
props: { props: {
@ -54,6 +59,12 @@ export default defineComponent({
mouseY: undefined, mouseY: undefined,
}; };
}, },
setup() {
const selectedSkillStore = useSelectedSkill();
return {
selectedSkillStore,
};
},
created() { created() {
this.computeWords(); this.computeWords();
// setInterval(() => { // setInterval(() => {
@ -75,7 +86,11 @@ export default defineComponent({
this.hover = false; this.hover = false;
}, },
highlightText(text: string) { highlightText(text: string) {
console.log(text); if (this.selectedSkillStore.skill?.name !== text) {
this.selectedSkillStore.set(text);
} else {
this.selectedSkillStore.unselect();
}
}, },
computeWords() { computeWords() {
const words: (cloud.Word & { size: number; fixed?: boolean })[] = const words: (cloud.Word & { size: number; fixed?: boolean })[] =

19
src/components/experiences/MyExperiences.vue

@ -24,7 +24,9 @@ import RightSection from "@/components/common/RightSection.vue";
class="my-experiences-mission" class="my-experiences-mission"
v-for="mission in experience.missions" v-for="mission in experience.missions"
:key="mission.description" :key="mission.description"
style="" :style="{
color: isSelected(mission) ? 'red' : 'black',
}"
> >
<div class="my-experiences-mission-skills"> <div class="my-experiences-mission-skills">
{{ mission.skills.map((s) => s.name).join(", ") }} {{ mission.skills.map((s) => s.name).join(", ") }}
@ -42,6 +44,9 @@ import RightSection from "@/components/common/RightSection.vue";
<script lang="ts"> <script lang="ts">
import experiences from "@/data/experiences"; import experiences from "@/data/experiences";
import { defineComponent } from "vue"; import { defineComponent } from "vue";
import { useSelectedSkill } from "@/stores/counter";
import { mapState } from "pinia";
import type { Mission } from "@/data/types";
export default defineComponent({ export default defineComponent({
name: "MyExperiences", name: "MyExperiences",
@ -50,6 +55,18 @@ export default defineComponent({
experiences: experiences, experiences: experiences,
}; };
}, },
computed: {
...mapState(useSelectedSkill, {
selectedSkill: "skill",
}),
},
methods: {
isSelected(mission: Mission) {
return mission.skills
.flatMap((s) => [...(s.parent ?? []), s])
.some((s) => s?.name === this.selectedSkill?.name);
},
},
}); });
</script> </script>

8
src/data/skills.ts

@ -19,28 +19,28 @@ const SpringBoot: Skill = { name: "SpringBoot", score: 0, parent: [Java] };
const Jee: Skill = { name: "JEE", score: 26, parent: [Java] }; const Jee: Skill = { name: "JEE", score: 26, parent: [Java] };
const Gwt: Skill = { name: "GWT", score: 4, parent: [Java, UX] }; const Gwt: Skill = { name: "GWT", score: 4, parent: [Java, UX] };
const Typescript: Skill = { name: "Typescript", score: 25 }; const Typescript: Skill = { name: "Typescript", score: 25 };
const Codecept: Skill = { name: "CodeceptJS", score: 25 };
const Javascript: Skill = { name: "Javascript", score: 19 }; const Javascript: Skill = { name: "Javascript", score: 19 };
const Angular: Skill = { name: "Angular", score: 17, parent: [Typescript, UX] }; const Angular: Skill = { name: "Angular", score: 17, parent: [Typescript, UX] };
const React: Skill = { name: "React", score: 17, parent: [Typescript, UX] }; const React: Skill = { name: "React", score: 17, parent: [Typescript, UX] };
const ReactNative: Skill = { const ReactNative: Skill = {
name: "React", name: "React Native",
score: 17, score: 17,
parent: [Typescript, UX], parent: [Typescript, UX],
}; };
const ExtJS: Skill = { name: "ExtJS", score: 14, parent: [Javascript, UX] }; const ExtJS: Skill = { name: "ExtJS", score: 14, parent: [Javascript, UX] };
const Bash: Skill = { name: "Bash", score: 0 }; const Bash: Skill = { name: "Bash", score: 0 };
const HtmlCss: Skill = { name: "HtmlCss", score: 0 }; const HtmlCss: Skill = { name: "HTML/CSS", score: 0 };
const Kotlin: Skill = { name: "Kotlin", score: 28 }; const Kotlin: Skill = { name: "Kotlin", score: 28 };
const Groovy: Skill = { name: "Groovy", score: 0 }; const Groovy: Skill = { name: "Groovy", score: 0 };
const DotNET: Skill = { name: ".NET", score: 0 }; const DotNET: Skill = { name: ".NET", score: 0 };
const CSHARP: Skill = { name: "C#", score: 0, parent: [DotNET] }; const CSHARP: Skill = { name: "C#", score: 0, parent: [DotNET] };
const WPF: Skill = { name: "WPF", score: 0, parent: [DotNET, UX] }; const WPF: Skill = { name: "WPF", score: 0, parent: [DotNET, UX] };
const Blend: Skill = { name: "Blend", score: 0, parent: [DotNET, UX] }; const Blend: Skill = { name: "Blend", score: 0, parent: [DotNET, UX] };
const Pencil: Skill = { name: "Blend", score: 0, parent: [UX] }; const Pencil: Skill = { name: "Pencil", score: 0, parent: [UX] };
const Agility: Skill = { name: "Agility", score: 0 }; const Agility: Skill = { name: "Agility", score: 0 };
const Scrum: Skill = { name: "Scrum", score: 0, parent: [Agility] }; const Scrum: Skill = { name: "Scrum", score: 0, parent: [Agility] };
const Tests: Skill = { name: "Tests", score: 0 }; const Tests: Skill = { name: "Tests", score: 0 };
const Codecept: Skill = { name: "CodeceptJS", score: 25, parent: [Tests] };
const UIAutomation: Skill = { name: "UIAutomation", score: 0, parent: [Tests] }; const UIAutomation: Skill = { name: "UIAutomation", score: 0, parent: [Tests] };
const JUnit: Skill = { name: "JUnit", score: 0, parent: [Tests, Java] }; const JUnit: Skill = { name: "JUnit", score: 0, parent: [Tests, Java] };
const Communication: Skill = { name: "Communication", score: 0 }; const Communication: Skill = { name: "Communication", score: 0 };

20
src/stores/counter.ts

@ -1,16 +1,20 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import type { Skill } from "@/data/types";
import mySkills from "@/data/skills";
export const useCounterStore = defineStore({ export const useSelectedSkill = defineStore({
id: "counter", id: "skill",
state: () => ({ state: () => ({
counter: 0, skill: undefined as Skill | undefined,
}), }),
getters: {
doubleCount: (state) => state.counter * 2,
},
actions: { actions: {
increment() { set(selectedSkill: string) {
this.counter++; this.skill = Object.keys(mySkills)
.map((p) => mySkills[p])
.find((skill: Skill) => skill.name === selectedSkill);
},
unselect() {
this.skill = undefined;
}, },
}, },
}); });

2
tsconfig.config.json

@ -3,6 +3,6 @@
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*"], "include": ["vite.config.*", "vitest.config.*", "cypress.config.*"],
"compilerOptions": { "compilerOptions": {
"composite": true, "composite": true,
"types": ["node"] "types": ["node"],
} }
} }

5
tsconfig.json

@ -6,7 +6,10 @@
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"]
} },
"lib": [
"es2019"
]
}, },
"references": [ "references": [

3
vite.config.ts

@ -10,6 +10,9 @@ export default defineConfig({
server: { server: {
port: 8311, port: 8311,
}, },
build: {
target: "es2019",
},
resolve: { resolve: {
alias: { alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)), "@": fileURLToPath(new URL("./src", import.meta.url)),

Loading…
Cancel
Save