Added main page and basic axios query
This commit is contained in:
@@ -15,6 +15,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
|
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ export default defineComponent({
|
|||||||
position: relative;
|
position: relative;
|
||||||
.fs-content {
|
.fs-content {
|
||||||
margin-top: 70px;
|
margin-top: 70px;
|
||||||
padding-top: 20px;
|
min-height: calc(100vh - 70px);
|
||||||
min-height: calc(100vh - 90px);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
20
src/assets/scss/_animations.scss
Normal file
20
src/assets/scss/_animations.scss
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
@keyframes fadeInBg {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 33%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes paneBgAround {
|
||||||
|
0% {
|
||||||
|
background-position: -10vw 0%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
background-position: -20vw 0%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
background-position: -10vw 0%;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
@import 'fonts';
|
@import 'fonts';
|
||||||
@import 'variables';
|
@import 'variables';
|
||||||
|
@import 'animations';
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: $body-font-family;
|
font-family: $body-font-family;
|
||||||
@@ -11,7 +12,7 @@ body {
|
|||||||
background: $black;
|
background: $black;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6, .heading {
|
h1, h2, h3, h4, h5, h6 {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
font-family: $heading-font-family;
|
font-family: $heading-font-family;
|
||||||
font-weight: $fw-regular;
|
font-weight: $fw-regular;
|
||||||
@@ -21,6 +22,18 @@ h2 { font-size: 25px; }
|
|||||||
h3 { font-size: 22px; }
|
h3 { font-size: 22px; }
|
||||||
h4 { font-size: 18px; }
|
h4 { font-size: 18px; }
|
||||||
|
|
||||||
|
.heading {
|
||||||
|
&-1 {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
font-size: 30px;
|
||||||
|
font-weight: $fw-semibold;
|
||||||
|
}
|
||||||
|
&-2 {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
&.no-style {
|
&.no-style {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
@@ -23,12 +23,16 @@ export default defineComponent({
|
|||||||
link: "/"
|
link: "/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "About",
|
text: "Célestes",
|
||||||
link: "/about"
|
link: "/celestes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "Profile",
|
text: "À propos",
|
||||||
link: "/profile"
|
link: "/a-propos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Profil",
|
||||||
|
link: "/profil"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
16
src/components/celestials/CelestialCard.vue
Normal file
16
src/components/celestials/CelestialCard.vue
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<template>
|
||||||
|
<div class="celestial-card">
|
||||||
|
{{ celestial.name }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "celestial-card",
|
||||||
|
props: {
|
||||||
|
celestial: Object
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
31
src/components/celestials/CelestialsList.vue
Normal file
31
src/components/celestials/CelestialsList.vue
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<template>
|
||||||
|
<div class="celestial-list-wrapper">
|
||||||
|
<ul v-if="celestials" class="celestial-list grid no-style">
|
||||||
|
<li
|
||||||
|
v-for="(celestial, index) in celestials"
|
||||||
|
:key="index"
|
||||||
|
class="celestial-item"
|
||||||
|
>
|
||||||
|
<celestial-card :celestial="celestial" />
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
|
||||||
|
import CelestialCard from "@/components/celestials/CelestialCard.vue";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "celestial-list",
|
||||||
|
components: {
|
||||||
|
CelestialCard
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
celestials: {
|
||||||
|
type: Array
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -4,6 +4,9 @@ import Home from "../views/Home.vue";
|
|||||||
import About from "../views/About.vue";
|
import About from "../views/About.vue";
|
||||||
import Profile from "../views/Profile.vue";
|
import Profile from "../views/Profile.vue";
|
||||||
|
|
||||||
|
import Celestials from "../views/celestials/Celestials.vue";
|
||||||
|
import Celestial from "../views/celestials/Celestial.vue";
|
||||||
|
|
||||||
const routes: Array<RouteRecordRaw> = [
|
const routes: Array<RouteRecordRaw> = [
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
@@ -11,12 +14,23 @@ const routes: Array<RouteRecordRaw> = [
|
|||||||
component: Home
|
component: Home
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/about",
|
path: "/a-propos",
|
||||||
name: "About",
|
name: "About",
|
||||||
component: About
|
component: About
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/profile",
|
path: "/celestes",
|
||||||
|
name: "Célestes",
|
||||||
|
component: Celestials
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/celestes/:slug",
|
||||||
|
name: "Céleste",
|
||||||
|
component: Celestial,
|
||||||
|
props: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/profil",
|
||||||
name: "Profile",
|
name: "Profile",
|
||||||
component: Profile
|
component: Profile
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="about">
|
<section class="about">
|
||||||
<h2>About</h2>
|
<h2>About</h2>
|
||||||
</div>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="home">
|
<section class="home">
|
||||||
<h2 class="heading">Homepage</h2>
|
<div class="splash">
|
||||||
|
<h2 class="heading-1">Full Skies</h2>
|
||||||
|
<p class="heading-2">
|
||||||
|
L'application Full Skies explore les cieux à votre place !
|
||||||
|
</p>
|
||||||
|
<p class="heading-2">
|
||||||
|
Embarquez pour un voyage stellaire ; destination : le système solaire et
|
||||||
|
ses astres.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -16,21 +25,32 @@ export default defineComponent({
|
|||||||
.home {
|
.home {
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: inherit;
|
min-height: inherit;
|
||||||
padding: 0 20px;
|
padding: 0 10%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
&:after {
|
&:after {
|
||||||
display: block;
|
display: block;
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -20px;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 120vw;
|
||||||
background-image: url("/home_bg-min.jpg");
|
background-image: url("/home_bg-min.jpg");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
opacity: 0.5;
|
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
opacity: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
animation: fadeInBg 5s ease-out 1s 1 forwards,
|
||||||
|
paneBgAround 35s ease-in-out 1s infinite forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
.splash {
|
||||||
|
.heading-1 {
|
||||||
|
font-size: 50px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
13
src/views/celestials/Celestial.vue
Normal file
13
src/views/celestials/Celestial.vue
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<section class="celestial">
|
||||||
|
<h2>Single Celestial</h2>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "Celestial"
|
||||||
|
});
|
||||||
|
</script>
|
||||||
43
src/views/celestials/Celestials.vue
Normal file
43
src/views/celestials/Celestials.vue
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<template>
|
||||||
|
<section class="celestials">
|
||||||
|
<h2>Le système solaire</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<celestials-list :celestials="celestials" />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
import CelestialsList from "@/components/celestials/CelestialsList.vue";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "Celestials",
|
||||||
|
components: {
|
||||||
|
CelestialsList
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
celestials: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchBodies() {
|
||||||
|
return axios
|
||||||
|
.get("https://api.le-systeme-solaire.net/rest/bodies/")
|
||||||
|
.then(res => {
|
||||||
|
return res.data.bodies;
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
return [];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
this.celestials = await this.fetchBodies();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user