Commit Graph

437 Commits

Author SHA1 Message Date
Guangcong Luo
3d6b33e27f Fix style error 2021-05-14 04:51:48 -04:00
urkerab
35b919765a
Make ranges appear again in Firefox (#1771) 2021-05-04 04:26:55 -07:00
Guangcong Luo
f3d8f67786 Fix pokemon list glitching when zoomed 2021-04-02 02:36:07 -04:00
Spandan Punwatkar
1fe0b7eb85
Client-side support for Multi Battles (#1649) 2021-03-28 15:13:07 -07:00
SirKira(!Uzumaki)
036f1dd062
Add a horizontal scroll bar for "infobox-limited" class (#1699)
Ig infobox-limited class is in room intros and in the event box. On mobile phones, it is hard to check the whole room intro or event and you can slide because overflow for the x axis is hidden. So just removing overflow-x: hidden.
2020-12-22 23:55:29 -08:00
Mia
ace0f2eaa5
Add CSS for subtle notifying buttons (#1672) 2020-11-18 19:07:31 -08:00
MacChaeger
d10c473a9d
Teambuilder: Implement Box system (#1222) 2020-11-07 18:16:23 -08:00
Guangcong Luo
25afe30af0 Use Dark Mode theming for Main Menu
"Format/Team" and the spectator checkbox have too low contrast on
certain backgrounds.

I suspect we'll get a lot of complaints regarding the redesign, but
oh well, accessibility wins here.
2020-07-11 20:55:24 -07:00
Guangcong Luo
986841acd8 Improve styling for checkbox
(Alignment still needed more tweaking, and it needed more work to
look good in the Main Menu.)
2020-07-11 22:09:50 -04:00
Kirk Scheibelhut
99c1b7451f
Introduce a "Don't allow spectators" checkbox (#1548) 2020-07-11 18:43:56 -07:00
Guangcong Luo
df71047306 Fix sliders in Firefox
Quoting CSS tricks:

https://css-tricks.com/styling-cross-browser-compatible-range-inputs-css/

> Note that while we’re repeating code here, that’s necessary as you
> can’t comma-separate these type of selectors. Browsers will drop the
> entire selector if it doesn’t understand a part of it.

I really don't want to repeat my CSS three times, and Firefox's default
sliders don't look ugly, so we're just going to let Firefox use its
default sliders.

I'm annoyed that Firefox just takes `-webkit-appearance` without
also taking `-webkit-slider-thumb` etc, though. :/
2020-05-29 21:54:26 -07:00
Guangcong Luo
128d8bdc52 Improve CSS styling
This is modified from @StephenArg's original CSS in #1522. Thanks for
providing the original CSS for me to play around with!

Closes #1522
2020-05-29 21:41:48 -07:00
Guangcong Luo
54dce68ade Consistently wrap words in chat boxes
This makes battle chat work like chatrooms and PMs, wrapping
lines with no spaces that get too long.
2020-05-25 18:21:21 -04:00
Wally
a97c287bf4
fix css visual bug on mobile (#1513)
.tablist .button "width" isn't good on mobile 
how it currently looks: http://prntscr.com/sdygem
how it should look: http://prntscr.com/sdygnr
2020-05-10 01:46:34 -07:00
Guangcong Luo
b815730c51 Improve teambuilder team selection layout 2020-05-03 22:40:11 -07:00
AnnikaCodes
8af0f9b7be
Teambuilder: Implement exporting to PokePaste (#1497) 2020-04-28 22:22:26 -07:00
Guangcong Luo
730d1ffd1a Use bigger Meloetta sprites
There are people who didn't know Meloetta was PS's mascot! They clearly
needs to be more noticeable. And now they definitely will be.

We're now using the full Gen 5 sprite instead of the minisprite,
overlapping with the buttons, and animated on hover. This might be a
bit over-the-top, but oh well, it's only on hover.
2020-04-01 16:11:10 -07:00
Guangcong Luo
b730156490 Support format list sections/columns
This is probably about as much as I'll implement for now. We'll need to
deprecate the old client before we can implement any major reforms to
the formats list design.
2020-03-28 09:21:23 -07:00
Guangcong Luo
5e32181b89 Support creating, deleting, and renaming teams 2020-03-28 09:21:23 -07:00
Guangcong Luo
d589ac7fef Support user statuses and away status
Also includes a refactor to introduce a new `PSUtils.sortBy`, now
used to make sorting the user list a lot more readable.
2020-03-24 23:45:21 -07:00
Guangcong Luo
a64279cdf5 Add volume/dark mode controls
This is a stub for the Options screens in the Preact client.
2020-03-24 02:50:09 -07:00
Guangcong Luo
40d077903f Support playing battles
This should be a much nicer architecture than the old
`client-battle.js`.

In particular, much of the logic of choosing moves/switches has been
moved into a new `battle-choices.ts`, with `panel-battle.tsx` only
covering the UI.
2020-03-23 06:55:35 -04:00
Guangcong Luo
2af424ef04 Update for CSS changes 2020-03-19 21:28:18 -07:00
Guangcong Luo
a176317913 Refactor CSS, add CSS guide
`style/STYLING.html` is now a guide of generic CSS classes that can be
used by bots and chat plugins.

CSS classes that can be used by bots and chat plugins are now in a new
`battle-log.css` (previously just a section of `battle.css`)

Several PS styling patterns (specifically, `message-log`, `option`, and
`blocklink`) have been refactored into CSS classes, so that they can
be used by bots and chat plugins (why yes, I do plan on using 2/3 of
them in the log viewer).

Past CSS has been super messy. This refactor tries to make it neater
by adhering to these rules:

- Instead of trying to use e.g. `.setmenu button` selectors (to save
  `class=` on every individual list item), give up and just put
  `.option` directly on list items. This drastically cuts down on all
  the hacks necessary to have `.button` work inside `.setmenu`.

...That's it. That's the only change. It massively cuts down on CSS
complexity. It does slightly complicate the DOM, which I'm not a _huge_
fan of, but CSS unpredictability is nearly impossible to catch and
debug, so it's massively worth it.
2020-03-15 22:49:36 -07:00
Ben Davies
e3fcaa492c
Properly set the encoding to UTF-8 on all HTML pages (#1467)
This adds the BOM to all HTTP pages as per the HTML5 spec and ensures
all pages use UTF-8 as their meta charset (which is still kept for
compatibility with older browsers).
2020-02-23 00:13:56 -08:00
Guangcong Luo
72717a7559 Bold usergroup descriptions
Fixes #1319
2019-11-28 15:29:48 +13:00
Guangcong Luo
88bb2ea435 Improve appearance of in-PM Challenge button 2019-11-15 06:12:00 +13:00
jordanhui19
8f7674f5d8 Add "Challenge" and "..." buttons to top of chat windows (#1385) 2019-11-03 20:37:27 +10:30
Guangcong Luo
5d6304eeb6 Support PM windows
These are now called `mini-window`s by the client code, and they're now
generic in the sense that any PS room can be a mini-window, not just
PMs and News.

This also adds BattleTextParser as a dependency of client-main,
removing some duplicate code in exchange for a hopefully-negligible
difference in load time.
2019-10-15 19:14:32 +10:30
Guangcong Luo
9e06e72a35 Add support for watching battles
Playing battles is, of course, a lot harder, but watching them
is at least implemented now.
2019-09-06 02:46:54 -05:00
Guangcong Luo
6a3b62cdc9 Support Challenge menu
This adds support for a Challenge menu to the new Preact client.

- New: Support for "Controls", allowing Preact to render JSX at the
  bottom of chat scrollback - intended for challenge menus and battle
  controls in PS Mobile.

- New: <<pm-[userid]>> and <<challenge-[userid]>> links

- New: Support for client-side commands: /j, /chall, etc

- New: PMs have a user list

Actually challenging people isn't supported yet.
2019-08-31 00:04:45 -05:00
Guangcong Luo
898280c5e5 Improve format/team selector
This introduces a new TeamForm component, which can be used to choose
formats and teams.
2019-08-22 11:08:43 -07:00
kanmingxu00
9863615c69 Support folders in the battle team selector (#1343) 2019-08-14 00:56:26 -07:00
Kirk Scheibelhut
7951e4ac90 HP Type -> Hidden Power 2019-07-27 14:14:18 +02:00
Guangcong Luo
62e6c8e617 Make room for two rows of Japanese in status text 2019-07-16 11:53:49 -04:00
Guangcong Luo
ac741d2352 Limit userstatus size 2019-07-15 13:18:09 -04:00
Kirk Scheibelhut
0dfda499da Wrap long custom status messages 2019-07-10 19:23:03 -07:00
Guangcong Luo
b47708efa0 Implement teambuilder dropdown selector
This took way too long to get to a presentable state.

- search.js has been refactored into battle-search.ts (search logic)
  and battle-searchresults.tsx (display)

- panel-teambuilder.tsx has been split into teambuilder (team list) and
  teambuilder-team (team editor).

- The teambuilder's text editor can now detect which line it's on,
  and show the appropriate search result panel.

- The teambuilder's text editor now detects sets dynamically, and has
  the beginnings of support for set comments.

Currently, everything here is really basic, and mostly just a tech
demo for people to play around with and understand the direction of
the new teambuilder, but it'll be improved over time.
2019-06-25 00:51:27 -07:00
Guangcong Luo
9114cb9894 Make minor tweaks to teambuilder
Most of these update the pokemon/item/etc lists to be slightly more
modern, in preparation for their use in the Preact client.

(Also update TypeScript)
2019-06-07 18:36:36 -05:00
Guangcong Luo
bb6fe7ec3e Improve teambuilder stub
This should give an idea of the direction I want to take the
teambuilder in: a text editor, but with special features.

This neatly sidesteps a lot of UI questions, especially all the export
and input buttons, because the regular editing mode can be used to
import and export without anything fancy.

This also makes way for a better way to implement team/set comments:
comments are just invalid Pokémon in a team.
2019-05-16 01:27:19 +04:00
Kirk Scheibelhut
883cd91fc8 Handle AFK '@-in-names' protocol (take 2) (#1270) 2019-05-05 22:43:54 +09:30
Guangcong Luo
5348d1312e Revert "Handle AFK '@-in-names' protocol (#1265)"
There were several major crashes arising from it.

This reverts commit ba1e6d31bf.
2019-04-22 09:38:06 +09:30
Kirk Scheibelhut
ba1e6d31bf Handle AFK '@-in-names' protocol (#1265) 2019-04-22 06:41:46 +09:30
Guangcong Luo
7d52fd8c30 Implement TeamDropdown
Currently it's in the Main Menu where the old team dropdown was, but
the plan is for "Battle!" to eventually open a separate Search window.
2019-04-05 17:34:20 +08:00
Guangcong Luo
9c3dcd6233 Improve readmore box appearance 2019-03-22 18:51:44 +09:00
Guangcong Luo
fbaceafac1 Implement Rooms room 2019-03-21 20:16:01 +09:00
Guangcong Luo
6622e50234 Improve support for panel switching
Using arrow keys to switch rooms is now in! Unlike in the old client,
the new system supports switching to all rooms, and supports arrow keys
in all situations, rather than only being able to switch between chat
rooms, and only with textareas focused.

Also, focusing chat rooms now focuses the input box. This was
surprisingly hard to implement with React, which has an annoying
all-or-nothing approach to state it doesn't control.
2019-03-17 19:02:53 +09:00
Guangcong Luo
13dfe03a3a Support "read more" element
This is just code to support using details/summary for a "read more"
system. The entire summary portion can be clicked to expand/collapse,
but the overall usability feels "better than before" to me.
2019-03-14 04:03:11 +09:00
Guangcong Luo
06625b728c Don't pixelate avatars between 1x and 2x
Fixes #1196
2019-03-06 10:24:34 -05:00
Guangcong Luo
810da3b7d6 Default tab size in code blocks to width 4 2019-02-28 03:08:52 -05:00