From 9e8a22b08a9ea3e746c4c16f0a06beabd2dd7294 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 1 Mar 2020 14:04:54 -0500 Subject: Add support for different sections for term content --- ext/mixed/css/display-dark.css | 2 ++ ext/mixed/css/display-default.css | 2 ++ ext/mixed/css/display.css | 13 +++++++++++++ 3 files changed, 17 insertions(+) (limited to 'ext/mixed/css') diff --git a/ext/mixed/css/display-dark.css b/ext/mixed/css/display-dark.css index c9cd9f90..908d9cc5 100644 --- a/ext/mixed/css/display-dark.css +++ b/ext/mixed/css/display-dark.css @@ -19,6 +19,8 @@ body { background-color: #1e1e1e; color: #d4d4d4; } +h2 { border-bottom-color: #2f2f2f; } + .navigation-header { background-color: #1e1e1e; border-bottom-color: #2f2f2f; diff --git a/ext/mixed/css/display-default.css b/ext/mixed/css/display-default.css index 6eee43c4..e43e3742 100644 --- a/ext/mixed/css/display-default.css +++ b/ext/mixed/css/display-default.css @@ -19,6 +19,8 @@ body { background-color: #ffffff; color: #333333; } +h2 { border-bottom-color: #eeeeee; } + .navigation-header { background-color: #ffffff; border-bottom-color: #eeeeee; diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css index 688a357c..51015057 100644 --- a/ext/mixed/css/display.css +++ b/ext/mixed/css/display.css @@ -65,6 +65,14 @@ ol, ul { height: 2.28571428em; /* 14px => 32px */ } +h2 { + font-size: 1.25em; + font-weight: normal; + margin: 0.25em 0 0; + border-bottom-width: 0.05714285714285714em; /* 14px * 1.25em => 1px */ + border-bottom-style: solid; +} + /* * Navigation */ @@ -422,6 +430,11 @@ button.action-button { display: inline; } +.term-entry-body[data-section-count="0"] .term-entry-body-section-header, +.term-entry-body[data-section-count="1"] .term-entry-body-section-header { + display: none; +} + /* * Kanji -- cgit v1.2.3 From 97a520cc1595369dc18ddcf74ab7f0ba4e03f55b Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 1 Mar 2020 14:15:28 -0500 Subject: Add support for displaying pitch accents --- ext/mixed/css/display-dark.css | 8 +- ext/mixed/css/display-default.css | 8 +- ext/mixed/css/display.css | 101 ++++++++++++++++++++++++ ext/mixed/display-templates.html | 6 ++ ext/mixed/js/display-generator.js | 159 +++++++++++++++++++++++++++++++++++++- 5 files changed, 277 insertions(+), 5 deletions(-) (limited to 'ext/mixed/css') diff --git a/ext/mixed/css/display-dark.css b/ext/mixed/css/display-dark.css index 908d9cc5..dc344099 100644 --- a/ext/mixed/css/display-dark.css +++ b/ext/mixed/css/display-dark.css @@ -59,12 +59,14 @@ h2 { border-bottom-color: #2f2f2f; } color: #666666; } -.term-definition-container, -.kanji-glossary-container { +.term-definition-list, +.term-pitch-accent-group-list, +.kanji-glossary-list { color: #888888; } .term-glossary, +.term-pitch-accent, .kanji-glossary { color: #d4d4d4; } @@ -74,3 +76,5 @@ h2 { border-bottom-color: #2f2f2f; } background-color: #d4d4d4; color: #1e1e1e; } + +.term-pitch-accent-character:before { border-color: #ffffff; } diff --git a/ext/mixed/css/display-default.css b/ext/mixed/css/display-default.css index e43e3742..81623ebc 100644 --- a/ext/mixed/css/display-default.css +++ b/ext/mixed/css/display-default.css @@ -59,12 +59,14 @@ h2 { border-bottom-color: #eeeeee; } color: #999999; } -.term-definition-container, -.kanji-glossary-container { +.term-definition-list, +.term-pitch-accent-group-list, +.kanji-glossary-list { color: #777777; } .term-glossary, +.term-pitch-accent, .kanji-glossary { color: #000000; } @@ -74,3 +76,5 @@ h2 { border-bottom-color: #eeeeee; } background-color: #333333; color: #ffffff; } + +.term-pitch-accent-character:before { border-color: #000000; } diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css index 51015057..0a1ba658 100644 --- a/ext/mixed/css/display.css +++ b/ext/mixed/css/display.css @@ -436,6 +436,107 @@ button.action-button { } +/* + * Pitch accent styles + */ + +.term-pitch-accent-group-list { + margin: 0; + padding: 0; + list-style-type: none; +} + +.term-pitch-accent-group-list:not([data-count="0"]):not([data-count="1"]) { + padding-left: 1.4em; + list-style-type: decimal; +} + +.term-pitch-accent-list { + margin: 0; + padding: 0; + list-style-type: none; + display: inline; +} + +.term-pitch-accent-list:not([data-count="0"]):not([data-count="1"]) { + padding-left: 1.4em; + list-style-type: circle; + display: block; +} + +.term-pitch-accent { + display: inline; + line-height: 1.5em; +} + +.term-pitch-accent-list:not([data-count="0"]):not([data-count="1"])>.term-pitch-accent { + display: list-item; +} + +.term-pitch-accent-group-tag-list { + margin-right: 0.375em; +} +.entry[data-unique-expression-count="1"] .term-pitch-accent-expression-list { + display: none; +} +.term-pitch-accent-expression:not(:last-of-type):after { + content: "\3001"; +} +.term-pitch-accent-expression:last-of-type:after { + content: "\FF1A"; +} + +.term-pitch-accent-tag-list:not([data-count="0"]) { + margin-right: 0.375em; +} + +.term-special-tags>.pitches { + display: inline; +} + +.term-pitch-accent-character { + display: inline-block; + position: relative; +} +.term-pitch-accent-character[data-pitch='high']:before { + content: ""; + display: block; + user-select: none; + pointer-events: none; + position: absolute; + top: 0.1em; + left: 0; + right: 0; + height: 0; + border-top-width: 0.1em; + border-top-style: solid; +} +.term-pitch-accent-character[data-pitch='high'][data-pitch-next='low']:before { + right: -0.1em; + height: 0.4em; + border-right-width: 0.1em; + border-right-style: solid; +} +.term-pitch-accent-character[data-pitch='high'][data-pitch-next='low'] { + padding-right: 0.1em; + margin-right: 0.1em; +} + +.term-pitch-accent-position:before { + content: " ["; +} +.term-pitch-accent-position:after { + content: "]"; +} + +.term-pitch-accent-details { + display: inline-block; + height: 0; + padding: 0 0.25em; + vertical-align: middle; +} + + /* * Kanji */ diff --git a/ext/mixed/display-templates.html b/ext/mixed/display-templates.html index 837245cf..c6f208a8 100644 --- a/ext/mixed/display-templates.html +++ b/ext/mixed/display-templates.html @@ -19,6 +19,7 @@

Pitch Accents

    +

    Definitions

      
       
      @@ -36,6 +37,11 @@
       
       
       
      +
      +
      +
      +
      +
       
       
      -
      -
      +
      +