somewhere
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
/* eslint-disable no-undef */
|
||||
/// ///////////////////////////////////////////////////////////
|
||||
/// /////////////////// custom text splitor created by ammiiir1
|
||||
/// ////// (amir.i.iii.vii.iii@gmail.com | ammiiir1@gmail.com )
|
||||
// (https://gitlab.com/ammiiir1 | https://github.com/ammiiir1)
|
||||
|
||||
import Vue from 'vue'
|
||||
|
||||
class ATextSplitterVuePlugin {
|
||||
/// ///////////////////////////////////////////////////////////////////////////////////
|
||||
/// text animation#1
|
||||
// .staggerFrom($("#txtID .tsWords"), 0.5, {cycle: {y: [20, -20]}, opacity: 0}, 0.1, 0)
|
||||
// ************************************************************************************
|
||||
/// text animation#2
|
||||
// .staggerFrom($("#txtID .tsLetters"), 0.2, {scale: 5, opacity: 0}, 0.07)
|
||||
// ************************************************************************************
|
||||
// text animation#3
|
||||
// .staggerFrom($("#txtID .tsWords"), 0.4, {scale:2,opacity: 0}, 0.015,1.4)
|
||||
// ************************************************************************************
|
||||
/// text animation#4
|
||||
// .staggerFrom($("#txtID .tsWords"), 0.3, {opacity: 0}, 0.07)
|
||||
// ************************************************************************************
|
||||
constructor({ rtl = false, letterSpace = 0, wordSpace = '3px' } = {}) {
|
||||
// options
|
||||
this.rtl = rtl
|
||||
this.letterSpace = letterSpace + 'px'
|
||||
this.wordSpace = wordSpace + 'px'
|
||||
// pipeline vars
|
||||
this.word = ''
|
||||
this.letterSpans = ''
|
||||
this.wordSpans = ''
|
||||
}
|
||||
|
||||
/// /////////////////////////////////////////////// private classes
|
||||
_split(strOrId, isElement = true) {
|
||||
// pipeline
|
||||
const line = isElement ? $(`#${strOrId}`).text() : strOrId // get the sentence
|
||||
const parts = line.split(' ')
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
// how many words
|
||||
this.letterSpans = ''
|
||||
this.word = parts[i]
|
||||
|
||||
for (let j = 0; j < this.word.length; j++) {
|
||||
// how many letters in each words
|
||||
this.letterSpans += '<span class="tsLetters">' + this.word[j] + '</span>' // creat a span for each letter
|
||||
}
|
||||
this.wordSpans += '<span class="tsWords">' + this.letterSpans + ' </span>'
|
||||
}
|
||||
}
|
||||
|
||||
_setStyles(txtID) {
|
||||
$(`#${txtID} .tsLetters`).css({
|
||||
display: this.rtl ? 'inline' : 'inline-block',
|
||||
marginRight: this.rtl ? 0 : this.letterSpace,
|
||||
marginLeft: this.rtl ? this.letterSpace : 0
|
||||
})
|
||||
$(`#${txtID} .tsWords`).css({
|
||||
display: 'inline-block',
|
||||
marginRight: this.rtl ? 0 : this.wordSpace,
|
||||
marginLeft: this.rtl ? this.wordSpace : 0
|
||||
})
|
||||
}
|
||||
|
||||
/// /////////////////////////////////////////////// output methods
|
||||
injectToElement(txtID) {
|
||||
this._split(txtID, true)
|
||||
$(`#${txtID}`).html(this.wordSpans) // render the sentence
|
||||
this._setStyles(txtID)
|
||||
}
|
||||
|
||||
returnString(str) {
|
||||
this._split(str, false)
|
||||
return this.wordSpans // return splitted string
|
||||
}
|
||||
}
|
||||
|
||||
Vue.prototype.$ATextSplitter = ATextSplitterVuePlugin
|
||||
@@ -0,0 +1,44 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
function arpaError() {
|
||||
const arpaErrorMsg = 'تبادل اطلاعات با پایگاه داده آسان سرویس با مشکل مواجه شده، لطفا صفحه را بروزرسانی کنید.'
|
||||
const arpaErrorTitle = 'مشکل در ارتباط'
|
||||
Vue.prototype
|
||||
.$confirm(arpaErrorMsg, arpaErrorTitle, {
|
||||
confirmButtonText: 'بروزرسانی صفحه',
|
||||
cancelButtonText: 'بستن',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
window.location.reload()
|
||||
})
|
||||
.catch(() => {
|
||||
Vue.prototype.$message({
|
||||
type: 'info',
|
||||
message: 'برای ادامه صفحه را به صورت دستی بروزرسانی کنید'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function fetchError() {
|
||||
const arpaErrorMsg = 'دریافت اطلاعات با مشکل مواجه شده، لطفا صفحه را بروزرسانی کنید.'
|
||||
const arpaErrorTitle = 'دریافت ناموفق'
|
||||
Vue.prototype
|
||||
.$confirm(arpaErrorMsg, arpaErrorTitle, {
|
||||
confirmButtonText: 'تلاش مجدد',
|
||||
cancelButtonText: 'بستن',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
window.location.reload()
|
||||
})
|
||||
.catch(() => {
|
||||
Vue.prototype.$message({
|
||||
type: 'info',
|
||||
message: 'برای ادامه صفحه را به صورت دستی بروزرسانی کنید'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Vue.prototype.$arpaError = arpaError
|
||||
Vue.prototype.$fetchError = fetchError
|
||||
@@ -0,0 +1,4 @@
|
||||
import Vue from 'vue'
|
||||
import CKEditor from 'ckeditor4-vue'
|
||||
|
||||
Vue.use(CKEditor)
|
||||
@@ -0,0 +1,11 @@
|
||||
import Vue from 'vue'
|
||||
import CoreUi from '@coreui/vue'
|
||||
import CoreUiVueCharts from '@coreui/vue-chartjs'
|
||||
import { iconsSet as icons } from '~/utils/adminPanelIcons'
|
||||
|
||||
Vue.use(CoreUiVueCharts)
|
||||
Vue.use(CoreUi)
|
||||
|
||||
export default ({ app }) => {
|
||||
app.icons = icons
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import Vue from 'vue'
|
||||
import VuePersianDatetimePicker from 'vue-persian-datetime-picker'
|
||||
|
||||
Vue.component('PersianDatePicker', VuePersianDatetimePicker)
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import Element from 'element-ui'
|
||||
import locale from 'element-ui/lib/locale/lang/fa'
|
||||
|
||||
Vue.use(Element, { locale })
|
||||
@@ -0,0 +1,8 @@
|
||||
/* eslint-disable import/no-named-as-default */
|
||||
import Vue from 'vue'
|
||||
import gsap from 'gsap'
|
||||
import scrollToPlugin from 'gsap/ScrollToPlugin'
|
||||
import scrollTrigger from 'gsap/ScrollTrigger'
|
||||
|
||||
gsap.registerPlugin(scrollToPlugin, scrollTrigger)
|
||||
Vue.prototype.$gsap = gsap
|
||||
@@ -0,0 +1,13 @@
|
||||
import Vue from 'vue'
|
||||
import moment from 'moment-jalaali'
|
||||
|
||||
function jDate(date) {
|
||||
return moment(date).format('jYYYY/jMM/jDD')
|
||||
}
|
||||
|
||||
function jDateTime(date) {
|
||||
return moment(date).format('jYYYY/jMM/jDD - HH:mm:ss')
|
||||
}
|
||||
|
||||
Vue.prototype.$jDate = jDate
|
||||
Vue.prototype.$jDateTime = jDateTime
|
||||
Reference in New Issue
Block a user