|
@@ -16,3 +16,37 @@ export const setDocumentTitle = function (title) {
|
|
|
}
|
|
|
}
|
|
|
export const domTitle = process.env.VUE_APP_PRO_NAME
|
|
|
+
|
|
|
+// 设置keyframes属性
|
|
|
+export const addKeyFrames = function (id,y,dur){
|
|
|
+ var style = document.createElement('style');
|
|
|
+ style.type = 'text/css';
|
|
|
+ var keyFrames = '\
|
|
|
+ @-webkit-keyframes A_ID {\
|
|
|
+ 0% {\
|
|
|
+ -webkit-transform: translate3d(0, 0, 0);\
|
|
|
+ transform: translate3d(0, 0, 0);\
|
|
|
+ }\
|
|
|
+ 100% {\
|
|
|
+ -webkit-transform: translate3d(0, A_DYNAMIC_VALUE, 0);\
|
|
|
+ transform: translate3d(0, A_DYNAMIC_VALUE, 0);\
|
|
|
+ }\
|
|
|
+ }\
|
|
|
+ @keyframes A_ID {\
|
|
|
+ 0% {\
|
|
|
+ -webkit-transform: translate3d(0, 0, 0);\
|
|
|
+ transform: translate3d(0, 0, 0);\
|
|
|
+ }\
|
|
|
+ 100% {\
|
|
|
+ -webkit-transform: translate3d(0, A_DYNAMIC_VALUE, 0);\
|
|
|
+ transform: translate3d(0, A_DYNAMIC_VALUE, 0);\
|
|
|
+ }\
|
|
|
+ }\
|
|
|
+ .A_ID{\
|
|
|
+ -webkit-animation: A_DURs A_ID linear infinite normal;\
|
|
|
+ animation: A_DURs A_ID linear infinite normal;\
|
|
|
+ position: relative;\
|
|
|
+ }';
|
|
|
+ style.innerHTML = keyFrames.replace(/A_ID/g, id).replace(/A_DYNAMIC_VALUE/g, y).replace(/A_DUR/g,dur);
|
|
|
+ document.getElementsByTagName('head')[0].appendChild(style);
|
|
|
+}
|