From d4d85eac150907f7d0e13fe4df5159aa802e1b1c Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Wed, 1 May 2013 17:14:29 +0800 Subject: [PATCH] fancy css --- CMakeLists.txt | 2 ++ share/base.css.in | 35 ++++--------------------- share/fancy.css.in | 59 ++++++++++++++++++++++++++++++++++++++++++ share/manifest | 2 ++ share/pdf2htmlEX.js.in | 2 +- 5 files changed, 69 insertions(+), 31 deletions(-) create mode 100644 share/fancy.css.in diff --git a/CMakeLists.txt b/CMakeLists.txt index d396417..5fcdb36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,6 +145,7 @@ configure_file (${CMAKE_SOURCE_DIR}/pdf2htmlEX.1.in ${CMAKE_SOURCE_DIR}/pdf2html include(${CMAKE_SOURCE_DIR}/src/css_class_names.cmakelists.txt) configure_file (${CMAKE_SOURCE_DIR}/src/util/css_const.h.in ${CMAKE_SOURCE_DIR}/src/util/css_const.h) configure_file (${CMAKE_SOURCE_DIR}/share/base.css.in ${CMAKE_SOURCE_DIR}/share/base.css) +configure_file (${CMAKE_SOURCE_DIR}/share/fancy.css.in ${CMAKE_SOURCE_DIR}/share/fancy.css) configure_file (${CMAKE_SOURCE_DIR}/share/pdf2htmlEX.js.in ${CMAKE_SOURCE_DIR}/share/pdf2htmlEX.js) add_executable(pdf2htmlEX @@ -204,6 +205,7 @@ target_link_libraries(pdf2htmlEX ${PDF2HTMLEX_LIBS}) install (TARGETS pdf2htmlEX DESTINATION bin) file (GLOB datafiles share/base.css + share/fancy.css share/jquery.js share/pdf2htmlEX.js share/manifest diff --git a/share/base.css.in b/share/base.css.in index ddfc284..eeddbd1 100644 --- a/share/base.css.in +++ b/share/base.css.in @@ -7,35 +7,13 @@ top:0; left:0; bottom:0; - width:193px; - overflow:auto; + width:250px; + padding:0px; margin:0px; - padding:0 0 0 7px; - background-color:#707070; + overflow:auto; display:none; } -#pdf-outline ul { - margin-left:13px; - margin-right:3px; - padding-left:3px; -} -#pdf-outline li { - list-style-type:disc; - list-style-position:outside; -} -#pdf-outline a { - font-size:13px; - color:#e8e8e8; -} -#pdf-outline a:visited { - color:#e8e8e8; -} -#pdf-outline a:hover{ - color:#e8e8e8; -} -#pdf-outline a:active{ - color:#e8e8e8; -} + #pdf-main { /* PDF container */ position:absolute; top:0; @@ -47,7 +25,7 @@ @media screen { /* for sidebar */ #pdf-outline.opened { display:block; } - #pdf-outline.opened + #pdf-main { left:200px; } + #pdf-outline.opened + #pdf-main { left:250px; } #pdf-main { /* `bottom' and `right' are required for lazy page loading in pdf2htmlEX.js (page visibility test) * alternatively you may set width and height @@ -55,7 +33,6 @@ bottom:0; right:0; overflow:auto; - background-color:#808080; } } @media print { @@ -81,9 +58,7 @@ */ .@CSS_PAGE_DECORATION_CN@ { /* page decoration */ position:relative; - margin: 13px auto; border-width: 0; - box-shadow: 1px 1px 3px 1px #333; overflow: hidden; } .@CSS_PAGE_FRAME_CN@ { /* page */ diff --git a/share/fancy.css.in b/share/fancy.css.in new file mode 100644 index 0000000..2362cc0 --- /dev/null +++ b/share/fancy.css.in @@ -0,0 +1,59 @@ +/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab filetype=css: */ +/* Fancy styles */ +/* Copyright 2013 Lu Wang */ +@media screen { + #pdf-outline { + background-color:#2f3236; + /* modified from http://philbit.com/svgpatterns/#crossstripes */ + background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjNDAzYzNmIj48L3JlY3Q+CjxwYXRoIGQ9Ik0wIDBMNCA0Wk00IDBMMCA0WiIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2U9IiMxZTI5MmQiPjwvcGF0aD4KPC9zdmc+"); + font-family: Georgia, serif; + font-size:13px; + width:243px; + padding:0 0 0 7px; + } + #pdf-outline ul { + margin:0 0.5em; + padding:0; + } + #pdf-outline li { + list-style-type:none; + margin:1em 0; + } + #pdf-outline li > ul { + margin-left: 1em; + } + #pdf-outline a, + #pdf-outline a:visited, + #pdf-outline a:hover, + #pdf-outline a:active { + line-height:1.2; + color:#e8e8e8; + text-overflow:ellipsis; + white-space:nowrap; + text-decoration:none; + display:block; + overflow:hidden; + } + #pdf-outline a:hover { + color:rgb(0,204,255); + } + #pdf-main { + background-color:#9e9e9e; + /* http://philbit.com/svgpatterns/#thinstripes */ + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjUiPgo8cmVjdCB3aWR0aD0iNSIgaGVpZ2h0PSI1IiBmaWxsPSIjOWU5ZTllIj48L3JlY3Q+CjxwYXRoIGQ9Ik0wIDVMNSAwWk02IDRMNCA2Wk0tMSAxTDEgLTFaIiBzdHJva2U9IiM4ODgiIHN0cm9rZS13aWR0aD0iMSI+PC9wYXRoPgo8L3N2Zz4="); + } + .@CSS_PAGE_DECORATION_CN@ { + margin: 13px auto; + box-shadow: 1px 1px 3px 1px #333; + } + @keyframes fadein { from { opacity:0;} to { opacity:1;} } + @-moz-keyframes fadein { from { opacity:0;} to { opacity:1;} } + @-webkit-keyframes fadein { from { opacity:0;} to { opacity:1;} } + @-o-keyframes fadein { from { opacity:0;} to { opacity: 1;} } + + .@CSS_PAGE_CONTENT_BOX_CN@.opened { /* used by pdf2htmlEX.js, to show/hide pages */ + -moz-animation: fadein 100ms; + -webkit-animation: fadein 100ms; + -o-animation: fadein 100ms; + } +} diff --git a/share/manifest b/share/manifest index 0be2144..c369f17 100644 --- a/share/manifest +++ b/share/manifest @@ -24,6 +24,8 @@ # base CSS styles @base.css +# fancy CSS styles +@fancy.css # PDF specific CSS styles $css # necessary Javascript codes diff --git a/share/pdf2htmlEX.js.in b/share/pdf2htmlEX.js.in index d27f6ab..e1c2965 100644 --- a/share/pdf2htmlEX.js.in +++ b/share/pdf2htmlEX.js.in @@ -114,7 +114,7 @@ var pdf2htmlEX = (function(){ $.extend(pdf2htmlEX.Viewer.prototype, { /* Constants */ - render_timeout : 130, + render_timeout : 100, scale_step : 0.9, init_before_loading_content : function() {