Coder Social home page Coder Social logo

anki-templates's Introduction

Anki Dynamic Configurable Templates

This is Anki dynamic configurable note template(facebook color style) with below feture:

  1. configurable checkbox to load and save configuration
  2. js helper function to autoplay OTF(on the fly media) online audio
  3. js helper function to hide/display hint section
  4. js helper function to help customize content and highlight tag
  5. version detection and update.

Template Usage

  • You can click checkbox on head section to change option. That will be effective during one review session(iOS/Desktop version only)

  • You can change these options on note template's style section by true/false setting. That will be effective on all card's lifecycle.
    //audio autoplay
    config.audio    = false; 

    //hide or display hint section
    config.fold     = true;  
    
    //other config might be added
    config.example  = false;  
  • You can click notes/sentences section head(blue) to hide and display section content.

Template Preview

  • Status with hidden notes/sentences section on/off, audio autoplay on/off and example of definition on/off.

  • Display hint section and show version update information at head section

This Template was inspired by ecator


Anki Static Templates

5 pre-built anki static templates(CSS), including 4 English templates & 1 Chinese template.

  • English Template
    • BLue Color
    • RGB 3 Colors
    • vocabulary.com Template
    • Dict Helper Template
  • Chinese Template
    • Zdict Chinese Template

Anki 笔记/卡片模板

5套用于Anki学习使用的预定义模板(CSS),含4套英语模板和1套汉语汉典模板

  • 英语模板
    • 蓝色模板
    • 三色模板
    • vocabulary.com模板
    • 划词制卡助手模板
  • 汉语模板
    • 汉语汉典模板

Template Preview(模板预览)

  • English Blue/RBG Template(英语蓝色/三色模板)

English Blue Template English RGB Template

  • English Vocabulary.com Template(英语vocab配色模板)

English Vocabulary.com Template

  • English Anki Dict Helper Template(英语Anki划词助手模板)

English Dict Helper Template English Dict Helper Template

  • Chinese Zdict Template(汉语汉典模板)

Chinese Zdict Template

anki-templates's People

Contributors

ninja33 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anki-templates's Issues

dark 模式的支持

老黄您好。我之前一直在用你的全家桶来背单词和标记新词,受益良多,非常感谢!

最近 iOS 13 出来了,支持 dark 模式,我是 dark 模式爱好者,而 dark 模式下,现在的英语模板显得有点太耀眼了,所以我修改了下样式文件,做了一套 dark 模式的模板。现在我把它放在下面,有需要的话可以参考一下。

因为我自己不打算再用回 light 模式模板没有考虑双模式支持,不好意思。模板也根据我自己的需求进行了一些微小的调整

card1:

<!-- config & version section-->
<div class="section">
    <div class="bar config">Config
        <input type="checkbox" id="audio" onchange="saveConfig(this,'audio')">AutoPlay
        <input type="checkbox" id="fold" onchange="saveConfig(this,'fold')">HideHint
        <input type="checkbox" id="example" onchange="saveConfig(this,'example')">Example
    </div>
    <!--  versioncsection -->
    <div id='version' class='item'></div>
</div>

<!-- front section -->
<div class="section">
    <div id="front" class="items">
        <span>{{expression}}</span>
    </div>
    <hr>
    <div id="phonetic" class="items">
        <span>{{reading}}</span>
        <audio id="player" src="">{{audio}}</audio>
    </div>
</div>

<script type="text/javascript">
    loadConfig();
</script>

card2:

{{FrontSide}}

<!-- back section -->
{{#glossary}}
<div class="section">
  <div id="back" class="items">{{glossary}}</div>
</div>
{{/glossary}}

{{#notes}}
<div class="section">
  <div class="bar note" onclick="toggle('note')">Notes</div>
  <div id="note" class="items">{{notes}}</div>
</div>
{{/notes}}

{{#sentence}}
<div class="section">
  <div class="bar sentence" onclick="toggle('sentence')">Sentence</div>
  <div id="sentence" class="backlist items">{{sentence}}</div>
</div>
{{/sentence}}

<!-- foot section -->
<div class="bar foot">
  <div id="url"><a href={{text:url}}>URL</a></div>
</div>
{{audio}}
<script type="text/javascript">
  //customzied format function
  clearFormat();

  //hide hint based on config
  if (config.fold) {
    toggle('note');
    toggle('sentence');
  }

  //sample function
  highlightTag()

//sample function
//makeCloze()
</script>

style

</style>
<!-- 
author:ninja33  https://github.com/ninja33/anki-templates
inspired by: https://github.com/ecator/
-->

<script type="text/javascript">
  //declare global var config
  if (typeof (config) == "undefined") {
    var config = {};
    //audio autoplay
    config.audio = true;

    //hide or display hint section
    config.fold = true;

    //other config might be added
    config.example = true;

    config.version = '1.0';

    window.name = JSON.stringify(config);
  }
</script>

<style>
  /*global card style*/
  .card {
    font-family: helvetica, arial, sans-serif;
    font-size: 16px;
    text-align: left;
    color: #d9d9d9;
    background-color: #1e1e1e;
  }

  /*head & foot global style */
  .bar {
    border-bottom: 1px solid #455069;
    color: #ddd;
    padding: 5px;
    padding-left: 35px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    background: #455069;
    background-repeat: no-repeat;
    background-position: 5px center;
  }

  .bar #url a {
    text-decoration: none;
    font-size: 12px;
    color: #d9d9d9;
    font-weight: bold;
  }

  /*head style*/
  .config {
    background-image: url(_toggles.png);
  }

  .head {
    background-image: url(_search.png)
  }

  .back {
    background-image: url(_bulb.png)
  }

  .note {
    background-image: url(_pencil.png)
  }

  .sentence {
    background-image: url(_clipboard.png)
  }

  /*foot style*/
  .foot {
    background-image: url(_cloud.png)
  }

  /* section global style */
  .section {
    border-color: #303030;
    background-color: #303030;
    position: relative;
    margin: 5px 0;
  }

  /* item global style */
  .items {
    margin: 0 12px;
    padding: 8px 0;
  }

  hr {
    border: 0;
    margin: 3px 13px;
    border-top: 1px solid #666;
  }

  /* front & back global style */
  #front,
  #back {
    line-height: 1.5em;
  }

  /* front field style */
  #front {
    font-size: 36px;
    color: #ddd;
    text-align: left;
  }

  #front span {
    display: inline-block;
    vertical-align: middle;
  }

  #front img {
    width: 36px;
    height: 36px;
    top: 6px;
    position: relative;
    margin-left: 10px;
  }

  /* back field style */
  #back {
    font-size: 16px;
    color: #ddd;
    text-align: left;
  }

  /* Tag highlight style */
  .highlight {
    font-size: 12px;
    border-radius: 4px;
    color: #f2f2f2;
    padding: 0 3px;
    margin-right: 5px;
    font-weight: bold;
  }

  /* phonetic style */
  #phonetic {
    font-size: 14px;
  }

  #sentence b {
    font-weight: normal;
    border-radius: 3px;
    color: #d9d9d9;
    background-color: #666;
    padding: 0 3px;
  }

  #sentence hr {
    border: 0;
    margin: 8px 0px;
    border-top: 1px solid #333;
  }

  /* version style */
  #version {
    text-align: center;
    font-size: 12px;
  }
</style>

<!-- 
JS helper functions
-->
<script>
  //hide or display hint
  function toggle(e) {
    var box = document.getElementById(e);
    if (box)
      if (box.style.display == 'none') {
        box.style.display = 'block';
      }
      else {
        box.style.display = 'none';
      }
  }

  //save config
  function saveConfig(obj, item) {
    config[item] = obj.checked;
    window.name = JSON.stringify(config);
  }

  //load config
  function loadConfig() {
    document.getElementById("audio").checked = config.audio
    document.getElementById("fold").checked = config.fold
    document.getElementById("example").checked = config.example
  }

  //delete HTML element
  function removeTag(tag) {
    var items = document.querySelectorAll(tag);
    for (var i = 0; i < items.length; i++) {
      items[i].outerHTML = "";
    }
  }

  //clear WordQuery output Format
  function clearFormat() {
    var ex = document.querySelectorAll(".explanation_box .text_blue");
    for (var i = 0; i < ex.length; i++) {
      ex[i].outerHTML = ex[i].outerHTML + "<br>";
    }

    var ex = document.querySelectorAll(".explanation_box .explanation_label");
    for (var i = 0; i < ex.length; i++) {

      ex[i].innerHTML = ex[i].innerHTML.replace(/.?\[(.+?)[\s|-].+/g, "$1").toLowerCase() + ".";
      //alert(ex[i].innerHTML)
    }

    removeTag(".word_header");
    removeTag(".item_number");
    if (!config.example) {
      removeTag(".explanation_item>ul");
    }
  }

  //sample functions: make cloze
  function makeCloze() {
    var bb = document.querySelectorAll("#back b");
    for (var i = 0; i < bb.length; i++) {
      bb[i].innerHTML = "____";
    }
  }

  //sample functions: highlight tag
  function highlightTag() {
    var colorMap = {
      'n.': '#e3412f',
      'a.': '#f8b002',
      'adj.': '#f8b002',
      'ad.': '#684b9d',
      'adv.': '#684b9d',
      'v.': '#539007',
      'vi.': '#539007',
      'vt.': '#539007',
      'verb.': '#539007',
      'phrase.': '#04B7C9',
      'prep.': '#04B7C9',
      'conj.': '#04B7C9',
      'pron.': '#04B7C9',
      'art.': '#04B7C9',
      'num.': '#04B7C9',
      'int.': '#04B7C9',
      'interj.': '#04B7C9',
      'modal.': '#04B7C9',
      'aux.': '#04B7C9',
      'pl.': '#D111D3',
      'abbr.': '#D111D3',
    };
    [].forEach.call(document.querySelectorAll('#back'), function (div) {
      div.innerHTML = div.innerHTML.replace(/\b[a-z]+\./g, function (symbol) {
        if (colorMap[symbol]) {
          return '<a class="highlight" style="color: #eee; background-color: ' + colorMap[symbol] + ';" >' + symbol + '</a>';
        } else {
          return symbol;
        }
      });
    });
  }

</script>

<style>

把fearfare090807制作的词典LDOCE5V1.35用FastWordQuery添加时出现问题

查fold这个词。
把fearfare090807制作的词典LDOCE5V1.35用FastWordQuery添加时出现问题:
Autoplay没有打钩,翻开背面的时候会自动播放所有包括例句的语音。
但是例句前的小喇叭图标没了。

我把media在内的出现问题的词牌导出来了,能帮忙看看吗?

老黄大神已经告知在下用插件解决。

请问图标是怎么添加的

请问Notes Sentences Cloud这几个图标是怎么添进去的?
因为自己正在制作的卡片需要添加一些其它的项目,为了统一美观,想在其它项目上也添加图标。还望赐教!

请问Dynamic模板的Example功能如何实现?

我导入了您的Dynamic模板后,尝试制卡后发现不知道怎么实现Example这功能。
例如,您自带的sample “good”这单词,点击Example能on/off例句,但别的单词如“test”就不行。
因为我css,js这方面完全不懂,看不懂您的语法,所以想请问下如果我自己制卡怎么实现这功能呢
屏幕截图 2021-12-29 211036

单词的发音能换成audio中的音频吗?

老黄你好,
我在用您制作的COCA apkg学习单词,里面的发音是从网络上提取的,我想换成利用AwesomeTTS提取的本地的朗文6的发音,该怎么修改呢? PC端修改后,手机端也是朗文6的发音吗? 多谢。

点击那个按钮以展开例句没有反应

English Blue/RBG Template(英语蓝色/三色模板),在iOS版本上,点击那个按钮以展开例句没有反应哎,在android和pc上可以,不知道有没有解决办法?谢谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.