HomePage.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. <!doctype html>
  2. <html class="no-js" lang="">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="x-ua-compatible" content="ie=edge">
  6. <title>time1 documentation</title>
  7. <meta name="description" content="">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
  10. <link rel="stylesheet" href="../styles/style.css">
  11. <link rel="stylesheet" href="../styles/dark.css">
  12. </head>
  13. <body>
  14. <script>
  15. // Blocking script to avoid flickering dark mode
  16. // Dark mode toggle button
  17. var useDark = window.matchMedia('(prefers-color-scheme: dark)');
  18. var darkModeState = useDark.matches;
  19. var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
  20. var $darkModeToggles = document.querySelectorAll('.dark-mode-switch');
  21. var darkModeStateLocal = localStorage.getItem('compodoc_darkmode-state');
  22. function checkToggle(check) {
  23. for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
  24. $darkModeToggleSwitchers[i].checked = check;
  25. }
  26. }
  27. function toggleDarkMode(state) {
  28. if (window.localStorage) {
  29. localStorage.setItem('compodoc_darkmode-state', state);
  30. }
  31. checkToggle(state);
  32. const hasClass = document.body.classList.contains('dark');
  33. if (state) {
  34. for (var i = 0; i < $darkModeToggles.length; i++) {
  35. $darkModeToggles[i].classList.add('dark');
  36. }
  37. if (!hasClass) {
  38. document.body.classList.add('dark');
  39. }
  40. } else {
  41. for (var i = 0; i < $darkModeToggles.length; i++) {
  42. $darkModeToggles[i].classList.remove('dark');
  43. }
  44. if (hasClass) {
  45. document.body.classList.remove('dark');
  46. }
  47. }
  48. }
  49. useDark.addEventListener('change', function (evt) {
  50. toggleDarkMode(evt.matches);
  51. });
  52. if (darkModeStateLocal) {
  53. darkModeState = darkModeStateLocal === 'true';
  54. }
  55. toggleDarkMode(darkModeState);
  56. </script>
  57. <div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
  58. <div class="d-flex">
  59. <a href="../" class="navbar-brand">time1 documentation</a>
  60. <button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
  61. </div>
  62. </div>
  63. <div class="xs-menu menu" id="mobile-menu">
  64. <div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
  65. </div>
  66. <div class="container-fluid main">
  67. <div class="row main">
  68. <div class="d-none d-md-block menu">
  69. <compodoc-menu mode="normal"></compodoc-menu>
  70. </div>
  71. <!-- START CONTENT -->
  72. <div class="content component">
  73. <div class="content-data">
  74. <ol class="breadcrumb">
  75. <li class="breadcrumb-item">Components</li>
  76. <li class="breadcrumb-item"
  77. >
  78. HomePage</li>
  79. </ol>
  80. <ul class="nav nav-tabs" role="tablist">
  81. <li class="nav-item">
  82. <a href="#info" class="nav-link active"
  83. role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a>
  84. </li>
  85. <li class="nav-item">
  86. <a href="#source" class="nav-link"
  87. role="tab" id="source-tab" data-bs-toggle="tab" data-link="source">Source</a>
  88. </li>
  89. <li class="nav-item">
  90. <a href="#templateData" class="nav-link"
  91. role="tab" id="templateData-tab" data-bs-toggle="tab" data-link="template">Template</a>
  92. </li>
  93. <li class="nav-item">
  94. <a href="#styleData" class="nav-link"
  95. role="tab" id="styleData-tab" data-bs-toggle="tab" data-link="style">Styles</a>
  96. </li>
  97. <li class="nav-item">
  98. <a href="#tree" class="nav-link"
  99. role="tab" id="tree-tab" data-bs-toggle="tab" data-link="dom-tree">DOM Tree</a>
  100. </li>
  101. </ul>
  102. <div class="tab-content">
  103. <div class="tab-pane fade active in" id="info"><p class="comment">
  104. <h3>File</h3>
  105. </p>
  106. <p class="comment">
  107. <code>src/app/home/home.page.ts</code>
  108. </p>
  109. <section data-compodoc="block-metadata">
  110. <h3>Metadata</h3>
  111. <table class="table table-sm table-hover metadata">
  112. <tbody>
  113. <tr>
  114. <td class="col-md-3">selector</td>
  115. <td class="col-md-9"><code>app-home</code></td>
  116. </tr>
  117. <tr>
  118. <td class="col-md-3">styleUrls</td>
  119. <td class="col-md-9"><code>home.page.scss</code></td>
  120. </tr>
  121. <tr>
  122. <td class="col-md-3">templateUrl</td>
  123. <td class="col-md-9"><code>home.page.html</code></td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. </section>
  128. <section data-compodoc="block-index">
  129. <h3 id="index">Index</h3>
  130. <table class="table table-sm table-bordered index-table">
  131. <tbody>
  132. <tr>
  133. <td class="col-md-4">
  134. <h6><b>Properties</b></h6>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td class="col-md-4">
  139. <ul class="index-list">
  140. <li>
  141. <a href="#tasks" >tasks</a>
  142. </li>
  143. </ul>
  144. </td>
  145. </tr>
  146. <tr>
  147. <td class="col-md-4">
  148. <h6><b>Methods</b></h6>
  149. </td>
  150. </tr>
  151. <tr>
  152. <td class="col-md-4">
  153. <ul class="index-list">
  154. <li>
  155. <a href="#onCheckinClick" >onCheckinClick</a>
  156. </li>
  157. <li>
  158. <a href="#onUnfinishedClick" >onUnfinishedClick</a>
  159. </li>
  160. </ul>
  161. </td>
  162. </tr>
  163. </tbody>
  164. </table>
  165. </section>
  166. <section data-compodoc="block-constructor">
  167. <h3 id="constructor">Constructor</h3>
  168. <table class="table table-sm table-bordered">
  169. <tbody>
  170. <tr>
  171. <td class="col-md-4">
  172. <code>constructor()</code>
  173. </td>
  174. </tr>
  175. <tr>
  176. <td class="col-md-4">
  177. <div class="io-line">Defined in <a href="" data-line="13" class="link-to-prism">src/app/home/home.page.ts:13</a></div>
  178. </td>
  179. </tr>
  180. </tbody>
  181. </table>
  182. </section>
  183. <section data-compodoc="block-methods">
  184. <h3 id="methods">
  185. Methods
  186. </h3>
  187. <table class="table table-sm table-bordered">
  188. <tbody>
  189. <tr>
  190. <td class="col-md-4">
  191. <a name="onCheckinClick"></a>
  192. <span class="name">
  193. <span ><b>onCheckinClick</b></span>
  194. <a href="#onCheckinClick"><span class="icon ion-ios-link"></span></a>
  195. </span>
  196. </td>
  197. </tr>
  198. <tr>
  199. <td class="col-md-4">
  200. <code>onCheckinClick()</code>
  201. </td>
  202. </tr>
  203. <tr>
  204. <td class="col-md-4">
  205. <div class="io-line">Defined in <a href="" data-line="21"
  206. class="link-to-prism">src/app/home/home.page.ts:21</a></div>
  207. </td>
  208. </tr>
  209. <tr>
  210. <td class="col-md-4">
  211. <div class="io-description">
  212. <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
  213. </div>
  214. </td>
  215. </tr>
  216. </tbody>
  217. </table>
  218. <table class="table table-sm table-bordered">
  219. <tbody>
  220. <tr>
  221. <td class="col-md-4">
  222. <a name="onUnfinishedClick"></a>
  223. <span class="name">
  224. <span ><b>onUnfinishedClick</b></span>
  225. <a href="#onUnfinishedClick"><span class="icon ion-ios-link"></span></a>
  226. </span>
  227. </td>
  228. </tr>
  229. <tr>
  230. <td class="col-md-4">
  231. <code>onUnfinishedClick()</code>
  232. </td>
  233. </tr>
  234. <tr>
  235. <td class="col-md-4">
  236. <div class="io-line">Defined in <a href="" data-line="17"
  237. class="link-to-prism">src/app/home/home.page.ts:17</a></div>
  238. </td>
  239. </tr>
  240. <tr>
  241. <td class="col-md-4">
  242. <div class="io-description">
  243. <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
  244. </div>
  245. </td>
  246. </tr>
  247. </tbody>
  248. </table>
  249. </section>
  250. <section data-compodoc="block-properties">
  251. <h3 id="inputs">
  252. Properties
  253. </h3>
  254. <table class="table table-sm table-bordered">
  255. <tbody>
  256. <tr>
  257. <td class="col-md-4">
  258. <a name="tasks"></a>
  259. <span class="name">
  260. <span ><b>tasks</b></span>
  261. <a href="#tasks"><span class="icon ion-ios-link"></span></a>
  262. </span>
  263. </td>
  264. </tr>
  265. <tr>
  266. <td class="col-md-4">
  267. <i>Type : </i> <code>[]</code>
  268. </td>
  269. </tr>
  270. <tr>
  271. <td class="col-md-4">
  272. <i>Default value : </i><code>[
  273. { time: &#x27;08:00:00&#x27;, content: &#x27;早间任务&#x27; },
  274. { time: &#x27;12:00:00&#x27;, content: &#x27;中间任务&#x27; },
  275. { time: &#x27;18:00:00&#x27;, content: &#x27;晚间任务&#x27; }
  276. ]</code>
  277. </td>
  278. </tr>
  279. <tr>
  280. <td class="col-md-4">
  281. <div class="io-line">Defined in <a href="" data-line="9" class="link-to-prism">src/app/home/home.page.ts:9</a></div>
  282. </td>
  283. </tr>
  284. </tbody>
  285. </table>
  286. </section>
  287. </div>
  288. <div class="tab-pane fade tab-source-code" id="source">
  289. <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Component } from &#x27;@angular/core&#x27;;
  290. @Component({
  291. selector: &#x27;app-home&#x27;,
  292. templateUrl: &#x27;home.page.html&#x27;,
  293. styleUrls: [&#x27;home.page.scss&#x27;],
  294. })
  295. export class HomePage {
  296. tasks &#x3D; [
  297. { time: &#x27;08:00:00&#x27;, content: &#x27;早间任务&#x27; },
  298. { time: &#x27;12:00:00&#x27;, content: &#x27;中间任务&#x27; },
  299. { time: &#x27;18:00:00&#x27;, content: &#x27;晚间任务&#x27; }
  300. ];
  301. constructor() {}
  302. onUnfinishedClick() {
  303. console.log(&#x27;未完成按钮点击&#x27;);
  304. }
  305. onCheckinClick() {
  306. console.log(&#x27;打卡按钮点击&#x27;);
  307. }
  308. }
  309. </code></pre>
  310. </div>
  311. <div class="tab-pane fade " id="templateData">
  312. <pre class="line-numbers"><code class="language-html">&lt;ion-header&gt;
  313. &lt;/ion-header&gt;
  314. &lt;ion-content&gt;
  315. &lt;div class&#x3D;&quot;top-section&quot;&gt;
  316. &lt;div class&#x3D;&quot;left&quot;&gt;
  317. &lt;div class&#x3D;&quot;task-time&quot;&gt;08:00:00 - 11:30:00&lt;/div&gt;
  318. &lt;div class&#x3D;&quot;task-time&quot;&gt;12:00:00 - 17:30:00&lt;/div&gt;
  319. &lt;div class&#x3D;&quot;task-time&quot;&gt;18:00:00 - 11:30:00&lt;/div&gt;
  320. &lt;/div&gt;
  321. &lt;div class&#x3D;&quot;right&quot;&gt;
  322. &lt;div class&#x3D;&quot;task-content&quot;&gt;早间任务&lt;/div&gt;
  323. &lt;div class&#x3D;&quot;task-content&quot;&gt;中间任务&lt;/div&gt;
  324. &lt;div class&#x3D;&quot;task-content&quot;&gt;晚间任务&lt;/div&gt;
  325. &lt;/div&gt;
  326. &lt;/div&gt;
  327. &lt;div class&#x3D;&quot;bottom-section&quot;&gt;
  328. &lt;ion-button expand&#x3D;&quot;block&quot; shape&#x3D;&quot;round&quot; color&#x3D;&quot;danger&quot; class&#x3D;&quot;unfinished-button&quot;&gt;
  329. 未完成
  330. &lt;/ion-button&gt;
  331. &lt;ion-button expand&#x3D;&quot;block&quot; shape&#x3D;&quot;round&quot; color&#x3D;&quot;success&quot; class&#x3D;&quot;checkin-button&quot;&gt;
  332. 打卡
  333. &lt;/ion-button&gt;
  334. &lt;/div&gt;
  335. &lt;/ion-content&gt;
  336. </code></pre>
  337. </div>
  338. <div class="tab-pane fade " id="styleData">
  339. <p class="comment">
  340. <code>home.page.scss</code>
  341. </p>
  342. <pre class="line-numbers"><code class="language-scss">ion-content {
  343. --padding-top: 0;
  344. --padding-bottom: 0;
  345. --padding-start: 0;
  346. --padding-end: 0;
  347. .top-section {
  348. display: flex;
  349. height: 73vh; // 占据3/4的高度
  350. .left, .right {
  351. display: flex;
  352. flex-direction: column;
  353. justify-content: space-between;
  354. align-items: center;
  355. }
  356. .left {
  357. width: 33.33%; // 左侧宽度1/3
  358. background-color: #f0f0f0;
  359. }
  360. .right {
  361. width: 66.66%; // 右侧宽度2/3
  362. background-color: #e0e0e0;
  363. }
  364. .task-time, .task-content {
  365. display: flex;
  366. justify-content: center;
  367. align-items: center;
  368. height: 33.33%; // 每项高度1/3
  369. font-size: 1.2em;
  370. }
  371. }
  372. .bottom-section {
  373. display: flex;
  374. justify-content: space-around;
  375. align-items: center;
  376. height: 20vh; // 占据1/4的高度
  377. ion-button {
  378. width: 40%; // 按钮宽度40%
  379. height: 40%; // 按钮高度40%
  380. border-radius: 50%;
  381. font-size: 1.2em;
  382. }
  383. }
  384. }
  385. </code></pre>
  386. </div>
  387. <div class="tab-pane fade " id="tree">
  388. <div id="tree-container"></div>
  389. <div class="tree-legend">
  390. <div class="title">
  391. <b>Legend</b>
  392. </div>
  393. <div>
  394. <div class="color htmlelement"></div><span>Html element</span>
  395. </div>
  396. <div>
  397. <div class="color component"></div><span>Component</span>
  398. </div>
  399. <div>
  400. <div class="color directive"></div><span>Html element with directive</span>
  401. </div>
  402. </div>
  403. </div>
  404. </div>
  405. <script src="../js/libs/vis.min.js"></script>
  406. <script src="../js/libs/htmlparser.js"></script>
  407. <script src="../js/libs/deep-iterator.js"></script>
  408. <script>
  409. var COMPONENT_TEMPLATE = '<div><ion-header></ion-header><ion-content> <div class="top-section"> <div class="left"> <div class="task-time">08:00:00 - 11:30:00</div> <div class="task-time">12:00:00 - 17:30:00</div> <div class="task-time">18:00:00 - 11:30:00</div> </div> <div class="right"> <div class="task-content">早间任务</div> <div class="task-content">中间任务</div> <div class="task-content">晚间任务</div> </div> </div> <div class="bottom-section"> <ion-button expand="block" shape="round" color="danger" class="unfinished-button"> 未完成 </ion-button> <ion-button expand="block" shape="round" color="success" class="checkin-button"> 打卡 </ion-button> </div></ion-content></div>'
  410. var COMPONENTS = [{'name': 'AppComponent', 'selector': 'app-root'},{'name': 'ExploreContainerComponent', 'selector': 'app-explore-container'},{'name': 'HomePage', 'selector': 'app-home'},{'name': 'ProfilePage', 'selector': 'app-profile'},{'name': 'ServicesPage', 'selector': 'app-services'},{'name': 'TabsPage', 'selector': 'app-tabs'},{'name': 'TasksPage', 'selector': 'app-tasks'}];
  411. var DIRECTIVES = [];
  412. var ACTUAL_COMPONENT = {'name': 'HomePage'};
  413. </script>
  414. <script src="../js/tree.js"></script>
  415. </div><div class="search-results">
  416. <div class="has-results">
  417. <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
  418. <ul class="search-results-list"></ul>
  419. </div>
  420. <div class="no-results">
  421. <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
  422. </div>
  423. </div>
  424. </div>
  425. <!-- END CONTENT -->
  426. </div>
  427. </div>
  428. <label class="dark-mode-switch">
  429. <input type="checkbox">
  430. <span class="slider">
  431. <svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
  432. <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
  433. </svg>
  434. </span>
  435. </label>
  436. <script>
  437. var COMPODOC_CURRENT_PAGE_DEPTH = 1;
  438. var COMPODOC_CURRENT_PAGE_CONTEXT = 'component';
  439. var COMPODOC_CURRENT_PAGE_URL = 'HomePage.html';
  440. var MAX_SEARCH_RESULTS = 15;
  441. </script>
  442. <script>
  443. $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
  444. checkToggle(darkModeState);
  445. if ($darkModeToggleSwitchers.length > 0) {
  446. for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
  447. $darkModeToggleSwitchers[i].addEventListener('change', function (event) {
  448. darkModeState = !darkModeState;
  449. toggleDarkMode(darkModeState);
  450. });
  451. }
  452. }
  453. </script>
  454. <script src="../js/libs/custom-elements.min.js"></script>
  455. <script src="../js/libs/lit-html.js"></script>
  456. <script src="../js/menu-wc.js" defer></script>
  457. <script nomodule src="../js/menu-wc_es5.js" defer></script>
  458. <script src="../js/libs/bootstrap-native.js"></script>
  459. <script src="../js/libs/es6-shim.min.js"></script>
  460. <script src="../js/libs/EventDispatcher.js"></script>
  461. <script src="../js/libs/promise.min.js"></script>
  462. <script src="../js/libs/zepto.min.js"></script>
  463. <script src="../js/compodoc.js"></script>
  464. <script src="../js/tabs.js"></script>
  465. <script src="../js/menu.js"></script>
  466. <script src="../js/libs/clipboard.min.js"></script>
  467. <script src="../js/libs/prism.js"></script>
  468. <script src="../js/sourceCode.js"></script>
  469. <script src="../js/search/search.js"></script>
  470. <script src="../js/search/lunr.min.js"></script>
  471. <script src="../js/search/search-lunr.js"></script>
  472. <script src="../js/search/search_index.js"></script>
  473. <script src="../js/lazy-load-graphs.js"></script>
  474. </body>
  475. </html>