Vue Scaffold - SPA from Scratch to PROD #Animation #Integrated Components #MediaMixins #Dedicated Data Folders #Ready Template
![Flexi Skeleton FE - Scaffolded Vue for building powerful SPA’s ]
Full configured Vue SPA Skeleton made by me
👉 To get a better understanding how this actually works, I encourage you to check the whole description below.
👉 Create .env file. Inside set up the VUE_APP_API_CLIENT to ‘local’ in order to fetch data from json file stored in data folder. (Default)
👉 Dont modify vue.config.json
👉 App looks well on mostly used browsers like Chrome, Edge, Firefox and Safari.
We dont need to register FlexiVue components separetely. They are already integrated with the skeleton.
We can simply use them:
<flexi-topcard :inputData="inputData.topCard" v-if="inputData.topCard" />
<flexi-nav :inputData="inputData.navigationSections" v-show="!isNavOpen" />
Or with slots:
<flexi-section :inputData="inputData.services" v-show="inputData.services.cards">
<template v-slot:content>
<flexi-card v-for="(value, key) in inputData.services.cards" :key="key" :inputData="value" />
</template>
<template v-slot:button>
<flexi-button
@button-clicked="sendEmail(inputData.services.buttonLink)"
:text="inputData.services.buttonText"
/>
</template>
</flexi-section>
All components are reusable and could be modified with slots as much as possible. Some of the components have scoped slots and most of the buttons send events on click.
<flexi-slider
:inputData="inputData.services.cards">
<template v-slot:item="slotProps">
<span class="slider__item" v-html="slotProps.currentItem.content" />
<i class="icon" :class="slotProps.currentItem.class"></i>
</template>
</flexi-slider>
Add/Remove Icons into icons/index.js and than easy use them into components.
import Vue from 'vue';
import { library } from '@fortawesome/fontawesome-svg-core';
import {
faSpinner
// here you can import font awesome component
} from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
library.add(
faSpinner
// add FA icons into library
);
Than into components:
<font-awesome-icon icon="bold" size="2x" />
Usage of modern and minimalistic spinners throught the components are really easy. Everything that need is just to import and register them inside animation/spinners/index.js file.
See more at: 👉 https://github.com/epicmaxco/epic-spinners
import Vue from 'vue';
import { FlowerSpinner } from "epic-spinners";
Vue.component('flower-spinner', FlowerSpinner);
Than in Vue components we just need to call them properly:
<flower-spinner />
V-tooltip directive could be attached on every html element. It will show on hover.
<sample-component v-tooltip="'Some good tooltip.'" />
Position and place:
<sample-component v-tooltip.bottom-center="'I am bottom centered.'" />
src
├── assets
│ ├── img
│ | ├── ab.jpg
| | ├── about_grey.jpg
| | └── parallax.jpg
| |
| └──scss
| ├── application.scss
| └── parts
| ├── _buttons.scss
| ├── _colors.scss
| ├── _font.scss
| ├── _footer.scss
| ├── _layout.scss
| ├── _media-mixins.scss
| ├── _navigation.scss
| ├── _section.scss
| ├── _topcard.scss
| └── _variables.scss
|
├── components
│ └── reusable
| └── SampleComponent.vue
|
├── router
| └── index.js
|
├── services
| ├── local
| | └── index.js
| |
| └── server
| └── index.js
|
├── static
| ├── constants
| | └── routes.js
| |
| └── data
| └── items.json
|
├── store
│ ├── actions.js
│ ├── getters.js
| ├── helpers.js
│ ├── index.js
│ ├── mutations.js
│ └── state.js
│
├── views
│ └── Home.vue
|
├── App.vue
└── main.js
──assets
├── img
| ├── ab.jpg
| ├── about_grey.jpg
| └── parallax.jpg
|
└──scss
├── application.scss
└── parts
├── _buttons.scss
├── _colors.scss
├── _font.scss
├── _footer.scss
├── _layout.scss
├── _media-mixins.scss
├── _navigation.scss
├── _section.scss
├── _topcard.scss
└── _variables.scss
──components
└── reusable
├── FlexiButton.vue
├── FlexiCard.vue
├── FlexiContentLine.vue
├── FlexiFooter.vue
├── FlexiNav.vue
├── FlexiScrollLink.vue
├── FlexiSection.vue
├── FlexiTimeline.vue
├── FlexiTopcard.vue
└── FlexiWidget.vue
──routes
└── index.js
── services
├── local
│ └── index.js
└── server
└── index.js
── static
├── constants
│ └── routes.js
└── data
└── items.json
──store
├── actions.js
├── getters.js
├── helpers.js
├── index.js
├── mutations.js
└── state.js
Views folder contains Home.vue which runs inside
App.vue component is the core component, which contains the entire skeleton of the application.
<div id="app">
<router-view/>
<flexi-footer :inputData="inputData.social" />
</div>
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
.nav {
display: flex;
justify-content: space-around;
width: 100%;
align-items: center;
position: sticky;
top: 0;
z-index: 9999;
&__container {
...
}
@include for-mobile {
//some code for mobie devices
}
@include for-tablet {
//code
}
I FlexiSection
<div v-show="inputData.contentLine" class="section__line">
<slot name="content-line">
<flexi-content-line :text="inputData.contentLine" />
</slot>
</div>
<div v-show="inputData.widgets" class="section__widget">
<slot name="widgets">
<flexi-widget v-for="(widget, key) in inputData.widgets" :key="key" :widget="widget" />
</slot>
</div>
}