From 064c0f689f1e7eb09566c6751130cd9b7bfda49f Mon Sep 17 00:00:00 2001 From: wqj97 Date: Sat, 17 Dec 2016 01:52:07 +0800 Subject: [PATCH] #1 add transform:translate3D(0,0,0) to shine-letter class. to use GPU accelerate #2 add media query disable text-shadow when print when print, text-shadow may made text difficult to read --- demos/css/demo.css | 6 ++++++ lib/shine.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/demos/css/demo.css b/demos/css/demo.css index c217e22..e62a401 100644 --- a/demos/css/demo.css +++ b/demos/css/demo.css @@ -21,3 +21,9 @@ letter-spacing: -0.02em; line-height: 1.2em; } + +@media print { + .shine-letter{ + text-shadow: none!important; + } +} \ No newline at end of file diff --git a/lib/shine.js b/lib/shine.js index c778926..d0082ae 100644 --- a/lib/shine.js +++ b/lib/shine.js @@ -153,6 +153,10 @@ shinejs.Shine.prototype.disableAutoUpdates = function() { */ shinejs.Shine.prototype.getCSS = function() { return '/* shine.js styles */' + + '@media print {' + + '.shine-letter{' + + 'text-shadow: none!important;' + + '}}' + '.shine-wrapper {' + ' display: inline-block;' + ' position: relative;' + @@ -167,6 +171,7 @@ shinejs.Shine.prototype.getCSS = function() { '.shine-letter {' + ' position: relative;' + ' display: inline-block;' + + ' transform: translate3d(0,0,0);' + '}' + '' + '.shine-mask {' +