/images/avatar.png

ThreeJS示例

Threejs 代码片段 CSS: 1 2 3 4 canvas{ height:100%; } HTML: 1 2 3 4 5 6 7 8 9 10 11 <script src="https://cdn.jsdelivr.net/npm/[email protected]/build/three.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/examples/js/controls/OrbitControls.js"></script> <script src="https://cdn.jsdelivr.net/npm/mathbox@latest/build/bundle/mathbox.js"></script> <script src="https://d3js.org/d3.v6.min.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous"> <div id="three-canvas"> </div> JS: 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

RXJS 基础

点击 fromEvent 1 2 3 4 5 6 7 8 9 let click$ = Rx.Observable.fromEvent(button, 'click'); click$.subscribe(e=>{ console.log(e) const span= document.createElement("span"); span.innerHTML = e.pageX result.appendChild(span) })

Mathbox示例

Mathbox 代码片段 CSS: 1 2 3 4 canvas{ height:100%; } HTML: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@editorjs/[email protected]/dist/editor.min.js" ></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/build/three.min.js" ></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/examples/js/controls/OrbitControls.js" ></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathbox@latest/build/bundle/mathbox.js" ></script> <div id="three-canvas"> </div> JS: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Mathbox绘制线条

Mathbox 代码片段 CSS: 1 2 3 4 canvas{ height:100%; } HTML: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/build/three.min.js" ></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/examples/js/controls/OrbitControls.js" ></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathbox@latest/build/bundle/mathbox.js" ></script> <div id="three-canvas"> </div> JS: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 //绘

GraphXR Schema

GraphXR Schema 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 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 { "labels": { "Vehicle": { "name": "Vehicle", "props": [ "make", "model", "reg", "year" ] }, "Email": { "name": "Email", "props": [ "email_address" ] }, "Phone": { "name": "Phone", "props": [ "phoneNo" ] }, "Crime": { "name": "Crime", "props": [ "date", "id", "last_outcome", "type" ] }, "PhoneCall": { "name": "PhoneCall", "props": [ "call_date", "call_duration", "call_time", "call_type" ] }, "Person": { "name": "Person", "props": [ "name", "surname" ] }, "Location": { "name": "Location", "props": [ "address", "latitude", "longitude", "postcode" ] }, "Officer": { "name": "Officer", "props": [ "badge_no", "name", "rank", "surname" ] } }, "relationships": { "INVOLVED_IN": { "name": "INVOLVED_IN", "props": [] }, "FAMILY_REL": { "name": "FAMILY_REL", "props": [] }, "CALLER": { "name": "CALLER", "props": [] }, "KNOWS_PHONE": { "name": "KNOWS_PHONE", "props": [] }, "INVESTIGATED_BY": { "name": "INVESTIGATED_BY", "props": [] }, "HAS_EMAIL": { "name": "HAS_EMAIL", "props": [] }, "KNOWS_SN": { "name": "KNOWS_SN", "props": [] }, "KNOWS": { "name": "KNOWS", "props": [] }, "CALLED": { "name": "CALLED", "props": [] }, "CURRENT_ADDRESS": { "name": "CURRENT_ADDRESS", "props": [] }, "OCCURRED_AT": { "name": "OCCURRED_AT", "props": [] }, "KNOWS_LW": { "name": "KNOWS_LW", "props": [] }, "PARTY_TO": { "name": "PARTY_TO", "props": [] }, "HAS_PHONE": { "name": "HAS_PHONE", "props": [] } }, "indexs": {}, "schema": { "labels": [ "Vehicle", "Area", "Email", "Phone", "Crime", "PhoneCall", "Object", "PostCode", "Person", "Location", "Officer" ], "relationships": [ "INVOLVED_IN", "FAMILY_REL", "CALLER", "KNOWS_PHONE", "INVESTIGATED_BY", "HAS_EMAIL", "KNOWS_SN", "KNOWS", "CALLED", "CURRENT_ADDRESS", "OCCURRED_AT", "KNOWS_LW", "PARTY_TO", "HAS_PHONE" ], "maps": [ { "id": "-42", "name": "INVOLVED_IN", "startLabelName": "Vehicle", "endLabelName": "Crime" }, { "id": "-31", "name": "FAMILY_REL", "startLabelName": "Person", "endLabelName": "Person" }, { "id": "-35", "name": "CALLER", "startLabelName": "PhoneCall", "endLabelName": "Phone" }, { "id": "-38", "name": "KNOWS_PHONE", "startLabelName": "Person", "endLabelName": "Person" }, { "id": "-40", "name": "INVESTIGATED_BY", "startLabelName": "Crime", "endLabelName": "Officer" }, { "id": "-37", "name": "HAS_EMAIL", "startLabelName": "Person", "endLabelName": "Email" }, { "id": "-33", "name": "KNOWS_SN", "startLabelName": "Person", "endLabelName": "Person" }, { "id": "-32", "name": "KNOWS", "startLabelName": "Person", "endLabelName": "Person" }, { "id": "-34", "name": "CALLED", "startLabelName": "PhoneCall", "endLabelName": "Phone" }, { "id": "-30", "name": "CURRENT_ADDRESS", "startLabelName": "Person", "endLabelName": "Location" }, { "id": "-29", "name": "OCCURRED_AT", "startLabelName": "Crime", "endLabelName": "Location" }, { "id": "-39", "name": "KNOWS_LW", "startLabelName": "Person", "endLabelName": "Person" }, { "id": "-41", "name": "PARTY_TO", "startLabelName": "Person", "endLabelName": "Crime" }, { "id": "-36", "name": "HAS_PHONE", "startLabelName": "Person", "endLabelName": "Phone" } ] } }

WebGL 模型 视图 投影

WebGL 代码片段 CSS: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 .group{ position:absolute; } .group label{ color:white; } .group canvas{ position:absolute; } .group .slidecontainer{ position:absolute; } HTML: 1 2 3 4 5 6 7 8 9 10 11 12 13 <script> var MDN =window.parent.MDN </script> <div class="group"> <canvas id="canvas"></canvas> <div class="slidecontainer"> <label for="slider">W</label> <input id="slider" type="range" step="0.1" min="0.5" max="10"

hugo中使用react

在文章中嵌入下面下代码 1 2 3 < raw-html > <div id="root"></div> </ raw-html > 新建react代码 在static/js/posts/目目录下创建以文章title为名的文件

Cloudfare Nginx V2ray 配置

时间校准 1 2 3 4 sudo timedatectl set-ntp true # 启用 NTP 服务 sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime # 将时区设为“亚洲/上海” sudo hwclock --systohc # 将硬件时钟调整到与当前系统时间一致 date -R # 以 RFC 5322 格式输出日期和