Commit Graph

75 Commits

Author SHA1 Message Date
Guangcong Luo
3d6b33e27f Fix style error 2021-05-14 04:51:48 -04: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
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
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
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
Guangcong Luo
9c3dcd6233 Improve readmore box appearance 2019-03-22 18:51:44 +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
Guangcong Luo
d2ef03c07a Fix tooltips in downloaded replays 2019-02-20 03:09:59 -05:00
Guangcong Luo
e372b6f24b Fix bugs in tooltip refactor 2019-02-19 00:17:58 -05:00
Guangcong Luo
5c983df6d3 Massively improve tooltips
- Tooltips work in replays now
- Calculation is better (correctly handles more corner cases)
- Explanations are better (better messages for Magic Room etc)
- Tooltips for sidebar pokemon
- Support "locking" tooltips with long-click / long-tap
- Can copy/paste from locked tooltips
- Increased font size
2019-02-18 22:38:13 -06:00
Guangcong Luo
e45256d98b Pixelate trainersprites/types on Retina screens 2018-12-16 16:16:07 -06:00
Guangcong Luo
3004f2f0b6 Add line breaks to spacers
Makes battle logs look nicer when copy/pasted as plaintext.
2018-11-23 01:40:15 -06:00
Guangcong Luo
f75d85fdaf Reimplement "ignore nicknames" without CSS
Honestly, the CSS solution was really cool. It was just incompatible
with the new system. It also had enough other flaws (like, bad
accessibility) that I don't feel _too_ bad about ripping it out.

The new version is less code, anyway, although it does have the flaw of
needing to replay the battle if you turn nicknames on or off.
Fortunately, that should be a rare enough occurrence not to be a big
deal.
2018-11-15 18:52:53 -06:00
Guangcong Luo
6d80607312 Fix Play/Resume button location 2018-06-11 03:24:32 -07:00
Guangcong Luo
c590a0c370 Add new BattleScene animation engine
battle.js is probably PS's oldest code. It's received minor touch-ups:
a refactor to prototypes early on, and then a refactor to TypeScript
and classes recently, but otherwise it's had basically zero maintenance
until now.

That's probably why this refactor took me over a week.

The biggest change is that the animation engine strewn around
Pokemon, Side, and Battle has been broken out into a new class named
BattleScene.

Pokemon, Side, and Battle now only track state; all animation is now
done in BattleScene and PokemonSprite.

The fates of major classes:

battle.ts:Pokemon - animation has been moved, mostly to PokemonSprite
battle.ts:Side - animation has been moved, to PokemonSprite/BattleScene
battle.ts:Battle - animation has been moved, mostly to BattleScene

Major changes:

- Many many variables have been renamed to be much clearer about what
  they mean. For instance, `animationDelay` is now `timeOffset`, and
  `activityDelay` is now `minWait`. A few bugs relating to me mixing
  up these two variables have also been fixed. jQuery variables named
  like `fooElem` have been renamed like `$foo`.

- The unnecessarily complicated queue1/queue2/activeQueue system,
  previously used for telling the animation engine to stop after Pause
  was pressed, has been replaced with a simple `interruptionCount`
  counter.

- The entire scene can now be reconstructed from scratch, which means
  that the `fastForward` system no longer needs to touch the DOM
  outside of the battle log. "Prev turn" and "Skip to turn" should be
  faster in 1000-turn battles now.

- The animation engine now supports displaying weather and terrain
  simultaneously.

- During a replay, Team Preview is shown for a second (instead of
  immediately skipping to the battle).

- Various aspects of the animation engine should be much less brittle
  now.

- Many bugs were fixed (and new ones were introduced).
2018-06-07 02:22:36 -07:00
Guangcong Luo
8c48261640 Make self-highlight slightly more visible 2017-10-15 19:54:08 -04:00
Guangcong Luo
5737b81996 Redesign pokemon sidebar
Now Pokemon are only faded out if they haven't necessarily been brought
into the battle.
2017-08-02 20:44:47 -04:00
Guangcong Luo
08ca2d13f7 Fix Reflect/etc text in dark mode
Fixes #952
2017-06-24 03:04:19 -04:00
Slayer95
346bf935db Refactor custom icons to a single element <psicon> and use Caja (#945)
Since real custom elements still have very limited availability, this is the most proper way to do it, and results in a more predictable HTML parsing.
Adds support for custom styles and classes.

Example: <psicon pokemon="meloetta" class="pixelated" style="opacity:0.4" />
2017-06-17 14:38:52 -07:00
Guangcong Luo
eac71a2640 Implement terrain backgrounds 2017-06-11 11:19:25 -04:00
Guangcong Luo
d22c2b4368 Refactor chat CSS 2017-05-15 05:55:08 -04:00
asgdf
3589926ca8 Fix dark mode style regressions (#902)
1. subtly notifying roomtab title turned white on mouseover
2. bold text in colored broadcast boxes turned blue in the battle chat
2017-04-25 00:57:10 -07:00
urkerab
3c0864380a Modchat messages are not battle messages (#899) 2017-04-14 14:55:46 -04:00
Guangcong Luo
7aa2412055 Add new pixelated CSS class 2017-03-09 13:54:20 -05:00
asgdf
77dcb5e5b0 Fix some dark mode visibility issues (#879) 2017-03-05 12:45:08 -05:00
Guangcong Luo
f65669168f Remove superfluous "pokemonicon" class
This commit consolidates all Pokemon icons in 'picon'.

Perhaps now we'll be able to rename picon -> pokemonicon now that the
old name is no longer used... but I guess that can be reserved for a
future commit.
2016-12-14 19:57:22 -05:00
Marty-D
213beb4845 Add Aurora Veil messages and animation 2016-11-19 19:09:05 -05:00
Shashwat Chandra
dbd8cdbda6 Add coloration to modified stats (#794) 2016-11-07 23:39:57 -08:00
QuiteQuiet
0159762959 Update battle log when ignoring something (#784) 2016-11-02 13:06:10 -07:00
Marty-D
6019340f5b Support Gen 6 minisprites in battle sidebars 2016-10-03 21:07:38 -04:00
submindraikou
82c4c05600 Add highlights to battles (#723) 2016-06-16 07:09:57 +02:00
Ridaz
6ecc709813 Improve greentext color in Dark Mode (#694) 2016-05-11 03:46:44 -07:00
asgdf
391c7fd9d8 Make subtle buttons more visible in dark mode (#698)
Additionally, move .subtle styling to battle.css
2016-04-26 09:34:13 -07:00
asgdf
39ac7e08ed Make declared visited links readable in dark mode (#695)
Make sure .dark a:visited doesn't apply to links in declares or colored
broadcast divs
2016-04-19 20:03:24 -07:00
Guangcong Luo
70a3c608f6 Make greentext more subtle 2016-04-19 07:25:29 -04:00
Ridaz
bf6ece274e Increase opacity in battle background (#688)
Now it looks too bright
2016-04-10 14:10:48 -07:00
Guangcong Luo
503f6117c3 Improve greentext/emoticon detection
In particular:

>w>
>////<

are now considered emoticons and not greentext.
2016-04-06 17:39:47 -04:00
Guangcong Luo
f27111036b Add image-rendering:pixelated to icons 2016-03-17 10:43:49 -04:00
Guangcong Luo
cc2c980630 Improve appearance of status-bar typechange 2016-02-11 21:17:51 -05:00
Guangcong Luo
b5ac1f5892 Improve Dark Mode
- Popups are now dark
- Topbar username outline is now black
- Teams and team/format selects are now darker
- Code and spoiler blocks are now dark
2016-02-05 14:36:54 -05:00
Guangcong Luo
bc5be44c15 Battles: Fix bugs in fastForward optimization
In particular, weather updating was unreliable, and scrolling down
happened way more often than necessary.
2016-01-25 03:30:35 -05:00
Guangcong Luo
7aaf8f3cdb Use new-size icons for team lists 2015-12-24 14:58:53 -06:00
Guangcong Luo
1bcc75e750 Use relative URIs in CSS where possible
This replaces the previous protocol-relative URIs, which should allow
testclient to work much better.
2015-12-13 13:25:41 -05:00
Guangcong Luo
cea3623dac Downloadable replays!
Replays can now be downloaded into .html files.

The .html files mainly contain replay log data; the actual replay
player is downloaded online. Also included is a textual log and
some minimal CSS to make it look pretty, for offline viewing.

This strategy helps keep the replay file reasonably small; of
the 30 KB or so for a 50-turn battle, around 10 KB is the log
data, and around 20 KB is the textual log.
2015-12-07 03:19:46 -05:00
Guangcong Luo
d66e7a43b1 Improve battle animations
- Ability activations are now handled consistently
- Ability activations now look different, the ability name appears
  under other result anims and doesn't move
- Replace animDelay with the same animationDelay system we use for
  everything else in the engine
- Group multiple stat boosts/drops
- Group damage when possible in spread moves in doubles/triples
2015-12-05 01:39:50 -05:00
Guangcong Luo
356a248bc2 Slightly darken spoilers 2015-12-01 01:44:09 -05:00