weekly.js 1.1 KB

1
  1. "use strict";$(function(){$("#btn-share").click(function(){$(".mask").fadeIn()}),$(".mask").click(function(){$(".mask").fadeOut()})}),function(t,o,n,i){var s=function(o,n){var i={};this.option=t.extend({},n,i),this.wrap=o,this.init()};s.prototype.init=function(){this.setPosition()},s.prototype.sort=function(){this.option.data.sort(function(t,o){return t.mi>o.mi})},s.prototype.range=function(){t(this.wrap).offset().top;var o={x:0,y:0,mid:{x:[],y:[]}},n={w:t(this.wrap).width(),h:t(this.wrap).height()},i={w:120,h:30};return o.x=[0,n.w-i.w/2],o.y=[0,n.h],o.mid.x=n.w/2,o.mid.y=(n.h-30)/2,o},s.prototype.createElem=function(){for(var o=this.option.data,n=[],i=0;i<o.length;i++)n.push('<span class="common">'+o[i].name+"</span>"),t('<span class="common">'+o[i].name+"</span>").appendTo(t(this.wrap));return n},s.prototype.setPosition=function(){for(var o=this.createElem(),n=this.option.data,i=0;i<o.length;i++)0==i&&t(".common").eq(0).css({position:"absolute",zIndex:o.length,transform:"translate(-50%, -50%)"}),t(".common").eq(i).css({position:"absolute",left:n[i].left,top:n[i].top,fontSize:n[i].fontSize/75+"rem",color:n[i].color})},o.Hash=s}(jQuery,window,document);