Chào các bạn trẻ đam mê công nghệ, đam mê học hỏi, người có bạn gái cho đến những anh hùng F.A thời kỳ đại suy thoái toàn cầu.
Fix tôi hôm nay rảnh rổi lang thang internet vẩn vơ sưu tầm góp nhặt tặng các đồng chí ít code js,css,html đỉnh “kao” để phục vụ cho cái mục đích duy nhất đó là đi tạo màu với các tình yêu bé nhỏ của các đồng chí.
Vào việc luôn đi anh em nhỉ, ah mà hay thì anh em cho tôi cái share bài và cái tim đỏ đỏ cho nó có tí động lực và tuyên truyền rộng rãi để tôi còn gửi tặng anh em các thứ hay ho về sau nữa nhé:
1. Trang cuagai.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<span class="hljs-meta"><!DOCTYPE html></span> <span class="hljs-tag"><<span class="hljs-name">html</span>></span> <span class="hljs-tag"><<span class="hljs-name">head</span>></span> <span class="hljs-tag"><<span class="hljs-name">title</span>></span>Gửi lời yêu thương<span class="hljs-tag"></<span class="hljs-name">title</span>></span> <span class="hljs-tag"><<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"codetotinh.css"</span> /></span> <span class="hljs-tag"></<span class="hljs-name">head</span>></span> <span class="hljs-tag"><<span class="hljs-name">body</span> <span class="hljs-attr">bgcolor</span>=<span class="hljs-string">"#000000"</span>></span> <span class="hljs-tag"><<span class="hljs-name">center</span>></span> <span class="hljs-tag"><<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://timoday.edu.vn/wp-content/uploads/2020/06/love1.gif"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"300"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"25"</span>></span> <span class="hljs-tag"></<span class="hljs-name">center</span>></span> <span class="hljs-tag"><<span class="hljs-name">h1</span> <span class="hljs-attr">align</span>=<span class="hljs-string">"center"</span>></span> <span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"background: url(&quot;https://timoday.edu.vn/d9f50c755f7e4d8626a518843017a8bc_44837304.partner.gif&quot;) repeat scroll 0% 0% transparent; color:#fff; text-shadow: 0pt 0pt 0.3em LightYellow, 0pt 2pt 0.3em LightYellow;"</span>></span><span class="hljs-tag"><<span class="hljs-name">b</span>></span>GỬI LỜI YÊU THƯƠNG<span class="hljs-tag"></<span class="hljs-name">b</span>></span><span class="hljs-tag"></<span class="hljs-name">span</span>></span> <span class="hljs-tag"></<span class="hljs-name">h1</span>></span> <span class="hljs-tag"><<span class="hljs-name">center</span>></span> <span class="hljs-tag"><<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://timoday.edu.vn/wp-content/uploads/2020/06/love2.gif"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"300"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"25"</span>></span> <span class="hljs-tag"></<span class="hljs-name">center</span>></span> <span class="hljs-tag"><<span class="hljs-name">center</span>></span> <span class="hljs-tag"><<span class="hljs-name">p</span>></span><span class="hljs-tag"><<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://timoday.edu.vn/wp-content/uploads/2020/06/love3.gif"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"460"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"433"</span>></span><span class="hljs-tag"></<span class="hljs-name">p</span>></span> <span class="hljs-tag"><<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://timoday.edu.vn/wp-content/uploads/2020/06/love4.gif"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"220"</span> <span class="hljs-attr">border</span>=<span class="hljs-string">"0"</span>></span> <span class="hljs-tag"></<span class="hljs-name">center</span>></span> <span class="hljs-tag"><<span class="hljs-name">center</span>></span> <span class="hljs-tag"><<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://timoday.edu.vn/wp-content/uploads/2020/06/love4.gif"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"700"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"8"</span>></span><span class="hljs-tag"><<span class="hljs-name">br</span>></span> <span class="hljs-tag"><<span class="hljs-name">font</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-size: 11pt"</span>></span> <span class="hljs-tag"><<span class="hljs-name">font</span> <span class="hljs-attr">color</span>=<span class="hljs-string">"#FF0000"</span> <span class="hljs-attr">face</span>=<span class="hljs-string">"Comic Sans MS"</span>></span><span class="hljs-tag"></<span class="hljs-name">font</span>></span> <span class="hljs-tag"><<span class="hljs-name">font</span> <span class="hljs-attr">color</span>=<span class="hljs-string">"white"</span> <span class="hljs-attr">face</span>=<span class="hljs-string">"Comic Sans MS"</span>></span><span class="hljs-tag"></<span class="hljs-name">font</span>></span> <span class="hljs-tag"><<span class="hljs-name">marquee</span> <span class="hljs-attr">behavior</span>=<span class="hljs-string">"scroll"</span> <span class="hljs-attr">direction</span>=<span class="hljs-string">"left"</span> <span class="hljs-attr">scrollamount</span>=<span class="hljs-string">"2"</span> <span class="hljs-attr">scrolldelay</span>=<span class="hljs-string">"20"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"50%"</span>></span><span class="hljs-tag"><<span class="hljs-name">font</span> <span class="hljs-attr">face</span>=<span class="hljs-string">"Tahoma"</span> <span class="hljs-attr">size</span>=<span class="hljs-string">"2"</span> <span class="hljs-attr">color</span>=<span class="hljs-string">"#ffffff"</span>></span> Bạn cho mình làm quen nhé hihi!<span class="hljs-tag"></<span class="hljs-name">font</span>></span><span class="hljs-tag"></<span class="hljs-name">marquee</span>></span><span class="hljs-tag"><<span class="hljs-name">br</span>></span> <span class="hljs-tag"><<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://timoday.edu.vn/wp-content/uploads/2020/06/love5.gif"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"700"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"8"</span>></span> <span class="hljs-tag"></<span class="hljs-name">font</span>></span> <span class="hljs-tag"></<span class="hljs-name">center</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"left: 0pt; position: fixed; top: 0pt; z-index: 0;"</span>></span> <span class="hljs-comment"><!--<embed align="center" height="900px" width="2000px" src="images/chuot.swf" wmode="transparent"></embed>--></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">body</span>></span> <span class="hljs-tag"></<span class="hljs-name">html</span>></span> |
2. Code css codetotinh.cs
1 2 3 4 5 |
<span class="hljs-selector-tag">img</span>{ <span class="hljs-attribute">border</span>: <span class="hljs-number">0</span>; } |
3. Trang cuagai2.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
<span class="hljs-meta"><!DOCTYPE ></span> <span class="hljs-tag"><<span class="hljs-name">html</span> ></span> <span class="hljs-tag"><<span class="hljs-name">head</span>></span> <span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"totinh.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span> <span class="hljs-tag"><<span class="hljs-name">title</span>></span>Gửi lời yêu thương<span class="hljs-tag"></<span class="hljs-name">title</span>></span> <span class="hljs-tag"><<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/css"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"totinh2.css"</span>></span> <span class="hljs-tag"></<span class="hljs-name">head</span>></span> <span class="hljs-tag"><<span class="hljs-name">body</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"left: 0pt; position: fixed; top: 0pt; z-index: 0;"</span>></span> <span class="hljs-comment"><!--<embed align="center" height="900px" width="2000px" src="images/chuot.swf" wmode="transparent"></embed>--></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span> <span class="hljs-tag"><<span class="hljs-name">p</span>></span> <span class="hljs-tag"><<span class="hljs-name">svg</span> <span class="hljs-attr">viewBox</span>=<span class="hljs-string">"0 0 800 600"</span>></span> <span class="hljs-tag"><<span class="hljs-name">symbol</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"s-text"</span>></span> <span class="hljs-tag"><<span class="hljs-name">text</span> <span class="hljs-attr">text-anchor</span>=<span class="hljs-string">"middle"</span> <span class="hljs-attr">x</span>=<span class="hljs-string">"50%"</span> <span class="hljs-attr">y</span>=<span class="hljs-string">"35%"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text--line"</span> ></span> TỚ LÀ <span class="hljs-tag"></<span class="hljs-name">text</span>></span> <span class="hljs-tag"><<span class="hljs-name">text</span> <span class="hljs-attr">text-anchor</span>=<span class="hljs-string">"middle"</span> <span class="hljs-attr">x</span>=<span class="hljs-string">"50%"</span> <span class="hljs-attr">y</span>=<span class="hljs-string">"68%"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text--line2"</span> ></span> DÂN IT <span class="hljs-tag"></<span class="hljs-name">text</span>></span> <span class="hljs-tag"></<span class="hljs-name">symbol</span>></span> <span class="hljs-tag"><<span class="hljs-name">g</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"g-ants"</span>></span> <span class="hljs-tag"><<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#s-text"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-copy"</span>></span><span class="hljs-tag"></<span class="hljs-name">use</span>></span> <span class="hljs-tag"><<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#s-text"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-copy"</span>></span><span class="hljs-tag"></<span class="hljs-name">use</span>></span> <span class="hljs-tag"><<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#s-text"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-copy"</span>></span><span class="hljs-tag"></<span class="hljs-name">use</span>></span> <span class="hljs-tag"><<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#s-text"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-copy"</span>></span><span class="hljs-tag"></<span class="hljs-name">use</span>></span> <span class="hljs-tag"><<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#s-text"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-copy"</span>></span><span class="hljs-tag"></<span class="hljs-name">use</span>></span> <span class="hljs-tag"></<span class="hljs-name">g</span>></span> <span class="hljs-tag"></<span class="hljs-name">svg</span>></span> <span class="hljs-tag"></<span class="hljs-name">p</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">body</span>></span> <span class="hljs-tag"></<span class="hljs-name">html</span>></span> |
4. Code JS totinh.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
<span class="hljs-comment">//Code JS tạo tuyết rơi</span> <span class="hljs-keyword">var</span> snowStorm = <span class="hljs-literal">null</span>; <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">SnowStorm</span>() </span>{ <span class="hljs-keyword">var</span> imagePath = <span class="hljs-string">'https://timoday.edu.vn/wp-content/uploads/2020/06/'</span>; <span class="hljs-keyword">var</span> flakesMax = <span class="hljs-number">45</span>; <span class="hljs-keyword">var</span> flakesMaxActive = <span class="hljs-number">45</span>; <span class="hljs-keyword">var</span> vMaxX = <span class="hljs-number">2</span>; <span class="hljs-keyword">var</span> vMaxY = <span class="hljs-number">2</span>; <span class="hljs-keyword">var</span> usePNG = <span class="hljs-literal">false</span>; <span class="hljs-keyword">var</span> flakeBottom = <span class="hljs-literal">null</span>; <span class="hljs-keyword">var</span> snowStick = <span class="hljs-literal">false</span>; <span class="hljs-keyword">var</span> snowCollect = <span class="hljs-literal">false</span>; <span class="hljs-keyword">var</span> targetElement = <span class="hljs-literal">null</span>; <span class="hljs-keyword">var</span> followMouse = <span class="hljs-literal">true</span>; <span class="hljs-keyword">var</span> flakeTypes = <span class="hljs-number">4</span>; <span class="hljs-keyword">var</span> flakeWidth = <span class="hljs-number">6</span>; <span class="hljs-keyword">var</span> flakeHeight = <span class="hljs-number">6</span>; <span class="hljs-keyword">var</span> zIndex = <span class="hljs-number">10</span>; <span class="hljs-keyword">var</span> flakeLeftOffset = <span class="hljs-number">0</span>; <span class="hljs-keyword">var</span> flakeRightOffset = <span class="hljs-number">0</span>; <span class="hljs-keyword">var</span> addEvent = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">o, evtName, evtHandler</span>) </span>{ <span class="hljs-keyword">typeof</span> (attachEvent) == <span class="hljs-string">'undefined'</span> ? o.addEventListener(evtName, evtHandler, <span class="hljs-literal">false</span>) : o.attachEvent(<span class="hljs-string">'on'</span> + evtName, evtHandler); } <span class="hljs-keyword">var</span> removeEvent = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">o, evtName, evtHandler</span>) </span>{ <span class="hljs-keyword">typeof</span> (attachEvent) == <span class="hljs-string">'undefined'</span> ? o.removeEventListener(evtName, evtHandler, <span class="hljs-literal">false</span>) : o.detachEvent(<span class="hljs-string">'on'</span> + evtName, evtHandler); } <span class="hljs-keyword">var</span> classContains = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">o, cStr</span>) </span>{ <span class="hljs-keyword">return</span> (<span class="hljs-keyword">typeof</span> (o.className) != <span class="hljs-string">'undefined'</span> ? o.className.indexOf(cStr) + <span class="hljs-number">1</span> : <span class="hljs-literal">false</span>); } <span class="hljs-keyword">var</span> s = <span class="hljs-keyword">this</span>; <span class="hljs-keyword">var</span> storm = <span class="hljs-keyword">this</span>; <span class="hljs-keyword">this</span>.timers = []; <span class="hljs-keyword">this</span>.flakes = []; <span class="hljs-keyword">this</span>.disabled = <span class="hljs-literal">false</span>; <span class="hljs-keyword">this</span>.terrain = []; <span class="hljs-keyword">this</span>.active = <span class="hljs-literal">false</span>; <span class="hljs-keyword">var</span> isIE = navigator.userAgent.match(<span class="hljs-regexp">/msie/i</span>); <span class="hljs-keyword">var</span> isIE6 = navigator.userAgent.match(<span class="hljs-regexp">/msie 6/i</span>); <span class="hljs-keyword">var</span> isOldIE = (isIE && (isIE6 || navigator.userAgent.match(<span class="hljs-regexp">/msie 5/i</span>))); <span class="hljs-keyword">var</span> isWin9X = navigator.appVersion.match(<span class="hljs-regexp">/windows 98/i</span>); <span class="hljs-keyword">var</span> isiPhone = navigator.userAgent.match(<span class="hljs-regexp">/iphone/i</span>); <span class="hljs-keyword">var</span> isOpera = navigator.userAgent.match(<span class="hljs-regexp">/opera/i</span>); <span class="hljs-keyword">if</span> (isOpera) isIE = <span class="hljs-literal">false</span>; <span class="hljs-keyword">var</span> screenX = <span class="hljs-literal">null</span>; <span class="hljs-keyword">var</span> screenX2 = <span class="hljs-literal">null</span>; <span class="hljs-keyword">var</span> screenY = <span class="hljs-literal">null</span>; <span class="hljs-keyword">var</span> scrollY = <span class="hljs-literal">null</span>; <span class="hljs-keyword">var</span> vRndX = <span class="hljs-literal">null</span>; <span class="hljs-keyword">var</span> vRndY = <span class="hljs-literal">null</span>; <span class="hljs-keyword">var</span> windOffset = <span class="hljs-number">1</span>; <span class="hljs-keyword">var</span> windMultiplier = <span class="hljs-number">2</span>; <span class="hljs-keyword">var</span> pngSupported = (!isIE || (isIE && !isIE6 && !isOldIE)); <span class="hljs-keyword">var</span> docFrag = <span class="hljs-built_in">document</span>.createDocumentFragment(); <span class="hljs-keyword">this</span>.oControl = <span class="hljs-literal">null</span>; <span class="hljs-keyword">if</span> (flakeLeftOffset == <span class="hljs-literal">null</span>) flakeLeftOffset = <span class="hljs-number">0</span>; <span class="hljs-keyword">if</span> (flakeRightOffset == <span class="hljs-literal">null</span>) flakeRightOffset = <span class="hljs-number">0</span>; <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">rnd</span>(<span class="hljs-params">n, min</span>) </span>{ <span class="hljs-keyword">if</span> (<span class="hljs-built_in">isNaN</span>(min)) min = <span class="hljs-number">0</span>; <span class="hljs-keyword">return</span> (<span class="hljs-built_in">Math</span>.random() * n) + min; } <span class="hljs-keyword">this</span>.randomizeWind = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ vRndX = plusMinus(rnd(vMaxX, <span class="hljs-number">0.2</span>)); vRndY = rnd(vMaxY, <span class="hljs-number">0.2</span>); <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.flakes) { <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i < <span class="hljs-keyword">this</span>.flakes.length; i++) { <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.flakes[i].active) <span class="hljs-keyword">this</span>.flakes[i].setVelocities(); } } } <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">plusMinus</span>(<span class="hljs-params">n</span>) </span>{ <span class="hljs-keyword">return</span> (<span class="hljs-built_in">parseInt</span>(rnd(<span class="hljs-number">2</span>)) == <span class="hljs-number">1</span> ? n * <span class="hljs-number">-1</span> : n); } <span class="hljs-keyword">this</span>.scrollHandler = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ scrollY = (flakeBottom ? <span class="hljs-number">0</span> : <span class="hljs-built_in">parseInt</span>(<span class="hljs-built_in">window</span>.scrollY || <span class="hljs-built_in">document</span>.documentElement.scrollTop || <span class="hljs-built_in">document</span>.body.scrollTop)); <span class="hljs-keyword">if</span> (<span class="hljs-built_in">isNaN</span>(scrollY)) scrollY = <span class="hljs-number">0</span>; <span class="hljs-keyword">if</span> (!flakeBottom && s.flakes) { <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i < s.flakes.length; i++) { <span class="hljs-keyword">if</span> (s.flakes[i].active == <span class="hljs-number">0</span>) s.flakes[i].stick(); } } } <span class="hljs-keyword">this</span>.resizeHandler = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ <span class="hljs-keyword">if</span> (<span class="hljs-built_in">window</span>.innerWidth || <span class="hljs-built_in">window</span>.innerHeight) { screenX = <span class="hljs-built_in">window</span>.innerWidth - (!isIE ? <span class="hljs-number">16</span> : <span class="hljs-number">2</span>) - flakeRightOffset; screenY = (flakeBottom ? flakeBottom : <span class="hljs-built_in">window</span>.innerHeight); } <span class="hljs-keyword">else</span> { screenX = (<span class="hljs-built_in">document</span>.documentElement.clientWidth || <span class="hljs-built_in">document</span>.body.clientWidth || <span class="hljs-built_in">document</span>.body.scrollWidth) - (!isIE ? <span class="hljs-number">8</span> : <span class="hljs-number">0</span>) - flakeRightOffset; screenY = flakeBottom ? flakeBottom : (<span class="hljs-built_in">document</span>.documentElement.clientHeight || <span class="hljs-built_in">document</span>.body.clientHeight || <span class="hljs-built_in">document</span>.body.scrollHeight); } screenX2 = <span class="hljs-built_in">parseInt</span>(screenX / <span class="hljs-number">2</span>); } <span class="hljs-keyword">this</span>.resizeHandlerAlt = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ screenX = targetElement.offsetLeft + targetElement.offsetWidth - flakeRightOffset; screenY = flakeBottom ? flakeBottom : targetElement.offsetTop + targetElement.offsetHeight; screenX2 = <span class="hljs-built_in">parseInt</span>(screenX / <span class="hljs-number">2</span>); } <span class="hljs-keyword">this</span>.freeze = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ <span class="hljs-keyword">if</span> (!s.disabled) { s.disabled = <span class="hljs-number">1</span>; } <span class="hljs-keyword">else</span> { <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>; } <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i < s.timers.length; i++) { clearInterval(s.timers[i]); } } <span class="hljs-keyword">this</span>.resume = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ <span class="hljs-keyword">if</span> (s.disabled) { s.disabled = <span class="hljs-number">0</span>; } <span class="hljs-keyword">else</span> { <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>; } s.timerInit(); } <span class="hljs-keyword">this</span>.toggleSnow = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ <span class="hljs-keyword">if</span> (!s.flakes.length) { s.start(); s.setControlActive(<span class="hljs-literal">true</span>); } <span class="hljs-keyword">else</span> { s.active = !s.active; <span class="hljs-keyword">if</span> (s.active) { s.show(); s.resume(); s.setControlActive(<span class="hljs-literal">true</span>); } <span class="hljs-keyword">else</span> { s.stop(); s.freeze(); s.setControlActive(<span class="hljs-literal">false</span>); } } } <span class="hljs-keyword">this</span>.setControlActive = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">bActive</span>) </span>{} <span class="hljs-keyword">this</span>.stop = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ <span class="hljs-keyword">this</span>.freeze(); <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-keyword">this</span>.flakes.length; i--;) { <span class="hljs-keyword">this</span>.flakes[i].o.style.display = <span class="hljs-string">'none'</span>; } removeEvent(<span class="hljs-built_in">window</span>, <span class="hljs-string">'scroll'</span>, s.scrollHandler); removeEvent(<span class="hljs-built_in">window</span>, <span class="hljs-string">'resize'</span>, s.resizeHandler); <span class="hljs-keyword">if</span> (!isIE) { removeEvent(<span class="hljs-built_in">window</span>, <span class="hljs-string">'blur'</span>, s.freeze); removeEvent(<span class="hljs-built_in">window</span>, <span class="hljs-string">'focus'</span>, s.resume); } } <span class="hljs-keyword">this</span>.show = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-keyword">this</span>.flakes.length; i--;) { <span class="hljs-keyword">this</span>.flakes[i].o.style.display = <span class="hljs-string">'block'</span>; } } <span class="hljs-keyword">this</span>.SnowFlake = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">parent, type, x, y</span>) </span>{ <span class="hljs-keyword">var</span> s = <span class="hljs-keyword">this</span>; <span class="hljs-keyword">var</span> storm = parent; <span class="hljs-keyword">this</span>.type = type; <span class="hljs-keyword">this</span>.x = x || <span class="hljs-built_in">parseInt</span>(rnd(screenX - <span class="hljs-number">20</span>)); <span class="hljs-keyword">this</span>.y = (!<span class="hljs-built_in">isNaN</span>(y) ? y : -rnd(screenY) - <span class="hljs-number">12</span>); <span class="hljs-keyword">this</span>.vX = <span class="hljs-literal">null</span>; <span class="hljs-keyword">this</span>.vY = <span class="hljs-literal">null</span>; <span class="hljs-keyword">this</span>.vAmpTypes = [<span class="hljs-number">2.0</span>, <span class="hljs-number">1.0</span>, <span class="hljs-number">1.25</span>, <span class="hljs-number">1.0</span>, <span class="hljs-number">1.5</span>, <span class="hljs-number">1.75</span>]; <span class="hljs-keyword">this</span>.vAmp = <span class="hljs-keyword">this</span>.vAmpTypes[<span class="hljs-keyword">this</span>.type]; <span class="hljs-keyword">this</span>.active = <span class="hljs-number">1</span>; <span class="hljs-keyword">this</span>.o = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">'img'</span>); <span class="hljs-keyword">this</span>.o.style.position = <span class="hljs-string">'absolute'</span>; <span class="hljs-keyword">this</span>.o.style.width = flakeWidth + <span class="hljs-string">'px'</span>; <span class="hljs-keyword">this</span>.o.style.height = flakeHeight + <span class="hljs-string">'px'</span>; <span class="hljs-keyword">this</span>.o.style.fontSize = <span class="hljs-string">'1px'</span>; <span class="hljs-keyword">this</span>.o.style.zIndex = zIndex; <span class="hljs-keyword">this</span>.o.src = imagePath + <span class="hljs-keyword">this</span>.type + (pngSupported && usePNG ? <span class="hljs-string">'.png'</span> : <span class="hljs-string">'.gif'</span>); docFrag.appendChild(<span class="hljs-keyword">this</span>.o); <span class="hljs-keyword">this</span>.refresh = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ s.o.style.left = s.x + <span class="hljs-string">'px'</span>; s.o.style.top = s.y + <span class="hljs-string">'px'</span>; } <span class="hljs-keyword">this</span>.stick = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ <span class="hljs-keyword">if</span> (isIE6 || isiPhone || (targetElement != <span class="hljs-built_in">document</span>.documentElement && targetElement != <span class="hljs-built_in">document</span>.body)) { s.o.style.top = (screenY + scrollY - flakeHeight - storm.terrain[<span class="hljs-built_in">Math</span>.floor(s.x)]) + <span class="hljs-string">'px'</span>; } <span class="hljs-keyword">else</span> { s.o.style.display = <span class="hljs-string">'none'</span>; s.o.style.top = <span class="hljs-string">'auto'</span>; s.o.style.bottom = <span class="hljs-string">'0px'</span>; s.o.style.position = <span class="hljs-string">'fixed'</span>; s.o.style.display = <span class="hljs-string">'block'</span>; } } <span class="hljs-keyword">this</span>.vCheck = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ <span class="hljs-keyword">if</span> (s.vX >= <span class="hljs-number">0</span> && s.vX < <span class="hljs-number">0.2</span>) { s.vX = <span class="hljs-number">0.2</span>; } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (s.vX < <span class="hljs-number">0</span> && s.vX > <span class="hljs-number">-0.2</span>) { s.vX = <span class="hljs-number">-0.2</span>; } <span class="hljs-keyword">if</span> (s.vY >= <span class="hljs-number">0</span> && s.vY < <span class="hljs-number">0.2</span>) { s.vY = <span class="hljs-number">0.2</span>; } } <span class="hljs-keyword">this</span>.move = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ s.x += s.vX * windOffset; s.y += (s.vY * s.vAmp); s.refresh(); <span class="hljs-keyword">if</span> (s.vX && screenX - s.x < flakeWidth + (s.vX * windOffset)) { s.x = <span class="hljs-number">0</span>; } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> ((s.vX < <span class="hljs-number">0</span> || windOffset < <span class="hljs-number">0</span>) && s.x - flakeLeftOffset < <span class="hljs-number">0</span> - flakeWidth) { s.x = screenX - flakeWidth; } <span class="hljs-keyword">var</span> yDiff = screenY + scrollY - s.y - storm.terrain[<span class="hljs-built_in">Math</span>.floor(s.x)]; <span class="hljs-keyword">if</span> (yDiff < flakeHeight) { s.active = <span class="hljs-number">0</span>; <span class="hljs-keyword">if</span> (snowCollect && snowStick) { <span class="hljs-keyword">var</span> height = [<span class="hljs-number">0.75</span>, <span class="hljs-number">1.5</span>, <span class="hljs-number">0.75</span>]; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i < <span class="hljs-number">2</span>; i++) { storm.terrain[<span class="hljs-built_in">Math</span>.floor(s.x) + i + <span class="hljs-number">2</span>] += height[i]; } } s.o.style.left = (s.x / screenX * <span class="hljs-number">100</span>) + <span class="hljs-string">'%'</span>; <span class="hljs-keyword">if</span> (!flakeBottom) { <span class="hljs-keyword">if</span> (snowStick) { s.stick(); } <span class="hljs-keyword">else</span> { s.recycle(); } } } } <span class="hljs-keyword">this</span>.animate = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ s.move(); } <span class="hljs-keyword">this</span>.setVelocities = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ s.vX = vRndX + rnd(vMaxX * <span class="hljs-number">0.12</span>, <span class="hljs-number">0.1</span>); s.vY = vRndY + rnd(vMaxY * <span class="hljs-number">0.12</span>, <span class="hljs-number">0.1</span>); } <span class="hljs-keyword">this</span>.recycle = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ s.o.style.display = <span class="hljs-string">'none'</span>; s.o.style.position = <span class="hljs-string">'absolute'</span>; s.o.style.bottom = <span class="hljs-string">'auto'</span>; s.setVelocities(); s.vCheck(); s.x = <span class="hljs-built_in">parseInt</span>(rnd(screenX - flakeWidth - <span class="hljs-number">20</span>)); s.y = <span class="hljs-built_in">parseInt</span>(rnd(screenY) * <span class="hljs-number">-1</span>) - flakeHeight; s.o.style.left = s.x + <span class="hljs-string">'px'</span>; s.o.style.top = s.y + <span class="hljs-string">'px'</span>; s.o.style.display = <span class="hljs-string">'block'</span>; s.active = <span class="hljs-number">1</span>; } <span class="hljs-keyword">this</span>.recycle(); <span class="hljs-keyword">this</span>.refresh(); } <span class="hljs-keyword">this</span>.snow = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ <span class="hljs-keyword">var</span> active = <span class="hljs-number">0</span>; <span class="hljs-keyword">var</span> used = <span class="hljs-number">0</span>; <span class="hljs-keyword">var</span> waiting = <span class="hljs-number">0</span>; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = s.flakes.length; i--;) { <span class="hljs-keyword">if</span> (s.flakes[i].active == <span class="hljs-number">1</span>) { s.flakes[i].move(); active++; } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (s.flakes[i].active == <span class="hljs-number">0</span>) { used++; } <span class="hljs-keyword">else</span> { waiting++; } } <span class="hljs-keyword">if</span> (snowCollect && !waiting) { s.createSnow(flakesMaxActive, <span class="hljs-literal">true</span>); } <span class="hljs-keyword">if</span> (active < flakesMaxActive) { <span class="hljs-keyword">with</span>(s.flakes[<span class="hljs-built_in">parseInt</span>(rnd(s.flakes.length))]) { <span class="hljs-keyword">if</span> (!snowCollect && active == <span class="hljs-number">0</span>) { recycle(); } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (active == <span class="hljs-number">-1</span>) { active = <span class="hljs-number">1</span>; } } } } <span class="hljs-keyword">this</span>.mouseMove = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">e</span>) </span>{ <span class="hljs-keyword">if</span> (!followMouse) <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>; <span class="hljs-keyword">var</span> x = <span class="hljs-built_in">parseInt</span>(e.clientX); <span class="hljs-keyword">if</span> (x < screenX2) { windOffset = -windMultiplier + (x / screenX2 * windMultiplier); } <span class="hljs-keyword">else</span> { x -= screenX2; windOffset = (x / screenX2) * windMultiplier; } } <span class="hljs-keyword">this</span>.createSnow = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">limit, allowInactive</span>) </span>{ <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i < limit; i++) { s.flakes[s.flakes.length] = <span class="hljs-keyword">new</span> s.SnowFlake(s, <span class="hljs-built_in">parseInt</span>(rnd(flakeTypes))); <span class="hljs-keyword">if</span> (allowInactive || i > flakesMaxActive) s.flakes[s.flakes.length - <span class="hljs-number">1</span>].active = <span class="hljs-number">-1</span>; } targetElement.appendChild(docFrag); } <span class="hljs-keyword">this</span>.timerInit = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ s.timers = (!isWin9X ? [setInterval(s.snow, <span class="hljs-number">20</span>)] : [setInterval(s.snow, <span class="hljs-number">75</span>), setInterval(s.snow, <span class="hljs-number">25</span>)]); } <span class="hljs-keyword">this</span>.init = <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i < <span class="hljs-number">2048</span>; i++) { s.terrain[i] = <span class="hljs-number">0</span>; } s.randomizeWind(); s.createSnow(snowCollect ? flakesMaxActive : flakesMaxActive * <span class="hljs-number">2</span>); addEvent(<span class="hljs-built_in">window</span>, <span class="hljs-string">'resize'</span>, s.resizeHandler); addEvent(<span class="hljs-built_in">window</span>, <span class="hljs-string">'scroll'</span>, s.scrollHandler); <span class="hljs-keyword">if</span> (!isIE) { addEvent(<span class="hljs-built_in">window</span>, <span class="hljs-string">'blur'</span>, s.freeze); addEvent(<span class="hljs-built_in">window</span>, <span class="hljs-string">'focus'</span>, s.resume); } s.resizeHandler(); s.scrollHandler(); <span class="hljs-keyword">if</span> (followMouse) { addEvent(<span class="hljs-built_in">document</span>, <span class="hljs-string">'mousemove'</span>, s.mouseMove); } s.timerInit(); } <span class="hljs-keyword">var</span> didInit = <span class="hljs-literal">false</span>; <span class="hljs-keyword">this</span>.start = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">bFromOnLoad</span>) </span>{ <span class="hljs-keyword">if</span> (!didInit) { didInit = <span class="hljs-literal">true</span>; } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (bFromOnLoad) { <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>; } <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> targetElement == <span class="hljs-string">'string'</span>) { targetElement = <span class="hljs-built_in">document</span>.getElementById(targetElement); <span class="hljs-keyword">if</span> (!targetElement) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(<span class="hljs-string">'Snowstorm: Unable to get targetElement'</span>); } <span class="hljs-keyword">if</span> (!targetElement) { targetElement = (!isIE ? (<span class="hljs-built_in">document</span>.documentElement ? <span class="hljs-built_in">document</span>.documentElement : <span class="hljs-built_in">document</span>.body) : <span class="hljs-built_in">document</span>.body); } <span class="hljs-keyword">if</span> (targetElement != <span class="hljs-built_in">document</span>.documentElement && targetElement != <span class="hljs-built_in">document</span>.body) s.resizeHandler = s.resizeHandlerAlt; s.resizeHandler(); <span class="hljs-keyword">if</span> (screenX && screenY && !s.disabled) { s.init(); s.active = <span class="hljs-literal">true</span>; } } <span class="hljs-keyword">if</span> (<span class="hljs-built_in">document</span>.addEventListener) { <span class="hljs-built_in">document</span>.addEventListener(<span class="hljs-string">'DOMContentLoaded'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ s.start(<span class="hljs-literal">true</span>) }, <span class="hljs-literal">false</span>); <span class="hljs-built_in">window</span>.addEventListener(<span class="hljs-string">'load'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ s.start(<span class="hljs-literal">true</span>) }, <span class="hljs-literal">false</span>); } <span class="hljs-keyword">else</span> { addEvent(<span class="hljs-built_in">window</span>, <span class="hljs-string">'load'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> () </span>{ s.start(<span class="hljs-literal">true</span>) }); } } snowStorm = <span class="hljs-keyword">new</span> SnowStorm(); |
5. Code CSS totinh2.css
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
<span class="hljs-selector-tag">body</span>{ <span class="hljs-attribute">background-image</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">"images/anhnen2.jpg"</span>); <span class="hljs-attribute">background-repeat</span>: no-repeat; <span class="hljs-attribute">background-position</span>: center center; <span class="hljs-attribute">background-size</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">font</span>: <span class="hljs-number">16em</span>/<span class="hljs-number">1</span> Arial; } <span class="hljs-selector-class">.text--line</span> { <span class="hljs-attribute">font-size</span>: .<span class="hljs-number">5em</span>; } <span class="hljs-selector-tag">svg</span> { <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">width</span>: auto; <span class="hljs-attribute">height</span>: <span class="hljs-number">250px</span>; <span class="hljs-attribute">padding</span>:<span class="hljs-number">2px</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">20px</span>; } <span class="hljs-selector-class">.text-copy</span> { <span class="hljs-attribute">fill</span>: none; <span class="hljs-attribute">stroke</span>: white; <span class="hljs-attribute">stroke-dasharray</span>: <span class="hljs-number">7%</span> <span class="hljs-number">28%</span>; <span class="hljs-attribute">stroke-width</span>: <span class="hljs-number">3px</span>; <span class="hljs-attribute">animation</span>: stroke-offset <span class="hljs-number">4s</span> infinite linear; } <span class="hljs-selector-class">.text-copy</span><span class="hljs-selector-pseudo">:nth-child(1)</span> { <span class="hljs-attribute">stroke</span>: <span class="hljs-number">#360745</span>; <span class="hljs-attribute">stroke-dashoffset</span>: <span class="hljs-number">7%</span>; } <span class="hljs-selector-class">.text-copy</span><span class="hljs-selector-pseudo">:nth-child(2)</span> { <span class="hljs-attribute">stroke</span>: <span class="hljs-number">#D61C59</span>; <span class="hljs-attribute">stroke-dashoffset</span>: <span class="hljs-number">14%</span>; } <span class="hljs-selector-class">.text-copy</span><span class="hljs-selector-pseudo">:nth-child(3)</span> { <span class="hljs-attribute">stroke</span>: <span class="hljs-number">#E7D84B</span>; <span class="hljs-attribute">stroke-dashoffset</span>: <span class="hljs-number">21%</span>; } <span class="hljs-selector-class">.text-copy</span><span class="hljs-selector-pseudo">:nth-child(4)</span> { <span class="hljs-attribute">stroke</span>: <span class="hljs-number">#EFEAC5</span>; <span class="hljs-attribute">stroke-dashoffset</span>: <span class="hljs-number">28%</span>; } <span class="hljs-selector-class">.text-copy</span><span class="hljs-selector-pseudo">:nth-child(5)</span> { <span class="hljs-attribute">stroke</span>: <span class="hljs-number">#F8F8FF</span>; <span class="hljs-attribute">stroke-dashoffset</span>: <span class="hljs-number">35%</span>; } @<span class="hljs-keyword">keyframes</span> stroke-offset { 50% { <span class="hljs-attribute">stroke-dashoffset</span>: <span class="hljs-number">35%</span>; <span class="hljs-attribute">stroke-dasharray</span>: <span class="hljs-number">0</span> <span class="hljs-number">87.5%</span>; } } <span class="hljs-selector-tag">p</span>{ <span class="hljs-attribute">padding-top</span>: <span class="hljs-number">300px</span>; <span class="hljs-attribute">padding-left</span>: <span class="hljs-number">170px</span>; } |
Đấy thế nhé, anh em cứ việc thử đi nàng không đổ thì inbox cho tôi ngay tôi sẽ tặng lại 1 cô gái đẹp nhé.
……