HTML5+jQuery制作温馨浪漫爱心表白动画特效_第1页
HTML5+jQuery制作温馨浪漫爱心表白动画特效_第2页
HTML5+jQuery制作温馨浪漫爱心表白动画特效_第3页
HTML5+jQuery制作温馨浪漫爱心表白动画特效_第4页
HTML5+jQuery制作温馨浪漫爱心表白动画特效_第5页
已阅读5页,还剩31页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

index html HTML5 jQuery 制作温馨浪漫爱心表白动画特效 我们程序员也有浪漫的时候 psd 素 材网 font face font family digit src url digital 7 mono ttf format truetype 2014 01 01 2014 01 04 Boy name Mr LI Girl name Mrs ZHANG Fall in love river The boy love the girl They love each other The girl loved the boy AS time goes on The boy can not be separated the girl At the same time The girl can not be separated the boy Both wind and snow all over the sky Whether on foot or 5 kilometers The boy very happy The girl is also very happy Whether it is right now Still in the distant future The boy has but one dream The boy wants the girl could well have been happy I want to say Baby I love you forever 亲爱的 这是我们相爱在一起的时光 爱你直到永永远远 爱你的人 var offsetX loveHeart width 2 var offsetY loveHeart height 2 55 var together new Date together setFullYear 2013 2 28 together setHours 20 together setMinutes 0 together setSeconds 0 together setMilliseconds 0 if document createElement canvas getContext var msg document createElement div msg id errorMsg msg innerHTML Your browser doesn t support HTML5 Recommend use Chrome 14 IE 9 Firefox 7 Safari 4 document body appendChild msg code css display none copyright css position absolute copyright css bottom 10px document execCommand stop else setTimeout function startHeartAnimation 5000 timeElapse together setInterval function timeElapse together 500 adjustCodePosition code typewriter Function js var window window gardenCtx gardenCanvas garden garden var clientWidth window width var clientHeight window height function setup garden loveHeart loveHeart var offsetX loveHeart width 2 var offsetY loveHeart height 2 55 garden garden gardenCanvas garden 0 gardenCanvas width loveHeart width gardenCanvas height loveHeart height gardenCtx gardenCanvas getContext 2d gardenCtx globalCompositeOperation lighter garden new Garden gardenCtx gardenCanvas content css width loveHeart width code width content css height Math max loveHeart height code height content css margin top Math max window height content height 2 10 content css margin left Math max window width content width 2 10 renderLoop setInterval function garden render Garden options growSpeed window resize function var newWidth window width var newHeight window height if newWidth clientWidth function getHeartPoint angle var t angle Math PI var x 19 5 16 Math pow Math sin t 3 var y 20 13 Math cos t 5 Math cos 2 t 2 Math cos 3 t Math cos 4 t return new Array offsetX x offsetY y function startHeartAnimation var interval 50 var angle 10 var heart new Array var animationTimer setInterval function var bloom getHeartPoint angle var draw true for var i 0 i heart length i var p heart i var distance Math sqrt Math pow p 0 bloom 0 2 Math pow p 1 bloom 1 2 if distance 30 clearInterval animationTimer showMessages else angle 0 2 interval function fn typewriter function this each function var ele this str ele html progress 0 ele html var timer setInterval function var current str substr progress 1 if current progress 1 else progress ele html str substring 0 progress progress if progress str length clearInterval timer 75 return this jQuery function timeElapse date var current Date var seconds Date parse current Date parse date 1000 var days Math floor seconds 3600 24 seconds seconds 3600 24 var hours Math floor seconds 3600 if hours 10 hours 0 hours seconds seconds 3600 var minutes Math floor seconds 60 if minutes 10 minutes 0 minutes seconds seconds 60 if seconds 10 seconds 0 seconds var result days days hours hours minutes minutes seconds seconds elapseClock html result function showMessages adjustWordsPosition messages fadeIn 5000 function showLoveU function adjustWordsPosition words css position absolute words css top garden position top 195 words css left garden position left 70 function adjustCodePosition code css margin top garden height code height 2 function showLoveU loveu fadeIn 3000 Garden js function Vector x y this x x this y y Vector prototype rotate function theta var x this x var y this y this x Math cos theta x Math sin theta y this y Math sin theta x Math cos theta y return this mult function f this x f this y f return this clone function return new Vector this x this y length function return Math sqrt this x this x this y this y subtract function v this x v x this y v y return this set function x y this x x this y y return this function Petal stretchA stretchB startAngle angle growFactor bloom this stretchA stretchA this stretchB stretchB this startAngle startAngle this angle angle this bloom bloom this growFactor growFactor this r 1 this isfinished false this tanAngleA Garden random Garden degrad Garden options tanAngle Garden degrad Garden options tanAngle this tanAngleB Garden random Garden degrad Garden options tanAngle Garden degrad Garden options tanAngle Petal prototype draw function var ctx this bloom garden ctx var v1 v2 v3 v4 v1 new Vector 0 this r rotate Garden degrad this startAngle v2 v1 clone rotate Garden degrad this angle v3 v1 clone mult this stretchA rotate this tanAngleA v4 v2 clone mult this stretchB rotate this tanAngleB ctx strokeStyle this bloom c ctx beginPath ctx moveTo v1 x v1 y ctx bezierCurveTo v3 x v3 y v4 x v4 y v2 x v2 y ctx stroke render function if this r this bloom r this r this growFactor 10 this draw else this isfinished true function Bloom p r c pc garden this p p this r r this c c this pc pc this petals this garden garden this init this garden addBloom this Bloom prototype draw function var p isfinished true this garden ctx save this garden ctx translate this p x this p y for var i 0 i this petals length i p this petals i p render isfinished p isfinished this garden ctx restore if isfinished true this garden removeBloom this init function var angle 360 this pc var startAngle Garden randomInt 0 90 for var i 0 i this pc i this petals push new Petal Garden random Garden options petalStretch min Garden options petalStretch max Garden random Garden options petalStretch min Garden options petalStretch max startAngle i angle angle Garden random Garden options growFactor min Garden options growFactor max this function Garden ctx element this blooms this element element this ctx ctx Garden prototype render function for var i 0 i this blooms length i this blooms i draw addBloom function b this blooms push b removeBloom function b var bloom for var i 0 i this blooms length i bloom this blooms i if bloom b this blooms splice i 1 return this createRandomBloom function x y this createBloom x y Garden randomInt Garden options bloomRadius min Garden options bloomRadius max Garden randomrgba Garden options color rmin Garden options color rmax Garden options color gmin Garden options color gmax Garden options color bmin Garden options color bmax Garden options color opacity Garden randomInt Garden options petalCount min Garden options petalCount max createBloom function x y r c pc new Bloom new Vector x y r c pc this clear function this blooms this ctx clearRect 0 0 this element width this element height Garden options petalCount min 8 max 15 petalStretch min 0 1 max 3 growFactor min 0 1 max 1 bloomRadius min 8 max 10 density 10 growSpeed 1000 60 color rmin 128 rmax 255 gmin 0 gmax 128 bmin 0 bmax 128 opacity 0 1 tanAngle 60 Garden random function min max return Math random max min min Garden randomInt function min max return Math floor Math random max min 1 min Garden circle 2 Math PI Garden degrad function angle return Garden circle 360 angle Garden raddeg function angle return angle Garden circle 360 Garden rgba function r g b a return rgba r g b a Garden randomrgba function rmin rmax gmin gmax bmin bmax a var r Math round Garden random rmin rmax var g Math round Garden random gmin gmax var b Math round Garden random bmin bmax var limit 5 if Math abs r g limit else return Garden rgba r g b a Jquery js function A w function ma if c isReady try s documentElement doScroll left catch a setTimeout ma 1 return c re ady function Qa a b b src c ajax url b src async false dataType script c globalEval b text b textContent b innerHTML b parentNodeif typeof b object for var o in b X a o b o f e d return a if d w f jfor o 0 o i o e a o b f d call a o o e a o b d j retur n a return i e a 0 b w function J return new Date getTime function Y return false function Z return true function na a b d d 0 type a return c event handle apply b d function oa a var b d f e arguments j i o k n r i c data this events if a liveFired this i i live a but tonvar u i live slice 0 for k 0 k u length k i u k i origType replace O a type f push i selector u splice k 1 j c a target closest f a currentTarget n 0 for r j length n r n for k 0 k u length k i u k if j n selector i selector o j n elem f null if i p reType mouseenter i preType mouseleave f c a relatedTarget closest i selector 0 i f f f o d push elem o handleObj i n 0 for r d length n r n j d n a currentTarget j el em a data j handleObj data a handleObj j handleObj if j handleObj origHandler apply j elem e false b false break return b function pa a b return live ab each function if this nodeName a d if f fe events for var j in f for var i in f j c event add this j f j i f j i data function sa a b d var f e j b bif a length 1if j c fragments a 0 if j 1 f j if f f b createDocumentFragment c clean a b f d if e c fragments a 0 j f 1 return fragment f cacheable e function K a b var d c each va concat apply va slice 0 b function d this a return d function wa a return scrollTo in ac fn c prototype init function a b var d f if a return this if a nodeType this context this 0 a this length 1 return this if a body this 0 s body this selector body this length 1 return this if typeof a string if d Ta exec a if a Xa exec a if c isPlainObject b a s createEl ement a 1 c fn attr call a b true else a f createElement a 1 else a sa d 1 f a a cacheable a fragment cloneNode true a frag ment childNodes return c merge this a else if b s getElementById d 2 if b id d 2 return T find a this length 1 this 0 b this context s this selector a return this else if bthis context s a s getElementsByTagName a return c merge this a else return b b jquery b T find a c b find a else if c isFunction a return T ready a if a selector w this selector a selector this context a context return c makeArray a this selector jquery 1 4 2 length 0 size function return this length toArray function return R call this 0 get function a return a null this toArray a 0 this slice a 0 this a pushStack function a b d var f c c isArray a ba apply f a c merge f a f prevObject this f context this context if b find f selector this selector this selector d else if b f selector this selector b d return f each function a b return c each this a b ready function a c bindReady if c isReady a call s c else Qreturn this eq function a return a 1 this slice a this slice a a 1 first function return this eq 0 last function return this eq 1 slice function return this pushStack R apply this arguments slice R call arguments join map function a retur n this pushStack c map this function b d return a call b d b end function return this prevObject c null push ba sort sort splice splice c fn init prototype c fn c extend c f n extend function var a arguments 0 b 1 d arguments length f false e j i o if typeof a boolean f a a arguments 1 b 2 if typeof a object if d b a this b for b d b if e arguments b null for j in e i a j o e j if a o if fa j c extend f i o else if o w a j o return a c extend noConflict function a A Sa if a A jQuery Ra return c isReady false ready function if c isReady if s body return setTimeout c ready 13 c isReady true if Q for var a b 0 a Q b a call s c Q null c fn triggerHandlerif s readyState complete return c ready if s addEventListener s addEventListener DOMContentLoaded L false A addEventListener load c ready false else if s attachEvent s attachEvent onreadystatechange L A attachEvent onload c ready var a false try a A frameElement null catch b s documentElement doScrollif a constructorvar b for b in a return b w aa call a b isEmptyObject function a for var b in a return false return true error function a throw a parseJSON function a if typeof a string a return null a c trim a if s test a replace bfnrt u 0 9a fA F 4 g replace n r true false null d d eE d g replace s g return A JSONelse c error Invalid JSON a noop function globalEval function a if ad typ e text javascript if c support scriptEval d appendChild s createTextNode a else d text a b insertBefore d b firstChild b removeChild d nodeName function a b return a nodeNameif d if i for f in a if b apply a f d false break else for e j if b apply a e d false break else if i for f in a if b call a f f a f false break else for d a 0 e jd a e return a trim function a return a replace Wa makeArray function a b b b if a null a le ngth null typeof a string c isFunction a typeof a function return b inArray function a b if b indexOf return b indexOf a for var d 0 f b length d f d if b d a return d return 1 merge function a b var d a length f 0 if typeof b length number for var e b length f e f a d b f else for b f w a d b f a length d return a grep function a b d for var f e 0 j a length e j e d b a e e return f map function a b d for var f e j 0 i a length j i j e b a j j d if e null f f length e return f concat apply f guid 1 proxy function a b d if arguments length 2 if typeof b string d a a d b b w else if bb w if bif a b guid a guid a guid b guid c guid return b uaMatch function a a a toLowerCase a webkit w exec a opera version w exec a msie w exec a compatible test a return browser a 1 version a 2 0 browser P c uaMatch P if P browser c browser P browser true c browser version P version if c browser webkit c br owser safari true if ya c inArray function a b return ya call b a T c s if s addEventListener L function s removeEventListener DOMContentLoad ed L false c ready else if s attachEvent L function if s readyState complete s detachEvent onreadystatechange L c ready function c support var a s documentElement b s createElement script d s createElement div f script J d styl e display none d innerHTML a var e d getElementsByTagName j d getElementsByTagName a 0 if e e length j c su pport leadingWhitespace d firstChild nodeType 3 tbody d getElementsByTagName tbody l ength htmlSerialize d getElementsByTagName link length style red test j getAttribute styl e hrefNormalized j getAttribute href a opacity 0 55 test j style opacity cssFloat j style cssFloat checkOn d getElementsByTagName input 0 value on optSelected s create Element select appendChild s createElement option selected parentNode d removeChild d appendChild s createElement div parentNode null deleteEx pando true checkClone false scriptEval false noCloneEvent true boxModel null b type text jav ascript try b appendChild s createTextNode window f 1 catch i a insertBefore b a fir stChild if A f c support scriptEval true delete A f try delete b test catch o c support deleteExpando false a removeChild b if d attachEventd detachEvent onclick k d cloneNode true fireEvent onclick d s createElement div d innerHTML a s createDocumentFragment a appendChild d firstChild c support che ckClone a cloneNode true cloneNode true lastChild checked c function var k s createElement div k style width k style paddingLeft 1px s body appendChild k c boxM odel c support boxModel k offsetWidth 2 s body removeChild k style display none a fu nction k var n s createElement div k on k var r k in n if r n setAttribute k return r typeof n k function return r c support submitBubbles a submit c support changeBubbles a change a b d e j null c props for htmlFor class className readonly readOnly maxlength maxLength cell spacing cellSpacing rowspan rowSpan colspan colSpan tabindex tabIndex usemap useM ap frameborder frameBorder var G jQuery J Ya 0 za c extend cache expando G noData embed true object true applet true data function a b d if a nodeNamevar f a G e c cache if ff f Ya if typeof b object a G f e f c extend true b else if e f a G f e f a e f if d w a b d return typeof b string a b a removeData function a b if a nodeNamevar d a G f c cache e f d if b if e delete e b c isEmptyObject e else a removeAttributedelete f d c fn extend data function a b if typeof a undefined else if typeof a object return this each function c data this a var d a split d 1 d 1 d 1 if b w var f this triggerHandler getData d 1 d 0 if f wreturn f wc extend queue function a b d if a b b fx queue var f c data a b if d return f if f c isArray d f c data a b c makeArray d else f push d return f dequeue function a b b b fx var d c queue a b f d shift if f inprogress f d shift if f b fx f c all a function c dequeue a b c fn extend queue function a b if typeof a string b a a fx if b w return c queue this 0 a return this each function var d c queue this a b a fx b b fx r eturn this queue b function var d this setTimeout function c dequeue d b a clearQueue function a return this queue a fx var Aa n t g ca s Za r g a href src style ab button input i bb button input obje ct select textarea i cb a area i Ba radio checkbox c fn extend attr function a b return X this a b true c attr removeAttr function a return this each function c attr this a this nodeType 1r addClass a call this n r attr class if ad f d var e this d if e nodeType 1 if e className for var j e className i e className o 0 k b length o k o if j indexOf b o 0 i b o e className c trim i else e className a return this removeClass function a if c isFunction a return this each function k var n c this n removeClass a call this k n attr class if ad f d var e this d if e nodeType 1i o i j j replace b i e className c trim j else e className return this toggleClass function a b var d typeof a f typeof b boolean if c isFunction a return this each function e var j c this j toggleClass a call this e j attr class b b return this each function if d string for var e j 0 i c this o b k a split ca e k j o f o i hasClass e i o addClass removeClass e e lse if d undefined d boolean this classNamethis className this className a false c data this className hasClass function

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论