index.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <!doctype html>
  2. <head>
  3. <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
  4. <meta content="utf-8" http-equiv="encoding">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta name="mobile-web-app-capable" content="yes">
  7. <link rel="icon" sizes="128x128" href="icon.png">
  8. <link rel="apple-touch-icon" sizes="128x128" href="icon.png">
  9. <meta name="theme-color" content="#216e51">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="#216e51">
  11. <!-- <meta name="theme-color" content="#f7d723">
  12. <meta name="apple-mobile-web-app-status-bar-style" content="#f7d723"> -->
  13. <style>
  14. * {
  15. margin: 0;
  16. padding: 0;
  17. }
  18. #splash {
  19. background-color: #216e51;
  20. color: rgb(207, 207, 207);
  21. padding: 10%;
  22. margin: 0%;
  23. font-size: 4em;
  24. font-weight: bolder;
  25. padding-bottom: 200%;
  26. height: 100%;
  27. font-family: Arial, Helvetica, sans-serif;
  28. }
  29. </style>
  30. </head>
  31. <body>
  32. <div id="splash">
  33. loading
  34. </div>
  35. <div id="app" style="display: none">
  36. <nav>
  37. <div class="logo">{{title}}</div>
  38. <div id="nav-icon">☰</div>
  39. <input id="nav-toggle" type="checkbox">
  40. <div id="nav-items">
  41. <button v-if="account" @click="search_visible = !search_visible">Sucheinstellungen</button>
  42. <button v-if="account" @click="window.location.hash = ''; window.location.reload()">Logout</button>
  43. </div>
  44. </nav>
  45. <div class="content">
  46. <div v-for="auction in ordered_auctions()"
  47. v-if="auction.price != null && !auction.is_price_final && !search_visible">
  48. <div class="auction">
  49. <div class="thumb">
  50. <div class="blurredthumb" v-bind:style="{ 'background-image': 'url(' + auction.thumb+ ')' }"></div>
  51. <img class="thumbimg" :src="auction.thumb">
  52. </div>
  53. <div style="overflow: hidden">
  54. <a :href="auction.url" target="_">{{auction.desc}}</a>
  55. <div class="currency">€ {{auction.price}}</div>
  56. <div>{{ts_to_remaining(auction.timestamp)}}</div>
  57. <a v-bind:href="auction.gcal">Kalendereintrag</a>
  58. <div v-if="auction.avg_price > auction.price">
  59. Preistipp
  60. </div>
  61. </div>
  62. </div>
  63. <hr>
  64. </div>
  65. <div v-if="account" class="panel">
  66. <h3>Deine Suchen:</h3>
  67. <div v-for="(query, url) in queries">
  68. Suche <i>"{{display_query(url)}}"</i>: {{Math.round(query.avg_price)}} EUR im Schnitt
  69. </div>
  70. <button @click="search_visible = !search_visible">Sucheinstellungen</button>
  71. <h3>Abgelaufene Suchen:</h3>
  72. </div>
  73. <div v-for="auction in ordered_auctions()"
  74. v-if="auction.price != null && auction.is_price_final && !search_visible">
  75. <div class="auction">
  76. <div class="thumb">
  77. <div class="blurredthumb" v-bind:style="{ 'background-image': 'url(' + auction.thumb+ ')' }"></div>
  78. <img class="thumbimg" :src="auction.thumb">
  79. </div>
  80. <div style="overflow: hidden">
  81. <a :href="auction.url" target="_">{{auction.desc}}</a>
  82. <div class="currency">€ {{auction.price}}</div>
  83. </div>
  84. </div>
  85. <hr>
  86. </div>
  87. <template>
  88. <div class="panel" v-if="!account">
  89. {{account}}
  90. Hi! Du hast noch keinen Account oder es ist keiner geladen. Macht aber nichts, gib einfach Deinen ein oder
  91. denke Dir einen aus.
  92. <input autocapitalize="none" v-model="new_account" v-on:keyup.enter="window.location.hash = new_account;">
  93. <button @click="window.location.hash = new_account">OK</button>
  94. <div>
  95. Tip: der Accountname sollte einem Passwort aehnlich sein wenn Du nicht willst dass jemand anderes Deine
  96. Suchen sieht.
  97. </div>
  98. </div>
  99. </template>
  100. <div class="panel" v-if="search_visible">
  101. <div align="right">
  102. <button @click="search_visible = !search_visible">X</button>
  103. </div>
  104. <h1>Neue Suche</h1>
  105. Suchen sind das Herzstueck dieser Anwendung. Suchen laufen immer, auch wenn Du nicht online bist. Erstelle eine
  106. Suche die moeglichst nur das liefert was Dich interessiert. Das Ausschliessen von Sofortkauf-Artikeln, ein
  107. Mindestpreis sowie nur Artikel die eine WBK erfordern kann sinnvoll sein. Vergiss nicht am Ende alle zu
  108. speichern!
  109. <br>
  110. <br>
  111. <form>
  112. <div class="form-group">
  113. <label>Suchbegriff(e), durch Leerzeichen getrennt</label>
  114. <input autocapitalize="none" v-model="query.search">
  115. </div>
  116. <div class="form-group">
  117. <label>Maximalpreis</label>
  118. <input type="number" v-model="query.maxprice">
  119. </div>
  120. <div class="form-group">
  121. <label>Mindestpreis</label>
  122. <input type="number" v-model="query.minprice">
  123. </div>
  124. <div class="form-group">
  125. <input type="checkbox" v-model="query.restricted">
  126. <label>WBK noetig?</label>
  127. </div>
  128. <label>Auktionstyp</label>
  129. <div class="form-group">
  130. <select v-model="query.type">
  131. <option v-bind:value="1">Nur Auktionen</option>
  132. <option v-bind:value="2">Nur Sofortkauf</option>
  133. <option v-bind:value="3">Alles</option>
  134. </select>
  135. </div>
  136. <div class="form-group">
  137. <label>Such-URL (Kann man alternativ von eGun-Suche kopieren)</label>
  138. <input autocapitalize="none" v-model="query_url">
  139. </div>
  140. </form>
  141. <div>
  142. <a v-if="query_url" v-bind:href="query_url" target="_">Suche testen</a>
  143. </div>
  144. <div align="right">
  145. <button @click="add_query()">Suche hinzufuegen</button>
  146. </div>
  147. Bestehende Suchen:
  148. <div v-for="(query, url) in queries" style="font-size: 0.8em">
  149. <button @click="delete_query(url)">X</button> <i>
  150. "{{display_query(url)}}"
  151. </i>
  152. </div>
  153. <div align="right">
  154. <button @click="save_account()">Alle Suchen permanent speichern</button>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. </body>
  160. <!-- <link rel="stylesheet" href="https://rawgit.com/woelper/lilac/master/lilac.css"> -->
  161. <link rel="stylesheet" href="https://rawgit.com/woelper/lilac/master/lilac.min.css">
  162. <!-- Moment.js library -->
  163. <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment-with-locales.min.js"></script>
  164. <!-- moment-duration-format plugin -->
  165. <script
  166. src="https://cdnjs.cloudflare.com/ajax/libs/moment-duration-format/1.3.0/moment-duration-format.min.js"></script>
  167. <script defer src="https://cdn.jsdelivr.net/npm/vue@2.5.13/dist/vue.min.js"></script>
  168. <script defer src="app.js"></script>
  169. <style>
  170. :root {
  171. --main-color: rgb(33, 110, 81);
  172. }
  173. .nav-items {
  174. margin-left: auto;
  175. margin-right: 0;
  176. }
  177. .auction {
  178. margin: 10px;
  179. overflow: hidden;
  180. }
  181. .auction a {
  182. text-decoration: none;
  183. color: rgb(27, 162, 216);
  184. }
  185. .currency {
  186. font-weight: bold
  187. }
  188. .blurredthumb {
  189. filter: blur(8px);
  190. width: 100%;
  191. height: 100%;
  192. background-size: 100% 100%;
  193. }
  194. .thumb {
  195. width: 100px;
  196. height: 100px;
  197. float: left;
  198. margin-right: 30px;
  199. position: relative;
  200. background-color: #ccc;
  201. overflow: hidden;
  202. }
  203. .thumbimg {
  204. position: absolute;
  205. top: 0;
  206. bottom: 0;
  207. margin: auto;
  208. }
  209. #nav-icon {
  210. text-align: center;
  211. box-sizing: content-box;
  212. }
  213. @media screen and (max-width:600px) {
  214. #nav-items {
  215. width: 50%;
  216. box-shadow: 0px 8px 8px rgba(0, 0, 0, 0.404);
  217. }
  218. }
  219. hr {
  220. display: block;
  221. height: 1px;
  222. border: 0;
  223. border-top: 1px solid #ccc;
  224. margin: 1em 0;
  225. margin-left: 10px;
  226. margin-right: 10px;
  227. padding: 0;
  228. }
  229. </style>