Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script src="https://unpkg.com/papaparse@latest/papaparse.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"></script>
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
<div id="terms-list" class="m-8 w-1/2">
<div class="flex items-center justify-between">
  <input class="search shadow-inner p-1 border-2 search" placeholder="Suchwörter" />
  <div class=""><span class="sort button text-green-600 hover:bg-green-50 p-1.5 cursor-pointer" data-sort="date">Sort by year</span><span class="sort p-1.5 text-green-600 border border-green-600 hover:bg-green-50 cursor-pointer" data-sort="EnglishTerm">Sort by EN</span>
    <span class="sort p-1.5 button border text-green-600 border-green-600 hover:bg-green-50 cursor-pointer" data-sort="DeutscherBegriff">Sort by DE</span>
</div>
  </div>
  
  <ul class="list mt-4"></ul>
  <ul class="pagination list-none"></ul>
</div>

              
            
!

CSS

              
                .search {

}

.pagination > li {
  display: inline-block;
  margin-left:.25rem;
  padding: 1rem;
}

.sort.asc::after {
  content: "\002B06";
  padding-left: 3px;
  }
.sort.desc::after {
  content: "\002B07";
  padding-left: 3px
  }
              
            
!

JS

              
                var options = {
  valueNames: [ 'EnglishTerm', 'DeutscherBegriff', 'Scope', 'date' ],
  item: '<li class="p-4 my-1 bg-gray-100"><h3 class="font-bold text-indigo-800 text-lg"><span class="EnglishTerm"></span><span class="mx-1">-</span><span class="DeutscherBegriff"></span></h3><p class="Scope mt-2"></p><p class="mt-4"><span>Eingeführt: </span><span class="date font-bold text-pink-600"></span></p></li>',
  page: 5,
  pagination: true,
  indexAsync: true,
  searchDelay: 750
};

//terms = results.data;
var termsList = new List('terms-list', options);

let terms = [];

// Getting the JSON via a SPARQL query via the TRIPLY api
//let apiUrl = 'https://api.triplydb.com/queries/ttr/Query-4/run'
//async function getJson(url) {
//    let response = await fetch(url);
//    let data = await response.json()
//    return data;
//}
//async function main() {
//    terms = await getJson(apiUrl)
//    console.log(terms);
//    termsList.add(terms, function(items) { console.log('All ' + items.length + ' items were added!');}), options;
//}
//main();

//Pulling json from a local file:

//Alternatively, pull the data from a local csv file using Papa Parse:
//let config = { header: true }
//let csvString = '"EnglishTerm","DeutscherBegriff","Scope","date"\n"Achilles Tendon","Achillessehne","The tendon that connects muscles in the calf of the leg to the heel bone. The Achilles tendon reflex, also known as the ankle jerk reflex, occurs when the tendon is tapped while the foot is dorsiflexed.","2019"';
//var results = Papa.parse(csvString, config);
//console.log(results);

// Getting JSON from a local file (after saving the triply output. Click the api call above the sparql editor. Or use this url in the browser and save results in a json file. 
//run.json

terms = [
  {
    "EnglishTerm": "Achilles Tendon",
    "DeutscherBegriff": "Achillessehne",
    "Scope": "The tendon that connects muscles in the calf of the leg to the heel bone. The Achilles tendon reflex, also known as the ankle jerk reflex, occurs when the tendon is tapped while the foot is dorsiflexed.",
    "date": "2019"
  },
  {
    "EnglishTerm": "Acute Illness",
    "DeutscherBegriff": "Akute Krankheit",
    "Scope": "A disease or disorder with an abrupt onset and short duration. Used in conjunction with other specific terms where appropriate.",
    "date": "2020"
  },
  {
    "EnglishTerm": "Acute Pain",
    "DeutscherBegriff": "Akuter Schmerz",
    "Scope": "Pain that starts suddenly and has a limited duration. Compare to CHRONIC PAIN.",
    "date": "2020"
  },
  {
    "EnglishTerm": "Adaptive Behavior Measures",
    "DeutscherBegriff": "Messung adaptiven Verhaltens",
    "Scope": "Behavioral measures or tasks used to assess ability to perform daily tasks and adjust to the environment, consistent with societal roles and demands. Behaviors and skills include self-help, health care, mobility, communication, independence, and personal and social responsibility.",
    "date": "2019"
  }
]
termsList.add(terms, function(items) { console.log('All ' + items.length + ' items were added!');}), options;
//
              
            
!
999px

Console