├── .editorconfig ├── .eslintrc.json ├── .gitignore ├── .nvmrc ├── LICENSE ├── README.md ├── babel.config.js ├── icons ├── bookmark.svg ├── card.svg ├── github.svg ├── google.svg ├── line.svg ├── link.svg ├── moon.svg ├── sun.svg ├── template.js ├── toilet.svg ├── up.svg ├── user.svg └── x.svg ├── netlify.toml ├── package.json ├── public ├── _redirects ├── cover.jpg ├── favicon.ico ├── img │ └── icons │ │ ├── icon-128x128.png │ │ ├── icon-144x144.png │ │ ├── icon-152x152.png │ │ ├── icon-16x16.png │ │ ├── icon-192x192.png │ │ ├── icon-32x32.png │ │ ├── icon-384x384.png │ │ ├── icon-512x512.png │ │ ├── icon-72x72.png │ │ └── icon-96x96.png ├── index.html ├── manifest.json └── robots.txt ├── src ├── App.vue ├── assets │ ├── bookmark_illu.svg │ ├── bookmark_illu_bright.svg │ ├── chrome.svg │ ├── confetti.svg │ ├── firefox.svg │ ├── logo.png │ └── logo.svg ├── common │ ├── analytics.js │ ├── api.js │ ├── config.js │ ├── flip.js │ ├── login.js │ ├── panInteraction.js │ ├── rIC.js │ ├── storage.js │ ├── support.js │ ├── theme.js │ └── touchHandler.js ├── components │ ├── AsyncImg.vue │ ├── DaFooter.vue │ ├── DaIconSelector.vue │ ├── DaInsanePost.vue │ ├── DaPost.vue │ ├── DaSpinner.vue │ ├── DaStores.vue │ ├── DaSwitch.vue │ ├── DaTerminal.vue │ └── DaToiletItem.vue ├── fonts.js ├── main.js ├── registerServiceWorker.js ├── router │ ├── guards │ │ ├── anonymous.js │ │ ├── loadState.js │ │ └── loggedIn.js │ └── index.js ├── store │ ├── README.md │ ├── feed.js │ ├── index.js │ ├── plugins │ │ ├── cache.js │ │ └── sync.js │ ├── ui.js │ └── user.js ├── styles │ ├── card.pcss │ ├── custom.pcss │ ├── global.pcss │ ├── insane.pcss │ ├── layout.pcss │ ├── reset.pcss │ └── typography.pcss └── views │ ├── Home.vue │ ├── Login.vue │ ├── NotFound.vue │ ├── NotSupported.vue │ ├── OAuth.vue │ └── Toilet.vue ├── vue.config.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "node": true 5 | }, 6 | "extends": [ 7 | "plugin:vue/strongly-recommended", 8 | "@vue/airbnb" 9 | ], 10 | "parserOptions": { 11 | "parser": "babel-eslint" 12 | }, 13 | "globals": { 14 | "ga": true 15 | }, 16 | "rules": { 17 | "no-param-reassign": [ 18 | "error", 19 | { 20 | "props": true, 21 | "ignorePropertyModificationsFor": [ 22 | "state" 23 | ] 24 | } 25 | ], 26 | "object-curly-newline": [ 27 | "off" 28 | ] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | src/icons 6 | 7 | # local env files 8 | .env.local 9 | .env.*.local 10 | 11 | # Log files 12 | npm-debug.log* 13 | yarn-debug.log* 14 | yarn-error.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw* 24 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 12.19.0 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # daily-app 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn run build 16 | ``` 17 | 18 | ### Run your tests 19 | ``` 20 | yarn run test 21 | ``` 22 | 23 | ### Lints and fixes files 24 | ``` 25 | yarn run lint 26 | ``` 27 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app', 4 | ], 5 | }; 6 | -------------------------------------------------------------------------------- /icons/bookmark.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /icons/card.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /icons/google.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/line.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/link.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /icons/moon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /icons/sun.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /icons/template.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import icon from 'vue-svgicon'; 3 | 4 | icon.register({ 5 | '${name}': { 6 | width: ${width}, 7 | height: ${height}, 8 | viewBox: ${viewBox}, 9 | data: `${data}`, 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /icons/toilet.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/up.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /icons/user.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /icons/x.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [[redirects]] 2 | from = "/*" 3 | to = "https://app.daily.dev" 4 | status = 301 5 | force = true 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "daily-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build --modern", 8 | "lint": "vue-cli-service lint", 9 | "svg": "vsvg -s ./icons -t ./src/icons" 10 | }, 11 | "dependencies": { 12 | "gsap": "^2.0.2", 13 | "intersection-observer": "^0.5.0", 14 | "localforage": "^1.7.2", 15 | "register-service-worker": "^1.0.0", 16 | "vue": "^2.5.17", 17 | "vue-masonry-css": "^1.0.3", 18 | "vue-router": "^3.0.1", 19 | "vue-svgicon": "^3.2.0", 20 | "vue-visible": "^1.0.2", 21 | "vuex": "^3.0.1" 22 | }, 23 | "devDependencies": { 24 | "@vue/cli-plugin-babel": "^3.0.4", 25 | "@vue/cli-plugin-eslint": "^3.0.4", 26 | "@vue/cli-plugin-pwa": "^3.0.4", 27 | "@vue/cli-service": "^3.0.4", 28 | "@vue/eslint-config-airbnb": "^3.0.4", 29 | "postcss-custom-media": "^7.0.4", 30 | "postcss-extend": "^1.0.5", 31 | "postcss-nesting": "^7.0.0", 32 | "vue-template-compiler": "^2.5.17" 33 | }, 34 | "postcss": { 35 | "plugins": { 36 | "autoprefixer": {}, 37 | "postcss-extend": {}, 38 | "postcss-nesting": {}, 39 | "postcss-custom-media": {} 40 | } 41 | }, 42 | "browserslist": [ 43 | "> 1%", 44 | "last 2 versions", 45 | "not ie <= 8" 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /public/_redirects: -------------------------------------------------------------------------------- 1 | /api/* https://api.daily.dev/:splat 200 2 | /* https://app.daily.dev 301! 3 | https://go.dailynow.co/* https://go.daily.dev/:splat 301! 4 | /* /index.html 200 5 | -------------------------------------------------------------------------------- /public/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/cover.jpg -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/favicon.ico -------------------------------------------------------------------------------- /public/img/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/img/icons/icon-128x128.png -------------------------------------------------------------------------------- /public/img/icons/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/img/icons/icon-144x144.png -------------------------------------------------------------------------------- /public/img/icons/icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/img/icons/icon-152x152.png -------------------------------------------------------------------------------- /public/img/icons/icon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/img/icons/icon-16x16.png -------------------------------------------------------------------------------- /public/img/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/img/icons/icon-192x192.png -------------------------------------------------------------------------------- /public/img/icons/icon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/img/icons/icon-32x32.png -------------------------------------------------------------------------------- /public/img/icons/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/img/icons/icon-384x384.png -------------------------------------------------------------------------------- /public/img/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/img/icons/icon-512x512.png -------------------------------------------------------------------------------- /public/img/icons/icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/img/icons/icon-72x72.png -------------------------------------------------------------------------------- /public/img/icons/icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/public/img/icons/icon-96x96.png -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Daily Go - Source for Busy Developers 9 | 11 | 12 | 14 | 15 | 16 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 |
32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Daily Go", 3 | "short_name": "Daily Go", 4 | "description": "Daily Go is a developer productivity tool that curates the latest dev & coding news and delivers it to you.", 5 | "icons": [ 6 | { 7 | "src": "/img/icons/icon-192x192.png", 8 | "sizes": "192x192", 9 | "type": "image/png" 10 | }, 11 | { 12 | "src": "/img/icons/icon-512x512.png", 13 | "sizes": "512x512", 14 | "type": "image/png" 15 | } 16 | ], 17 | "start_url": "/?pwa=true", 18 | "display": "standalone", 19 | "background_color": "#4D96F1", 20 | "theme_color": "#393C3E" 21 | } 22 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /src/assets/bookmark_illu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/bookmark_illu_bright.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/assets/chrome.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/confetti.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/firefox.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dailydotdev/daily-go/8a10c0b457432f1961c3d8a36ca6f2ce1ae9822a/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/common/analytics.js: -------------------------------------------------------------------------------- 1 | import '../common/rIC'; 2 | import { fetchUser } from './api'; 3 | 4 | /* eslint-disable */ 5 | (function (i, s, o, g, r, a, m) { 6 | i['GoogleAnalyticsObject'] = r; 7 | i[r] = i[r] || function () { 8 | (i[r].q = i[r].q || []).push(arguments); 9 | }, i[r].l = 1 * new Date(); 10 | 11 | requestIdleCallback(() => { 12 | a = s.createElement(o), 13 | m = s.getElementsByTagName(o)[0]; 14 | a.async = 1; 15 | a.src = g; 16 | m.parentNode.insertBefore(a, m); 17 | }); 18 | })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); 19 | /* eslint-enable */ 20 | 21 | ga('create', process.env.VUE_APP_GA, 'auto'); 22 | 23 | const isPwa = window.location.search.indexOf('pwa=true') > -1; 24 | 25 | export const trackPage = (page) => { 26 | const suffix = isPwa ? '?pwa=true' : ''; 27 | ga('set', 'page', `/go/${page}${suffix}`); 28 | ga('send', 'pageview'); 29 | }; 30 | 31 | export const updateId = (id) => { 32 | ga('set', 'userId', id); 33 | }; 34 | 35 | export const init = (userId) => { 36 | const promise = userId ? Promise.resolve(userId) : fetchUser().then(user => user.id); 37 | promise.then(updateId); 38 | }; 39 | -------------------------------------------------------------------------------- /src/common/api.js: -------------------------------------------------------------------------------- 1 | import { apiUrl, pageSize, redirectUrl } from './config'; 2 | 3 | const redirectLink = post => 4 | `${redirectUrl}/r/${post.id}`; 5 | 6 | const ratioToSize = (ratio) => { 7 | if (ratio > 1.5) { 8 | return 'small'; 9 | } 10 | 11 | if (ratio <= 0.75) { 12 | return 'large'; 13 | } 14 | 15 | return 'medium'; 16 | }; 17 | 18 | const mapPost = post => 19 | Object.assign({}, post, { 20 | createdAt: new Date(post.createdAt), 21 | publishedAt: post.publishedAt ? new Date(post.publishedAt) : null, 22 | url: redirectLink(post), 23 | size: ratioToSize(post.ratio), 24 | }); 25 | 26 | export const fetchPublications = () => 27 | fetch(`${apiUrl}/v1/publications`, { credentials: 'include' }) 28 | .then(response => response.json()); 29 | 30 | export const fetchBookmarks = (latest, page) => 31 | fetch( 32 | `${apiUrl}/v1/posts/bookmarks?latest=${latest.toISOString()}&page=${page}&pageSize=${pageSize}`, 33 | { 34 | credentials: 'include', 35 | }, 36 | ) 37 | .then(response => response.json()) 38 | .then(posts => posts.map(mapPost)); 39 | 40 | export const fetchToilet = (latest, page) => 41 | fetch( 42 | `${apiUrl}/v1/posts/toilet?latest=${latest.toISOString()}&page=${page}`, 43 | { 44 | credentials: 'include', 45 | }, 46 | ) 47 | .then(response => response.json()) 48 | .then(posts => posts.map(mapPost)); 49 | 50 | export const fetchSettings = () => 51 | fetch(`${apiUrl}/v1/settings`, { 52 | credentials: 'include', 53 | }) 54 | .then(response => response.json()); 55 | 56 | export const updateSettings = settings => 57 | fetch(`${apiUrl}/v1/settings`, { 58 | method: 'POST', 59 | headers: { 60 | 'content-type': 'application/json', 61 | }, 62 | body: JSON.stringify(settings), 63 | credentials: 'include', 64 | }); 65 | 66 | export const addBookmarks = bookmarks => 67 | fetch(`${apiUrl}/v1/posts/bookmarks`, { 68 | method: 'POST', 69 | headers: { 70 | 'content-type': 'application/json', 71 | }, 72 | body: JSON.stringify(bookmarks), 73 | credentials: 'include', 74 | }); 75 | 76 | export const removeBookmark = postId => 77 | fetch(`${apiUrl}/v1/posts/${postId}/bookmark`, { 78 | method: 'DELETE', 79 | credentials: 'include', 80 | }); 81 | 82 | export const fetchUser = () => 83 | fetch(`${apiUrl}/v1/users/me`, { credentials: 'include' }) 84 | .then(response => response.json()); 85 | 86 | export const logout = () => 87 | fetch(`${apiUrl}/v1/users/logout`, { 88 | method: 'POST', 89 | credentials: 'include', 90 | }); 91 | -------------------------------------------------------------------------------- /src/common/config.js: -------------------------------------------------------------------------------- 1 | export const pageSize = 30; 2 | export const apiUrl = '/api'; 3 | export const redirectUrl = process.env.VUE_APP_REDIRECT_URL; 4 | export const debug = process.env.NODE_ENV !== 'production'; 5 | -------------------------------------------------------------------------------- /src/common/flip.js: -------------------------------------------------------------------------------- 1 | const capture = ref => ({ 2 | layout: ref.getBoundingClientRect(), 3 | opacity: getComputedStyle(ref).opacity, 4 | }); 5 | 6 | const calcTransition = (first, last) => ({ 7 | x: first.layout.left - last.layout.left, 8 | y: first.layout.top - last.layout.top, 9 | sx: first.layout.width / last.layout.width, 10 | sy: first.layout.height / last.layout.height, 11 | a: last.opacity - first.opacity, 12 | }); 13 | 14 | const getTransform = (trans, xAxis, yAxis, scale) => 15 | `translate(${xAxis ? trans.x : 0}px, ${yAxis ? trans.y : 0}px) 16 | scale(${scale ? trans.sx : 1}, ${scale ? trans.sy : 1})`; 17 | 18 | /* eslint-disable no-underscore-dangle */ 19 | export class FLIP { 20 | constructor(element, xAxis = true, yAxis = true, opacity = true, scale = true) { 21 | this.element = element; 22 | this.xAxis = xAxis; 23 | this.yAxis = yAxis; 24 | this.opacity = opacity; 25 | this.scale = scale; 26 | } 27 | 28 | first(ref = this.element) { 29 | this._first = capture(ref); 30 | } 31 | 32 | last(ref = this.element) { 33 | this._last = capture(ref); 34 | } 35 | 36 | invert() { 37 | const willChange = []; 38 | 39 | if (!this._first) { 40 | throw new Error('You must call saveFirst() before invert()'); 41 | } 42 | 43 | if (!this._last) { 44 | throw new Error('You must call saveLast() before invert()'); 45 | } 46 | 47 | const invert = calcTransition(this._first, this._last); 48 | 49 | // Apply the transform. 50 | if (this.xAxis || this.yAxis || this.scale) { 51 | this.element.style.transformOrigin = '0 0'; 52 | this.element.style.transform = getTransform(invert, this.xAxis, this.yAxis, this.scale); 53 | willChange.push('transform'); 54 | } 55 | 56 | if (this.opacity) { 57 | this.element.style.opacity = this._first.opacity; 58 | willChange.push('opacity'); 59 | } 60 | 61 | this.element.style.willChange = willChange.join(','); 62 | } 63 | 64 | play() { 65 | if (this.xAxis || this.yAxis || this.scale) { 66 | this.element.style.transform = ''; 67 | } 68 | 69 | if (this.opacity) { 70 | this.element.style.opacity = ''; 71 | } 72 | 73 | return new Promise((resolve) => { 74 | const callback = (event) => { 75 | if (event.target === this.element) { 76 | this.element.removeEventListener('transitionend', callback); 77 | resolve(); 78 | } 79 | }; 80 | this.element.addEventListener('transitionend', callback); 81 | }); 82 | } 83 | } 84 | 85 | export class FLP { 86 | constructor(element, xAxis = true, yAxis = true, opacity = true, scale = true) { 87 | this.element = element; 88 | this.xAxis = xAxis; 89 | this.yAxis = yAxis; 90 | this.opacity = opacity; 91 | this.scale = scale; 92 | } 93 | 94 | first() { 95 | this._first = capture(this.element); 96 | } 97 | 98 | last(ref) { 99 | this._last = capture(ref); 100 | } 101 | 102 | play() { 103 | if (!this._first) { 104 | throw new Error('You must call saveFirst() before invert()'); 105 | } 106 | 107 | if (!this._last) { 108 | throw new Error('You must call saveLast() before invert()'); 109 | } 110 | 111 | const trans = calcTransition(this._last, this._first); 112 | 113 | // Apply the transform. 114 | if (this.xAxis || this.yAxis || this.scale) { 115 | this.element.style.transformOrigin = '0 0'; 116 | this.element.style.transform = getTransform(trans, this.xAxis, this.yAxis, this.scale); 117 | } 118 | 119 | if (this.opacity) { 120 | this.element.style.opacity = this._last.opacity; 121 | } 122 | 123 | return new Promise((resolve) => { 124 | const callback = (event) => { 125 | if (event.target === this.element) { 126 | this.element.removeEventListener('transitionend', callback); 127 | resolve(); 128 | } 129 | }; 130 | this.element.addEventListener('transitionend', callback); 131 | }); 132 | } 133 | } 134 | 135 | /* eslint-enable no-underscore-dangle */ 136 | -------------------------------------------------------------------------------- /src/common/login.js: -------------------------------------------------------------------------------- 1 | import { apiUrl } from './config'; 2 | 3 | export const getLoginLink = (provider, redirectTo) => 4 | `${apiUrl}/v1/auth/authorize?provider=${provider}&redirect_uri=${encodeURI(window.location.origin + redirectTo)}&skip_authenticate=true`; 5 | 6 | export const exchangeCode = (provider, query) => 7 | fetch(`${apiUrl}/v1/auth/${provider}/authenticate`, { 8 | method: 'POST', 9 | headers: { 'content-type': 'application/json' }, 10 | body: JSON.stringify(query), 11 | credentials: 'include', 12 | }).then((res) => { 13 | if (res.status !== 200) { 14 | throw new Error('Login failed'); 15 | } 16 | return res.json(); 17 | }); 18 | -------------------------------------------------------------------------------- /src/common/panInteraction.js: -------------------------------------------------------------------------------- 1 | import TouchHandler from './touchHandler'; 2 | 3 | const calcAxisDelta = (e) => { 4 | if (e.dir === TouchHandler.RIGHT) { 5 | return e.point.x - e.startPoint.x; 6 | } else if (e.dir === TouchHandler.LEFT) { 7 | return e.startPoint.x - e.point.x; 8 | } else if (e.dir === TouchHandler.UP) { 9 | return e.startPoint.y - e.point.y; 10 | } 11 | return e.point.y - e.startPoint.y; 12 | }; 13 | 14 | const calcProgress = (value, max) => Math.min(1, Math.max(0, value / max)); 15 | 16 | export default class PanInteraction { 17 | constructor(interactions, globalClear) { 18 | this.interactions = interactions; 19 | this.globalClear = globalClear; 20 | } 21 | 22 | startPan(e) { 23 | const interaction = this.interactions[e.dir]; 24 | if (interaction && (!interaction.canInteract || interaction.canInteract())) { 25 | this.active = interaction; 26 | this.tween = interaction.tween(); 27 | this.tween.pause(); 28 | return true; 29 | } 30 | return false; 31 | } 32 | 33 | pan(e) { 34 | if (this.active) { 35 | const dist = calcAxisDelta(e); 36 | const max = this.active.max(); 37 | const progress = calcProgress(dist, max); 38 | 39 | this.tween.progress(progress); 40 | 41 | if (progress > this.active.threshold && !this.passedThresh) { 42 | this.passedThresh = true; 43 | if (this.active.onThresholdPassed) { 44 | this.active.onThresholdPassed(); 45 | } 46 | } else if (progress <= this.active.threshold && this.passedThresh) { 47 | this.passedThresh = false; 48 | } 49 | } 50 | } 51 | 52 | resetPan() { 53 | if (this.active) { 54 | if (this.active.clear) { 55 | this.active.clear(); 56 | } 57 | 58 | this.active = null; 59 | this.passedThresh = false; 60 | 61 | this.tween.progress(0); 62 | this.tween.kill(); 63 | this.tween = null; 64 | } 65 | 66 | if (this.globalClear) { 67 | this.globalClear(); 68 | } 69 | } 70 | 71 | end() { 72 | if (this.active && !this.playing) { 73 | if (this.passedThresh) { 74 | if (this.active.execPreAnimation) { 75 | this.active.execPreAnimation(); 76 | } 77 | this.tween.play().eventCallback('onComplete', () => this.tweenComplete()); 78 | } else { 79 | this.tween.reverse().eventCallback('onReverseComplete', () => { 80 | this.resetPan(); 81 | }); 82 | } 83 | } 84 | } 85 | 86 | play(dir) { 87 | if (!this.playing && this.startPan({ dir })) { 88 | this.playing = true; 89 | this.tween 90 | .play() 91 | .eventCallback('onComplete', () => this.tweenComplete()); 92 | } 93 | } 94 | 95 | tweenComplete() { 96 | this.playing = false; 97 | let async = false; 98 | if (this.active.execPostAnimation) { 99 | async = this.active.execPostAnimation(); 100 | } 101 | if (async) { 102 | setTimeout(() => this.resetPan()); 103 | } else { 104 | this.resetPan(); 105 | } 106 | } 107 | 108 | swipe() { 109 | if (this.active) { 110 | this.passedThresh = true; 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /src/common/rIC.js: -------------------------------------------------------------------------------- 1 | window.requestIdleCallback = window.requestIdleCallback || 2 | function requestIdleCallback(cb) { 3 | return setTimeout(() => { 4 | const start = Date.now(); 5 | cb({ 6 | didTimeout: false, 7 | timeRemaining: () => Math.max(0, 50 - (Date.now() - start)), 8 | }); 9 | }, 1); 10 | }; 11 | 12 | window.cancelIdleCallback = window.cancelIdleCallback || 13 | function cancelIdleCallback(id) { 14 | clearTimeout(id); 15 | }; 16 | -------------------------------------------------------------------------------- /src/common/storage.js: -------------------------------------------------------------------------------- 1 | import localForage from 'localforage'; 2 | import { pageSize } from './config'; 3 | 4 | const store = localForage.createInstance({ 5 | name: 'daily', 6 | }); 7 | 8 | const truncToOnePage = posts => (posts ? posts.slice(0, pageSize) : posts); 9 | 10 | export const cacheState = (state) => { 11 | const keys = ['user', 'feed', 'ui']; 12 | const opt = { 13 | user: { 14 | filter: [], 15 | transform: {}, 16 | }, 17 | feed: { 18 | filter: ['page', 'latest', 'loading'], 19 | transform: { bookmarks: truncToOnePage }, 20 | }, 21 | ui: { 22 | filter: [], 23 | transform: {}, 24 | }, 25 | }; 26 | const cachedState = Object.keys(state) 27 | .filter(key => keys.indexOf(key) > -1) 28 | .reduce((res, cur) => { 29 | const toCache = Object.keys(state[cur]) 30 | .filter(key => opt[cur].filter.indexOf(key) === -1) 31 | .reduce((cache, subKey) => { 32 | const value = opt[cur].transform[subKey] ? 33 | opt[cur].transform[subKey](state[cur][subKey]) : state[cur][subKey]; 34 | return Object.assign({}, cache, { [subKey]: value }); 35 | }, {}); 36 | return Object.assign({}, res, { [cur]: toCache }); 37 | }, {}); 38 | return store.setItem('state', cachedState); 39 | }; 40 | 41 | export const getState = () => store.getItem('state'); 42 | 43 | export const deleteState = () => store.removeItem('state'); 44 | -------------------------------------------------------------------------------- /src/common/support.js: -------------------------------------------------------------------------------- 1 | export default function () { 2 | return window.CSS && window.CSS.supports && window.CSS.supports('color', 'var(--primary)'); 3 | } 4 | -------------------------------------------------------------------------------- /src/common/theme.js: -------------------------------------------------------------------------------- 1 | export const themes = ['darcula', 'bright']; 2 | 3 | const defaultTheme = 'darcula'; 4 | let currentTheme = null; 5 | 6 | export const applyTheme = (newTheme) => { 7 | if (currentTheme === newTheme) { 8 | return; 9 | } 10 | 11 | if (currentTheme) { 12 | document.documentElement.classList.add('theme'); 13 | document.documentElement.addEventListener('transitionend', () => { 14 | document.documentElement.classList.remove('theme'); 15 | }, { once: true }); 16 | 17 | if (currentTheme !== defaultTheme) { 18 | document.documentElement.classList.remove(currentTheme); 19 | } 20 | } 21 | 22 | if (newTheme !== defaultTheme) { 23 | document.documentElement.classList.add(newTheme); 24 | } 25 | 26 | currentTheme = newTheme; 27 | }; 28 | -------------------------------------------------------------------------------- /src/common/touchHandler.js: -------------------------------------------------------------------------------- 1 | const RIGHT = 0; 2 | const DOWN = 1; 3 | const LEFT = 2; 4 | const UP = 3; 5 | 6 | const touchToPoint = t => ({ 7 | x: t.clientX, 8 | y: t.clientY, 9 | }); 10 | 11 | const changedTouchToPoint = e => touchToPoint(e.touches[0] || e.changedTouches[0]); 12 | 13 | const sqrtDist = (p1, p2) => { 14 | const dx = p1.x - p2.x; 15 | const dy = p1.y - p2.y; 16 | return (dx * dx) + (dy * dy); 17 | }; 18 | 19 | const angleRadians = (p1, p2) => Math.atan2(p2.y - p1.y, p2.x - p1.x); 20 | 21 | const angleToDirection = (angle) => { 22 | const positiveAngle = angle < 0 ? angle + (Math.PI * 2) : angle; 23 | if (positiveAngle >= Math.PI * 1.75 || positiveAngle < Math.PI * 0.25) { 24 | return RIGHT; 25 | } else if (positiveAngle < Math.PI * 0.75) { 26 | return DOWN; 27 | } else if (positiveAngle < Math.PI * 1.25) { 28 | return LEFT; 29 | } 30 | return UP; 31 | }; 32 | 33 | const calcAxisDelta = (dir, startPoint, point) => { 34 | if (dir === RIGHT) { 35 | return point.x - startPoint.x; 36 | } else if (dir === LEFT) { 37 | return startPoint.x - point.x; 38 | } else if (dir === UP) { 39 | return startPoint.y - point.y; 40 | } 41 | return point.y - startPoint.y; 42 | }; 43 | 44 | export default class TouchHandler { 45 | static RIGHT = RIGHT; 46 | static DOWN = DOWN; 47 | static LEFT = LEFT; 48 | static UP = UP; 49 | 50 | constructor(elem, callbacks) { 51 | this.elem = elem; 52 | this.callbacks = callbacks; 53 | this.panThreshold = 10 * 10; 54 | this.tapThreshold = 200; 55 | this.swipeThreshold = 0.2; 56 | 57 | this.onTouchStart = this.onTouchStart.bind(this); 58 | this.onTouchMove = this.onTouchMove.bind(this); 59 | } 60 | 61 | start() { 62 | this.elem.addEventListener('touchstart', this.onTouchStart, { passive: false }); 63 | } 64 | 65 | stop() { 66 | this.elem.removeEventListener('touchstart', this.onTouchStart); 67 | } 68 | 69 | resetPan(e) { 70 | this.startEvent = e; 71 | this.isPanning = false; 72 | } 73 | 74 | onTouchStart(e) { 75 | const path = e.path || (e.composedPath && e.composedPath()); 76 | const clickable = path.find((el) => { 77 | const tag = el.tagName && el.tagName.toLowerCase(); 78 | return tag === 'a' || tag === 'button'; 79 | }); 80 | if (clickable) { 81 | return; 82 | } 83 | 84 | e.preventDefault(); 85 | 86 | this.startEvent = e; 87 | this.bindOnTouch(); 88 | 89 | this.callbacks.start(); 90 | } 91 | 92 | bindOnTouch() { 93 | window.addEventListener('touchmove', this.onTouchMove, { passive: false }); 94 | 95 | window.addEventListener('touchend', (e) => { 96 | e.preventDefault(); 97 | 98 | const dt = e.timeStamp - this.startEvent.timeStamp; 99 | 100 | if (!this.isPanning && dt < this.tapThreshold) { 101 | this.callbacks.end(); 102 | this.callbacks.tap(e); 103 | } else { 104 | const start = changedTouchToPoint(this.startEvent); 105 | const end = changedTouchToPoint(e); 106 | const dir = angleToDirection(angleRadians(start, end)); 107 | const dist = calcAxisDelta(dir, start, end); 108 | const v = dist / dt; 109 | 110 | if (v > this.swipeThreshold && dir === this.panDir) { 111 | this.callbacks.swipe({ 112 | startEvent: this.startEvent, 113 | event: e, 114 | startPoint: start, 115 | point: end, 116 | dir, 117 | }); 118 | } 119 | 120 | this.callbacks.end(); 121 | } 122 | 123 | this.isPanning = false; 124 | this.panDir = null; 125 | window.removeEventListener('touchmove', this.onTouchMove); 126 | }, { once: true, passive: false }); 127 | } 128 | 129 | onTouchMove(e) { 130 | const start = changedTouchToPoint(this.startEvent); 131 | const end = changedTouchToPoint(e); 132 | const dir = angleToDirection(angleRadians(start, end)); 133 | 134 | 135 | if (!this.isPanning) { 136 | const dist = sqrtDist(start, end); 137 | if (dist >= this.panThreshold) { 138 | this.isPanning = true; 139 | this.panDir = dir; 140 | this.callbacks.startPan({ 141 | startEvent: this.startEvent, 142 | event: e, 143 | startPoint: start, 144 | point: end, 145 | dir: this.panDir, 146 | }); 147 | } else { 148 | return; 149 | } 150 | } 151 | 152 | const customEvent = { 153 | startEvent: this.startEvent, 154 | event: e, 155 | startPoint: start, 156 | point: end, 157 | dir: this.panDir, 158 | }; 159 | 160 | const distY = end.y - start.y; 161 | const distX = end.x - start.x; 162 | 163 | if ((this.panDir === TouchHandler.RIGHT && distX < 0) || 164 | (this.panDir === TouchHandler.LEFT && distX > 0) || 165 | (this.panDir === TouchHandler.UP && distY > 0) || 166 | (this.panDir === TouchHandler.DOWN && distY < 0)) { 167 | this.resetPan(e); 168 | this.callbacks.resetPan(customEvent); 169 | return; 170 | } 171 | 172 | this.callbacks.pan(customEvent); 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /src/components/AsyncImg.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 88 | 89 | 110 | -------------------------------------------------------------------------------- /src/components/DaFooter.vue: -------------------------------------------------------------------------------- 1 | 102 | 103 | 271 | 272 | 511 | -------------------------------------------------------------------------------- /src/components/DaIconSelector.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 46 | 47 | 81 | -------------------------------------------------------------------------------- /src/components/DaInsanePost.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 91 | 92 | 115 | -------------------------------------------------------------------------------- /src/components/DaPost.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 112 | 113 | 145 | -------------------------------------------------------------------------------- /src/components/DaSpinner.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 24 | 53 | -------------------------------------------------------------------------------- /src/components/DaStores.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 25 | 26 | 53 | -------------------------------------------------------------------------------- /src/components/DaSwitch.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 54 | 55 | 133 | -------------------------------------------------------------------------------- /src/components/DaTerminal.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 49 | 90 | 140 | -------------------------------------------------------------------------------- /src/components/DaToiletItem.vue: -------------------------------------------------------------------------------- 1 | 75 | 76 | 236 | 243 | 428 | -------------------------------------------------------------------------------- /src/fonts.js: -------------------------------------------------------------------------------- 1 | import './common/rIC'; 2 | 3 | window.WebFontConfig = { 4 | custom: { 5 | families: ['DejaVuSansMono'], 6 | urls: ['https://storage.googleapis.com/devkit-assets/static/dejavue.css'], 7 | }, 8 | }; 9 | 10 | requestIdleCallback(() => { 11 | (function loadWebFont(d) { 12 | const wf = d.createElement('script'); 13 | const s = d.scripts[0]; 14 | wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js'; 15 | wf.async = true; 16 | s.parentNode.insertBefore(wf, s); 17 | }(document)); 18 | }); 19 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import svgicon from 'vue-svgicon'; 3 | import VueMasonry from 'vue-masonry-css'; 4 | import VueVisible from 'vue-visible'; 5 | 6 | import App from './App.vue'; 7 | import router from './router'; 8 | import store from './store'; 9 | import './registerServiceWorker'; 10 | import './fonts'; 11 | 12 | Vue.config.productionTip = false; 13 | 14 | 15 | Vue.use(svgicon); 16 | Vue.use(VueMasonry); 17 | Vue.use(VueVisible); 18 | 19 | const setHeight = (el) => { 20 | // eslint-disable-next-line no-param-reassign 21 | el.style.height = `${window.innerHeight}px`; 22 | }; 23 | const fitElements = []; 24 | 25 | window.addEventListener('resize', () => { 26 | fitElements.forEach(setHeight); 27 | }); 28 | 29 | Vue.directive('fit-height', { 30 | bind: (el) => { 31 | setHeight(el); 32 | fitElements.push(el); 33 | }, 34 | 35 | unbind: (el) => { 36 | fitElements.splice(fitElements.indexOf(el), 1); 37 | }, 38 | }); 39 | 40 | const limitString = maxLength => (value) => { 41 | if (value.length <= maxLength) { 42 | return value; 43 | } 44 | 45 | return `${value.substr(0, maxLength - 3)}...`; 46 | }; 47 | 48 | Vue.filter('cardTitle', limitString(102)); 49 | Vue.filter('toiletTitle', limitString(160)); 50 | 51 | Vue.filter('provider', (value) => { 52 | if (value === 'github') { 53 | return 'GitHub'; 54 | } 55 | 56 | return value.replace(/^\w/, c => c.toUpperCase()); 57 | }); 58 | 59 | 60 | new Vue({ 61 | router, 62 | store, 63 | render: h => h(App), 64 | }).$mount('#app'); 65 | -------------------------------------------------------------------------------- /src/registerServiceWorker.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | import { register } from 'register-service-worker'; 4 | 5 | if (process.env.NODE_ENV === 'production') { 6 | register(`${process.env.BASE_URL}service-worker.js`, { 7 | ready() { 8 | console.log('App is being served from cache by a service worker.\n' + 9 | 'For more details, visit https://goo.gl/AFskqB'); 10 | }, 11 | cached() { 12 | console.log('Content has been cached for offline use.'); 13 | }, 14 | updated() { 15 | console.log('New content is available; please refresh.'); 16 | }, 17 | offline() { 18 | console.log('No internet connection found. App is running in offline mode.'); 19 | }, 20 | error(error) { 21 | console.error('Error during service worker registration:', error); 22 | }, 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /src/router/guards/anonymous.js: -------------------------------------------------------------------------------- 1 | import router from '../'; 2 | import store from '../../store'; 3 | 4 | export default function (to, from, next) { 5 | if (store.getters['user/isLoggedIn']) { 6 | router.replace('/'); 7 | } else { 8 | next(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/router/guards/loadState.js: -------------------------------------------------------------------------------- 1 | import router from '../'; 2 | import store from '../../store'; 3 | import checkSupport from '../../common/support'; 4 | import { getState } from '../../common/storage'; 5 | import { init } from '../../common/analytics'; 6 | import { applyTheme } from '../../common/theme'; 7 | 8 | export default function (to, from, next) { 9 | if (to.name !== 'notSupported' && !checkSupport()) { 10 | return router.replace('/notSupported'); 11 | } 12 | 13 | if (store.initialized) { 14 | return next(); 15 | } 16 | 17 | return getState() 18 | .then((state) => { 19 | store.commit('loadFromCache', state); 20 | 21 | init(store.getters['user/isLoggedIn'] ? store.state.user.profile.id : null); 22 | 23 | applyTheme(store.state.ui.theme); 24 | next(); 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /src/router/guards/loggedIn.js: -------------------------------------------------------------------------------- 1 | import router from '../'; 2 | import store from '../../store'; 3 | 4 | export default function (to, from, next) { 5 | store.dispatch('user/refreshToken') 6 | .then(() => { 7 | if (!store.getters['user/isLoggedIn']) { 8 | const url = to.path !== '/' ? `?from=${to.path}` : ''; 9 | router.replace(`/login${url}`); 10 | } else { 11 | next(); 12 | } 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | import loadStateGuard from './guards/loadState'; 4 | 5 | Vue.use(Router); 6 | 7 | const router = new Router({ 8 | mode: 'history', 9 | base: process.env.BASE_URL, 10 | routes: [ 11 | { 12 | path: '/', 13 | redirect: '/toilet', 14 | }, 15 | { 16 | path: '/home', 17 | name: 'home', 18 | component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue'), 19 | children: [ 20 | { 21 | path: '/toilet', 22 | component: () => import(/* webpackChunkName: "toilet" */ '../views/Toilet.vue'), 23 | }, 24 | ], 25 | }, 26 | { 27 | path: '/login', 28 | name: 'login', 29 | component: () => import(/* webpackChunkName: "login" */ '../views/Login.vue'), 30 | }, 31 | { 32 | path: '/oauth/:provider/callback', 33 | name: 'oauth', 34 | component: () => import(/* webpackChunkName: "oauth" */ '../views/OAuth.vue'), 35 | }, 36 | { 37 | path: '/notSupported', 38 | name: 'notSupported', 39 | component: () => import(/* webpackChunkName: "notSupported" */ '../views/NotSupported.vue'), 40 | }, 41 | { 42 | path: '*', 43 | name: 'notFound', 44 | component: () => import(/* webpackChunkName: "notFound" */ '../views/NotFound.vue'), 45 | }, 46 | ], 47 | }); 48 | 49 | router.beforeEach(loadStateGuard); 50 | 51 | export default router; 52 | -------------------------------------------------------------------------------- /src/store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Vuex Store files. 6 | Vuex Store option is implemented in the Nuxt.js framework. 7 | 8 | Creating a file in this directory activate the option in the framework automatically. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). 11 | -------------------------------------------------------------------------------- /src/store/feed.js: -------------------------------------------------------------------------------- 1 | import { fetchPublications, fetchBookmarks } from '../common/api'; 2 | 3 | const initialState = () => ({ 4 | publications: [], 5 | page: 0, 6 | latest: null, 7 | loading: false, 8 | bookmarks: null, 9 | showBookmarks: true, 10 | }); 11 | 12 | const handleNewPage = (state, commit, suffix, posts) => { 13 | if (!state.page) { 14 | commit(`set${suffix}`, posts); 15 | } else { 16 | commit(`add${suffix}`, posts); 17 | } 18 | 19 | commit('setLoading', false); 20 | 21 | if (posts.length) { 22 | commit('setPage', state.page + 1); 23 | } 24 | }; 25 | 26 | const fetchBookmarksFeed = (state, commit) => 27 | fetchBookmarks(state.latest, state.page) 28 | .then((posts) => { 29 | const postsWithBookmarked = posts.map(p => Object.assign({}, p, { bookmarked: true })); 30 | handleNewPage(state, commit, 'Bookmarks', postsWithBookmarked); 31 | }); 32 | 33 | export default { 34 | namespaced: true, 35 | 36 | state: initialState(), 37 | 38 | mutations: { 39 | reset(state) { 40 | const s = initialState(); 41 | Object.keys(s).forEach((key) => { 42 | state[key] = s[key]; 43 | }); 44 | }, 45 | 46 | setPublications(state, pubs) { 47 | state.publications = pubs; 48 | }, 49 | 50 | setLatestTime(state, latest) { 51 | state.latest = latest; 52 | }, 53 | 54 | setPage(state, page) { 55 | state.page = page; 56 | }, 57 | 58 | setLoading(state, loading) { 59 | state.loading = loading; 60 | }, 61 | 62 | setBookmarks(state, bookmarks) { 63 | // if (state.bookmarks && state.posts) { 64 | // state.bookmarks.forEach(bookmark => setPostBookmark(state, bookmark.id, false)); 65 | // } 66 | state.bookmarks = bookmarks; 67 | // if (state.posts) { 68 | // state.bookmarks.forEach(bookmark => setPostBookmark(state, bookmark.id, true)); 69 | // } 70 | }, 71 | 72 | addBookmarks(state, bookmarks) { 73 | state.bookmarks = state.bookmarks.concat(bookmarks); 74 | }, 75 | 76 | toggleBookmark(state, { id, bookmarked, post }) { 77 | if (!bookmarked) { 78 | const index = state.bookmarks.findIndex(bookmark => bookmark.id === id); 79 | state.bookmarks.splice(index, 1); 80 | } else { 81 | state.bookmarks.unshift(Object.assign({}, post, { bookmarked })); 82 | } 83 | }, 84 | }, 85 | 86 | actions: { 87 | fetchPublications({ commit }) { 88 | return fetchPublications() 89 | .then(pubs => commit('setPublications', pubs)); 90 | }, 91 | 92 | fetchNextPage({ commit, state, rootGetters }) { 93 | if (state.loading || (state.page >= 5 && !state.showBookmarks)) { 94 | return false; 95 | } 96 | 97 | if (!state.page) { 98 | commit('setLatestTime', new Date()); 99 | } 100 | commit('setLoading', true); 101 | 102 | if (!rootGetters['user/isLoggedIn']) { 103 | // fetchAnonymousFeed(state, commit); 104 | } else if (state.showBookmarks) { 105 | fetchBookmarksFeed(state, commit); 106 | } else { 107 | // fetchUserFeed(state, commit, rootState.user.profile.accessToken); 108 | } 109 | 110 | return true; 111 | }, 112 | }, 113 | }; 114 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Vuex from 'vuex'; 3 | 4 | import cache from './plugins/cache'; 5 | import sync from './plugins/sync'; 6 | 7 | import feed from './feed'; 8 | import ui from './ui'; 9 | import user from './user'; 10 | 11 | Vue.use(Vuex); 12 | 13 | export default new Vuex.Store({ 14 | state: { 15 | initialized: false, 16 | }, 17 | mutations: { 18 | loadFromCache(state, cached) { 19 | if (cached) { 20 | Object.keys(cached).forEach((key) => { 21 | state[key] = Object.assign({}, state[key], cached[key]); 22 | }); 23 | } 24 | 25 | state.initialized = true; 26 | }, 27 | }, 28 | plugins: [cache, sync], 29 | modules: { feed, ui, user }, 30 | }); 31 | 32 | -------------------------------------------------------------------------------- /src/store/plugins/cache.js: -------------------------------------------------------------------------------- 1 | import { cacheState } from '../../common/storage'; 2 | 3 | const plugin = (store) => { 4 | store.subscribe((mutation, state) => { 5 | if (mutation.type !== 'loadFromCache' && mutation.type.indexOf('reset') < 0) { 6 | cacheState(state) 7 | // eslint-disable-next-line no-console 8 | .catch(err => console.warn('failed to cache state', err)); 9 | } 10 | }); 11 | }; 12 | 13 | export default plugin; 14 | -------------------------------------------------------------------------------- /src/store/plugins/sync.js: -------------------------------------------------------------------------------- 1 | import '../../common/rIC'; 2 | import { updateSettings, fetchSettings, addBookmarks, removeBookmark } from '../../common/api'; 3 | 4 | let syncing = false; 5 | 6 | const syncSettingsFromServer = (store, state) => { 7 | if (store.getters['user/isLoggedIn']) { 8 | fetchSettings() 9 | .then((settings) => { 10 | syncing = true; 11 | if (settings.theme !== state.ui.theme) { 12 | store.dispatch('ui/setTheme', settings.theme); 13 | } 14 | store.commit('ui/setInsaneMode', settings.appInsaneMode); 15 | syncing = false; 16 | }); 17 | } 18 | }; 19 | 20 | const plugin = (store) => { 21 | store.subscribe((mutation, state) => { 22 | switch (mutation.type) { 23 | case 'loadFromCache': 24 | case 'user/updateProfile': 25 | requestIdleCallback(() => syncSettingsFromServer(store, state)); 26 | break; 27 | case 'feed/toggleBookmark': { 28 | const { id, bookmarked } = mutation.payload; 29 | if (bookmarked) { 30 | addBookmarks([id]); 31 | } else { 32 | removeBookmark(id); 33 | } 34 | break; 35 | } 36 | case 'ui/setTheme': 37 | case 'ui/setInsaneMode': 38 | if (!syncing) { 39 | const settings = { 40 | theme: state.ui.theme, 41 | appInsaneMode: state.ui.insaneMode, 42 | }; 43 | updateSettings(settings); 44 | } 45 | break; 46 | default: 47 | // Ignore default case 48 | } 49 | }); 50 | }; 51 | 52 | export default plugin; 53 | -------------------------------------------------------------------------------- /src/store/ui.js: -------------------------------------------------------------------------------- 1 | import { applyTheme } from '../common/theme'; 2 | 3 | const initialState = () => ({ 4 | theme: 'darcula', 5 | insaneMode: true, 6 | }); 7 | 8 | export default { 9 | namespaced: true, 10 | state: initialState(), 11 | mutations: { 12 | reset(state) { 13 | const s = initialState(); 14 | Object.keys(s).forEach((key) => { 15 | state[key] = s[key]; 16 | }); 17 | }, 18 | 19 | setTheme(state, theme) { 20 | state.theme = theme; 21 | }, 22 | 23 | setInsaneMode(state, value) { 24 | state.insaneMode = value; 25 | }, 26 | }, 27 | actions: { 28 | setTheme({ commit }, theme) { 29 | applyTheme(theme); 30 | return commit('setTheme', theme); 31 | }, 32 | }, 33 | }; 34 | -------------------------------------------------------------------------------- /src/store/user.js: -------------------------------------------------------------------------------- 1 | import { logout, fetchUser } from '../common/api'; 2 | import { deleteState } from '../common/storage'; 3 | 4 | const initialState = () => ({ profile: null }); 5 | 6 | export default { 7 | namespaced: true, 8 | state: initialState(), 9 | mutations: { 10 | reset(state) { 11 | const s = initialState(); 12 | Object.keys(s).forEach((key) => { 13 | state[key] = s[key]; 14 | }); 15 | }, 16 | 17 | updateProfile(state, profile) { 18 | state.profile = profile; 19 | }, 20 | 21 | refreshToken(state, newToken) { 22 | state.profile = Object.assign({}, state.profile, newToken); 23 | }, 24 | 25 | notNewUser(state) { 26 | state.profile.newUser = false; 27 | }, 28 | }, 29 | actions: { 30 | refreshToken({ commit }) { 31 | return fetchUser() 32 | .then((user) => { 33 | if ('providers' in user) { 34 | const userClone = Object.assign({}, user); 35 | userClone.accessToken = undefined; 36 | commit('updateProfile', userClone); 37 | } else { 38 | commit('updateProfile', null); 39 | } 40 | }); 41 | }, 42 | logout({ commit }) { 43 | commit('reset'); 44 | commit('ui/reset', null, { root: true }); 45 | commit('feed/reset', null, { root: true }); 46 | return Promise.all([ 47 | logout(), 48 | deleteState(), 49 | ]); 50 | }, 51 | }, 52 | getters: { 53 | isLoggedIn(state) { 54 | return !!state.profile && !!state.profile.id; 55 | }, 56 | }, 57 | }; 58 | -------------------------------------------------------------------------------- /src/styles/card.pcss: -------------------------------------------------------------------------------- 1 | .card { 2 | position: relative; 3 | 4 | &:before { 5 | content: ' '; 6 | display: block; 7 | width: 100%; 8 | padding-top: 108%; 9 | } 10 | 11 | &.small:before { 12 | padding-top: 96%; 13 | } 14 | 15 | &.large:before { 16 | padding-top: 119%; 17 | } 18 | 19 | & .post-link { 20 | position: absolute; 21 | left: 0; 22 | top: 0; 23 | width: 100%; 24 | height: 100%; 25 | justify-content: flex-end; 26 | text-decoration: none; 27 | outline: 0; 28 | } 29 | 30 | & .card-background { 31 | position: absolute; 32 | top: 0; 33 | left: 0; 34 | width: 100%; 35 | height: 58%; 36 | border-radius: 8px; 37 | overflow: hidden; 38 | 39 | & .async-img { 40 | width: 100%; 41 | height: 100%; 42 | } 43 | } 44 | 45 | &.large .card-background { 46 | height: 62%; 47 | } 48 | 49 | &.small { 50 | & .card-background, 51 | & .card-content { 52 | height: 53%; 53 | } 54 | } 55 | 56 | & .card-content { 57 | position: absolute; 58 | box-sizing: border-box; 59 | bottom: 0; 60 | left: 0; 61 | width: 100%; 62 | height: 47%; 63 | padding-bottom: 52px; 64 | z-index: 1; 65 | word-break: break-word; 66 | } 67 | 68 | & .card-content-background { 69 | position: absolute; 70 | left: 0; 71 | top: 0; 72 | width: 100%; 73 | height: 100%; 74 | background: var(--color-background-highlight); 75 | border-radius: var(--size-space); 76 | } 77 | 78 | & .card-content-background, & h3 { 79 | box-shadow: 0 var(--shadow-offset) 16px 0 rgba(0, 0, 0, 0.1); 80 | } 81 | 82 | & h3, & h4 { 83 | margin: 0; 84 | } 85 | 86 | & h3 { 87 | flex: 1; 88 | padding: calc(var(--size-space) * 2); 89 | color: var(--color-primary); 90 | z-index: 1; 91 | border-bottom: 1px solid var(--color-tile-border); 92 | box-sizing: border-box; 93 | } 94 | 95 | & h4 { 96 | color: var(--color-comment); 97 | font-style: italic; 98 | } 99 | 100 | & .card-footer { 101 | position: absolute; 102 | left: 0; 103 | bottom: 0; 104 | width: 100%; 105 | height: 52px; 106 | padding: 0 calc(var(--size-space) * 2); 107 | z-index: 1; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/styles/custom.pcss: -------------------------------------------------------------------------------- 1 | @custom-media --mobile-m (min-width: 375px); 2 | @custom-media --tablet (min-width: 700px); 3 | -------------------------------------------------------------------------------- /src/styles/global.pcss: -------------------------------------------------------------------------------- 1 | @import './reset.pcss'; 2 | @import './layout.pcss'; 3 | @import './typography.pcss'; 4 | @import './custom.pcss'; 5 | 6 | html { 7 | font-family: 'DejaVuSansMono', monospace, sans-serif; 8 | font-size: 16px; 9 | word-spacing: 1px; 10 | -ms-text-size-adjust: 100%; 11 | -webkit-text-size-adjust: 100%; 12 | -moz-osx-font-smoothing: grayscale; 13 | -webkit-font-smoothing: antialiased; 14 | box-sizing: border-box; 15 | background: var(--color-background); 16 | 17 | --color-background: #272727; 18 | --color-background-highlight: #393C3E; 19 | --color-light-shadow: #525252; 20 | --color-dark-shadow: #272727; 21 | --color-tile-border: #272727; 22 | --color-comment: #848886; 23 | --color-primary: #BFBEBE; 24 | --color-secondary: #66696C; 25 | --color-highlight: #4D96F1; 26 | --color-special1: #FDC769; 27 | --color-special2: #9DCB74; 28 | --color-special3: #D77E2B; 29 | --color-special4: #698C5A; 30 | --color-white: white; 31 | --color-white-trans: rgba(0, 0, 0, 0); 32 | --color-black: black; 33 | 34 | --shadow-offset: 8px; 35 | 36 | &.bright { 37 | --color-background: #EAEAEA; 38 | --color-background-highlight: #F8F8F8; 39 | --color-light-shadow: #CFCFCF; 40 | --color-dark-shadow: #CFCFCF; 41 | --color-tile-border: #F3F3F3; 42 | --color-comment: #AAAAAA; 43 | --color-primary: #848886; 44 | --color-secondary: #BFBEBE; 45 | --color-highlight: #4D96F1; 46 | --color-special1: #FDC769; 47 | --color-special2: #9DCB74; 48 | --color-special3: #DE7C20; 49 | --color-special4: #5F9F44; 50 | --color-white: black; 51 | --color-white-trans: rgba(255, 255, 255, 0); 52 | --color-black: white; 53 | 54 | --shadow-offset: 2px; 55 | 56 | background: var(--color-background); 57 | } 58 | } 59 | 60 | html.theme, 61 | html.theme * { 62 | transition: all 0.2s linear; 63 | } 64 | 65 | html.dialog-open body { 66 | overflow: hidden; 67 | } 68 | 69 | * { 70 | -webkit-tap-highlight-color: transparent; 71 | } 72 | 73 | *, *:before, *:after { 74 | box-sizing: border-box; 75 | margin: 0; 76 | } 77 | 78 | a { 79 | text-decoration: none; 80 | } 81 | 82 | button { 83 | padding: 0; 84 | cursor: pointer; 85 | background: none; 86 | border: none; 87 | 88 | &:focus { 89 | outline: none; 90 | } 91 | 92 | &::-moz-focus-inner { 93 | border: none; 94 | } 95 | } 96 | 97 | .flex { 98 | flex: 1; 99 | } 100 | 101 | .horizontal { 102 | display: flex; 103 | flex-direction: row; 104 | } 105 | 106 | .vertical { 107 | display: flex; 108 | flex-direction: column; 109 | } 110 | 111 | .align-center { 112 | align-items: center; 113 | } 114 | 115 | .justify-center { 116 | justify-content: center; 117 | } 118 | 119 | .primary { 120 | color: var(--color-primary); 121 | } 122 | 123 | .comment { 124 | color: var(--color-comment); 125 | } 126 | 127 | .special3 { 128 | color: var(--color-special3); 129 | } 130 | 131 | .special4 { 132 | color: var(--color-special4); 133 | } 134 | 135 | .svg-icon, .icon-selector { 136 | width: 24px; 137 | height: 24px; 138 | color: var(--color-comment); 139 | } 140 | 141 | .svg-fill { 142 | fill: currentColor; 143 | stroke: none; 144 | } 145 | 146 | .switch { 147 | --da-switch-color: var(--color-background); 148 | --da-switch-checked-color: var(--color-highlight); 149 | --da-switch-width: 56px; 150 | --da-switch-height: 28px; 151 | --da-switch-slider-height: 18px; 152 | } 153 | 154 | .dialog { 155 | position: fixed; 156 | bottom: 0; 157 | background: var(--color-background-highlight); 158 | border-radius: calc(var(--size-space) * 2) calc(var(--size-space) * 2) 0 0; 159 | box-shadow: 0 8px 32px 16px rgba(0, 0, 0, 0.32); 160 | } 161 | 162 | .dialog, .limit-width { 163 | left: 0; 164 | right: 0; 165 | max-width: 400px; 166 | margin: 0 auto; 167 | } 168 | 169 | .bookmark-illu { 170 | position: relative; 171 | width: 100%; 172 | max-height: 190px; 173 | 174 | & img { 175 | position: absolute; 176 | left: 0; 177 | top: 0; 178 | right: 0; 179 | bottom: 0; 180 | height: 100%; 181 | margin: auto; 182 | } 183 | } 184 | 185 | .dialog-container { 186 | position: fixed; 187 | left: 0; 188 | top: 0; 189 | right: 0; 190 | bottom: 0; 191 | overflow: hidden; 192 | z-index: 100; 193 | 194 | &:before { 195 | content: ' '; 196 | position: absolute; 197 | left: 0; 198 | top: 0; 199 | right: 0; 200 | bottom: 0; 201 | background: var(--color-background); 202 | opacity: 0.52; 203 | } 204 | 205 | & .dialog { 206 | width: 100%; 207 | max-height: 100vh; 208 | overflow: auto; 209 | } 210 | } 211 | 212 | .pixel { 213 | display: none; 214 | width: 0; 215 | height: 0; 216 | } 217 | 218 | .show-on-tablet { 219 | display: none; 220 | } 221 | 222 | @media (--tablet) { 223 | a, button { 224 | &:hover .svg-icon { 225 | color: var(--color-white); 226 | } 227 | } 228 | 229 | .hide-on-tablet { 230 | display: none; 231 | } 232 | 233 | .show-on-tablet { 234 | display: block; 235 | } 236 | } 237 | -------------------------------------------------------------------------------- /src/styles/insane.pcss: -------------------------------------------------------------------------------- 1 | .insane-row { 2 | display: flex; 3 | padding: calc(var(--size-space) * 2); 4 | flex-direction: row; 5 | align-content: stretch; 6 | overflow: hidden; 7 | background: none; 8 | border-bottom: 1px solid var(--color-background); 9 | 10 | & > * { 11 | margin: 0 var(--size-space); 12 | 13 | &:first-child { 14 | margin-left: 0; 15 | } 16 | 17 | &:last-child { 18 | margin-right: 0; 19 | } 20 | } 21 | 22 | & .content { 23 | display: flex; 24 | flex-direction: column; 25 | 26 | & > * { 27 | margin: 5px 0; 28 | 29 | &:first-child { 30 | margin-top: 0; 31 | } 32 | 33 | &:last-child { 34 | margin-bottom: 0; 35 | } 36 | } 37 | 38 | & .publication .comment { 39 | font-style: italic; 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/styles/layout.pcss: -------------------------------------------------------------------------------- 1 | html { 2 | --size-column: 64px; 3 | --size-space: 8px; 4 | --size-row: 16px; 5 | --size-gap: 16px; 6 | --size-footer: 75px; 7 | --size-lines: 36px; 8 | --size-pubs: 204px; 9 | } 10 | -------------------------------------------------------------------------------- /src/styles/reset.pcss: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, embed, 16 | figure, figcaption, footer, header, hgroup, 17 | menu, nav, output, ruby, section, summary, 18 | time, mark, audio, video { 19 | margin: 0; 20 | padding: 0; 21 | border: 0; 22 | font-size: 100%; 23 | font: inherit; 24 | vertical-align: baseline; 25 | } 26 | 27 | /* HTML5 display-role reset for older browsers */ 28 | article, aside, details, figcaption, figure, 29 | footer, header, hgroup, menu, nav, section { 30 | display: block; 31 | } 32 | 33 | body { 34 | line-height: 1; 35 | } 36 | 37 | ol, ul { 38 | list-style: none; 39 | } 40 | 41 | blockquote, q { 42 | quotes: none; 43 | } 44 | 45 | blockquote:before, blockquote:after, 46 | q:before, q:after { 47 | content: ''; 48 | content: none; 49 | } 50 | 51 | table { 52 | border-collapse: collapse; 53 | border-spacing: 0; 54 | } 55 | -------------------------------------------------------------------------------- /src/styles/typography.pcss: -------------------------------------------------------------------------------- 1 | @import '../styles/custom.pcss'; 2 | 3 | .common { 4 | font-family: 'DejaVuSansMono', monospace, sans-serif; 5 | -webkit-font-smoothing: antialiased; 6 | -moz-osx-font-smoothing: grayscale; 7 | } 8 | 9 | .caption { 10 | @extend .common; 11 | 12 | font-size: 12px; 13 | line-height: 16px; 14 | font-weight: 400; 15 | } 16 | 17 | .subtext { 18 | @extend .common; 19 | 20 | font-size: 14px; 21 | line-height: 20px; 22 | font-weight: 400; 23 | } 24 | 25 | .text { 26 | @extend .common; 27 | 28 | font-size: 16px; 29 | line-height: 20px; 30 | font-weight: 400; 31 | } 32 | 33 | .title { 34 | @extend .common; 35 | 36 | font-size: 18px; 37 | line-height: 24px; 38 | font-weight: 400; 39 | } 40 | 41 | .jumbo { 42 | @extend .common; 43 | 44 | font-size: 20px; 45 | line-height: 28px; 46 | font-weight: 400; 47 | } 48 | 49 | .massive { 50 | @extend .common; 51 | 52 | font-size: 24px; 53 | line-height: 28px; 54 | font-weight: 400; 55 | } 56 | 57 | .res-subtext { 58 | @extend .subtext; 59 | } 60 | 61 | @media (--mobile-m) { 62 | .res-subtext { 63 | @extend .title; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 106 | 231 | 232 | 236 | 237 | 406 | -------------------------------------------------------------------------------- /src/views/Login.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 67 | 68 | 189 | -------------------------------------------------------------------------------- /src/views/NotFound.vue: -------------------------------------------------------------------------------- 1 | 21 | 43 | 44 | 54 | -------------------------------------------------------------------------------- /src/views/NotSupported.vue: -------------------------------------------------------------------------------- 1 | 38 | 65 | 111 | -------------------------------------------------------------------------------- /src/views/OAuth.vue: -------------------------------------------------------------------------------- 1 | 8 | 40 | -------------------------------------------------------------------------------- /src/views/Toilet.vue: -------------------------------------------------------------------------------- 1 | 58 | 59 | 441 | 442 | 449 | 450 | 534 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | devServer: { 3 | proxy: { 4 | '/api': { 5 | target: 'http://localhost:4000', 6 | changeOrigin: true, 7 | pathRewrite: { 8 | '^/api': '', 9 | }, 10 | }, 11 | }, 12 | }, 13 | productionSourceMap: false, 14 | pwa: { 15 | name: 'Daily Go', 16 | themeColor: '#393C3E', 17 | msTileColor: '#393C3E', 18 | iconPaths: { 19 | favicon32: 'img/icons/icon-32x32.png', 20 | favicon16: 'img/icons/icon-16x16.png', 21 | appleTouchIcon: 'img/icons/icon-152x152.png', 22 | msTileImage: 'img/icons/icon-144x144.png', 23 | }, 24 | workboxOptions: { 25 | exclude: [/_redirects$/], 26 | runtimeCaching: [ 27 | { 28 | // eslint-disable-next-line no-useless-escape 29 | urlPattern: new RegExp('^https:\/\/(storage\.googleapis\.com\/devkit-assets\/images|res\.cloudinary\.com\/daily-now\/image\/upload\/.*\/v1\/posts)\/.*'), 30 | method: 'GET', 31 | handler: 'cacheFirst', 32 | options: { 33 | cacheName: 'post-images', 34 | expiration: { 35 | // 7 days 36 | maxAgeSeconds: 604800, 37 | }, 38 | }, 39 | }, 40 | { 41 | // eslint-disable-next-line no-useless-escape 42 | urlPattern: new RegExp('^https://(storage\.googleapis\.com\/devkit-assets\/ads|res\.cloudinary\.com/daily-now/image/upload/.*/v1/ads)/.*'), 43 | method: 'GET', 44 | handler: 'cacheFirst', 45 | options: { 46 | cacheName: 'ads-images', 47 | expiration: { 48 | // 7 days 49 | maxAgeSeconds: 604800, 50 | }, 51 | }, 52 | }, 53 | { 54 | // eslint-disable-next-line no-useless-escape 55 | urlPattern: new RegExp('^https://res\.cloudinary\.com/daily-now/image/upload/.*/v1/logos/.*'), 56 | method: 'GET', 57 | handler: 'cacheFirst', 58 | options: { 59 | cacheName: 'pubs-logos', 60 | }, 61 | }, 62 | { 63 | urlPattern: 'https://www.google-analytics.com/analytics.js', 64 | handler: 'cacheFirst', 65 | }, 66 | { 67 | urlPattern: new RegExp('https://ajax.googleapis.com/ajax/libs/webfont/.*'), 68 | method: 'GET', 69 | handler: 'cacheFirst', 70 | }, 71 | { 72 | urlPattern: new RegExp('https://storage.googleapis.com/devkit-assets/static/.*'), 73 | method: 'GET', 74 | handler: 'cacheFirst', 75 | }, 76 | { 77 | urlPattern: '/', 78 | method: 'GET', 79 | handler: 'networkFirst', 80 | }, 81 | { 82 | urlPattern: new RegExp('^/(home|toilet|login|oauth|notSupported).*'), 83 | method: 'GET', 84 | handler: 'networkFirst', 85 | }, 86 | ], 87 | }, 88 | }, 89 | }; 90 | --------------------------------------------------------------------------------