forked from LanGuo/smartdown_vuegridlayout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smartdownCssGridTest.html
174 lines (136 loc) · 3.49 KB
/
smartdownCssGridTest.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<base href="https://smartdown.site/lib/">
<title>Smartdown Via bl.ocks.org</title>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<link rel=stylesheet href="https://unpkg.com/smartdown/docs/lib/smartdown.css">
<script src="https://smartdown.site/lib/smartdown.js"></script>
</head>
<body
style="margin:0;padding:0;background:white;">
<style>
.outerContainer {
display: grid;
grid-template-columns: [start] 1fr [line2] 1fr [line3] 1fr [end];
grid-template-rows: auto;
grid-column-gap: 10px;
xjustify-items: center;
grid-template-areas:
"output1 output2 output3";
}
#smartdown-output1 {
grid-area: output1;
}
#smartdown-output2 {
grid-area: output2;
}
#smartdown-output3 {
grid-area: output3;
}
</style>
<div class="outerContainer">
<div
class="smartdown-container"
id="smartdown-output1">
</div>
<hr>
<div
class="smartdown-container"
id="smartdown-output2">
</div>
<hr>
<div
class="smartdown-container"
id="smartdown-output3">
</div>
</div>
<script>
/* eslint-disable */
/* global smartdown */
var baseURL = 'https://smartdown.site/';
var svgIcons = {
};
function smartdownLoaded() {
console.log('smartdownLoaded... populating DIVs');
var div1 = document.getElementById('smartdown-output1');
var div2 = document.getElementById('smartdown-output2');
var div3 = document.getElementById('smartdown-output3');
var text1 =
`
### Welcome to Div1
[What is your name?](:?Name)
#### A Few of My Favorite Things
- Raindrops on Roses
- Whiskers on Kittens
- Bright copper kettles
- Warm woollen mittens
- Brown paper packages tied up with strings
`;
var text2 =
`
### Welcome to Div2
Pleasant to meet you, [](:!Name)
`;
var text3 =
`
### Welcome to Div3
\`\`\`p5js/playable
var PI = Math.PI;
var HALF_PI = PI / 2.0;
var SEGMENTS = env.SEGMENTS || 50; // number of segments
var SEG_WIDTH = env.SEG_WIDTH || 8;
var SEG_LENGTH = env.SEG_LENGTH || 100;
var DIAMETER = SEG_LENGTH * 2;
var speed = 0.05;
var ax = .01;
var ay = ax;
var az = ay;
var dx, dy, dz;
p5.setup = function() {
dx = p5.random(-speed, speed);
dy = p5.random(-speed, speed);
dz = p5.random(-speed, speed);
p5.createCanvas(200, 200, 'webgl');
p5.normalMaterial();
p5.frameRate(35);
};
p5.draw = function() {
p5.camera(0, SEG_LENGTH, SEG_LENGTH, 0, 0, 0, 0, 1, 0);
p5.rotateX(ax += dx);
p5.rotateY(ay += dy);
p5.rotateZ(az += dz);
for (var i = 0; i < SEGMENTS; i++) {
var frac = i * 2 / SEGMENTS;
p5.push();
p5.rotateX(frac * HALF_PI);
p5.rotateY(HALF_PI);
p5.translate(
0,
DIAMETER * p5.cos(frac * HALF_PI),
DIAMETER * p5.sin(frac * PI));
p5.cylinder(SEG_WIDTH, SEG_LENGTH);
p5.pop();
}
};
\`\`\`
`;
smartdown.setSmartdown(text1, div1);
smartdown.setSmartdown(text2, div2);
smartdown.setSmartdown(text3, div3);
}
var calcHandlers = null;
const linkRules = [
];
smartdown.initialize(svgIcons, baseURL, smartdownLoaded, null, calcHandlers, linkRules);
</script>
</body>
</html>