From b2b3d72e03cf934d66ab65915bb577793574c6f9 Mon Sep 17 00:00:00 2001 From: gine Date: Fri, 10 Mar 2017 00:47:04 +0100 Subject: [PATCH] Init ribbon --- css/ilovexm24.css | 26 +++++++++++++++++ ilovexm24.php | 73 +++++++++++++++++++++++++++++++++++++++++++++++ js/ilovexm24.js | 3 ++ 3 files changed, 102 insertions(+) create mode 100644 css/ilovexm24.css create mode 100644 ilovexm24.php create mode 100644 js/ilovexm24.js diff --git a/css/ilovexm24.css b/css/ilovexm24.css new file mode 100644 index 0000000..f418a8d --- /dev/null +++ b/css/ilovexm24.css @@ -0,0 +1,26 @@ +.ilovexm24_content { + font-family: Helvetica; + font-weight: bolder; + font-size: 1.4em; + width: 200px; + background: #FFF; + text-align: center; + line-height: 50px; + letter-spacing: 1px; + color: red; + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); + position: fixed; + box-shadow: 0 0 10px rgba(0,0,0,.3); + top: 25px; + right: -50px; + transform: rotate(45deg); + -webkit-transform: rotate(45deg); + background: #FFF; + z-index:9999; +} + +.ilovexm24_link:hover, +.ilovexm24_link { + color: #FF0000; +} diff --git a/ilovexm24.php b/ilovexm24.php new file mode 100644 index 0000000..f388ef7 --- /dev/null +++ b/ilovexm24.php @@ -0,0 +1,73 @@ +'. + ''. + $xm24_text. + ''. + ''; + + return $ribbon; + } + + public function ilovexm24_load_scripts(){ + wp_register_style( 'ilovexm24', plugins_url( 'css/ilovexm24.css', __FILE__), false, true ); + wp_enqueue_style( 'ilovexm24' ); + + wp_register_script( 'ilovexm24', plugins_url('js/ilovexm24.js', __FILE__), false, false, true); + wp_enqueue_script( 'ilovexm24'); + + $attrs = Array( + 'ribbon' => $this->getHtmlRibbon() + ); + + wp_localize_script( 'ilovexm24', 'attrs', $attrs ); + } +} + +$xm24r = new Xm24_Ribbon(); diff --git a/js/ilovexm24.js b/js/ilovexm24.js new file mode 100644 index 0000000..32916b9 --- /dev/null +++ b/js/ilovexm24.js @@ -0,0 +1,3 @@ +var div = document.createElement('div'); +div.innerHTML = attrs.ribbon; +document.body.appendChild(div);