This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
playground.html
59 lines (56 loc) · 1.8 KB
/
playground.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
layout: default
title: Interactive Playground
permalink: /playground/
redirect_from:
- /examples/
pens:
- title: Autosave
slug: RRYBEP
- title: Class vs Inline Style
slug: jAvpQL
- title: Form Submit
slug: kXRjQJ
- title: Quill Playground
slug: KzZqZx
---
<div class="container">
<div id="playground-container">
<h1>Interactive Playground</h1>
<iframe src="//codepen.io/anon/embed/{{page.pens.last.slug}}/?height=500&editable=true&embed-version=2&theme-id=23269&default-tab=js%2Cresult&user=anon" scrolling="no" frameborder="0" height="500" allowfullscreen="true"></iframe>
</div>
<div class="row" id="gallery-container">
{% for pen in page.pens %}
<div class="col-sm-4{% if forloop.last %} selected-pen{% endif %}">
<a href="/playground/#{{ pen.title | slugify }}" title="{{ pen.title }}" data-id="{{pen.slug}}">
<img src="https://codepen.io/quill/pen/{{pen.slug}}/image/small.png">
<span class="pen-label">{{pen.title}}</span>
</a>
</div>
{% endfor %}
</div>
{% include open-source.html %}
</div>
<!-- script -->
<script type="text/javascript">
$(document).ready(function() {
$('#gallery-container a').click(function(e) {
switchSelected(this);
});
if (window.location.hash) {
var anchor = $('#gallery-container a[href="/playground/' + window.location.hash + '"]');
if (anchor.length > 0) {
switchSelected(anchor);
}
}
function switchSelected(a) {
$('#gallery-container .selected-pen').removeClass('selected-pen');
$(a).parent().addClass('selected-pen');
var slug = $(a).attr('data-id');
var src = $('#playground-container iframe').attr('src').split('/');
src.splice(-2, 1, slug);
$('#playground-container iframe').attr('src', src.join('/'));
}
});
</script>
<!-- script -->