Changeset 2480216
- Timestamp:
- 02/23/2021 10:39:32 PM (5 years ago)
- Location:
- magic/trunk
- Files:
-
- 1 added
- 2 edited
-
magic.php (modified) (2 diffs)
-
magic1.3.zip (added)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
magic/trunk/magic.php
r2479879 r2480216 3 3 * Plugin Name: Magic 4 4 * Plugin URI: https://klaetke.com/wordpress-magic-plugin 5 * Description: Thanks for using the Magic Plugin. With the Following Shortcode you get the Magical Star Unicode Symbol with a awesome Click Aninmation. [magical_star], become a Magical Gradient Background with Animation [magical_gradient] More magic is coming in the next versions.6 * Version: 1. 25 * Description: Thanks for using the Magic Plugin. With the Following Shortcode you get the Magical Star Unicode Symbol with a awesome Click Aninmation. [magical_star], become a Magical Gradient Background with Animation [magical_gradient] A Magical Color Switcher you get with the Shortcode [magical_color] 6 * Version: 1.3 7 7 * Text Domain: klaetke.com 8 8 * Author: Toni Klätke … … 372 372 373 373 add_shortcode('magical_gradient', 'magic_two'); 374 375 function magic_randomcolor($atts) { 376 $Content .= '<style>html { 377 height: 100%; 378 } 379 380 body { 381 width: 100%; 382 height: 100%; 383 } 384 385 /* Animation Layer */ 386 body, button#change { 387 transition: all 0.4s ease-in-out; 388 }</style> 389 <h1 id="colour">#e63c44</h1> 390 <button class="ct-button" id="change">New Colour</button> 391 <script>var btn = document.getElementById("change"); 392 var text = document.getElementById("colour"); 393 394 var generator = function() { 395 newColour = "#"+(Math.random()*0xFFFFFF<<0).toString(16); 396 console.log(newColour.length); 397 if(newColour.length < 7) { 398 generator(); 399 } 400 } 401 402 btn.addEventListener("click", function() { 403 generator(); 404 405 document.body.style.background = newColour; 406 btn.style.color = newColour; 407 text.innerText = newColour; 408 }); 409 410 // dh = $(document).height(); 411 412 // $("#container").css({"padding-top":dh/3}); 413 414 // $("#change").click(function() { 415 // newColour = "#"+(Math.random()*0xFFFFFF<<0).toString(16); 416 // $("body").css({"background":newColour}); 417 // $("#change").css({"color":newColour}); 418 // $("#colour").text(newColour); 419 // });</script>'; 420 421 return $Content; 422 } 423 424 add_shortcode('magical_color_code', 'magic_randomcolor'); 425 426 function magic_randomcolor2($atts) { 427 $Content .= '<style>html { 428 height: 100%; 429 } 430 431 body { 432 width: 100%; 433 height: 100%; 434 } 435 436 /* Animation Layer */ 437 body, button#change { 438 transition: all 0.4s ease-in-out; 439 }</style> 440 <b style="display:none;" id="colour">#e63c44</b> 441 <button class="ct-button" id="change">New Colour</button> 442 <script>var btn = document.getElementById("change"); 443 var text = document.getElementById("colour"); 444 445 var generator = function() { 446 newColour = "#"+(Math.random()*0xFFFFFF<<0).toString(16); 447 console.log(newColour.length); 448 if(newColour.length < 7) { 449 generator(); 450 } 451 } 452 453 btn.addEventListener("click", function() { 454 generator(); 455 456 document.body.style.background = newColour; 457 btn.style.color = newColour; 458 text.innerText = newColour; 459 }); 460 461 // dh = $(document).height(); 462 463 // $("#container").css({"padding-top":dh/3}); 464 465 // $("#change").click(function() { 466 // newColour = "#"+(Math.random()*0xFFFFFF<<0).toString(16); 467 // $("body").css({"background":newColour}); 468 // $("#change").css({"color":newColour}); 469 // $("#colour").text(newColour); 470 // });</script>'; 471 472 return $Content; 473 } 474 475 add_shortcode('magical_color', 'magic_randomcolor2'); -
magic/trunk/readme.txt
r2479879 r2480216 4 4 Requires at least: 4.0 5 5 Tested up to: 5.6.1 6 Stable Tag: 1. 26 Stable Tag: 1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 30 30 * Small Bugfixes. 31 31 32 = 1. 1=32 = 1.2 = 33 33 * Magical Star & Magical Gradient now available. 34 35 = 1.3 = 36 * New: The Magical Color Switcher is now available. The third Function from Magic Plugin. Copy &b paste the Shortcode: [magical_color]
Note: See TracChangeset
for help on using the changeset viewer.