Giter VIP home page Giter VIP logo

diablo2-runewizard's Introduction

Runewizard for Diablo II: Resurrected

Live site fabd.github.io/diablo2-runewizard

Runewizard for Diablo II helps you keep track of the runes you have found and what runewords you can make with them.

Background

Runewizard used to be part of my mini fan site for Diablo II LoD called The Tankazon Resource (hosted at fabd/diablo2).

This repo is a full rewrite of the vanilla JS version I wrote ten+ years ago. It uses ViteJs, Vue3, and TailwindCSS/JIT. Typechecking is provided via JSDoc + TS types in ambient .d.ts files.

Should there be any new runewords / updates with Diablo II Resurrected, I hope this new repo will make it easier to keep the site updated!

Changelog

See Releases tab for updates.

Bugs & Feature Requests

Please report any bugs or incorrect information in the Issues tab.

Feel free to post suggestions as well. If I like an idea, maybe I'll work on it.

Contributions

In general Pull Requests for small fixes/typos are welcome.

For substantial changes, it's probably best to let me know in advance so I can tell you if I am interested to merge them. Keep in mind this is a little playground for me to experiment with ViteJs, Vue 3 and TypeScript (and now JSDoc). There are quite a few ideas I have in mind I'd like to work on.

For D2 modders

If you need help to modify Runewizard for a Diablo II mod (ie. supporting new runes/runewords specific to a mod), feel free to ask in the Issues tab and I'll try to help you set it up. Let me know about your fork! I may post a link here and/or in the Runewizard footer.

Getting started

Local development

Clone the repository, install the dependencies, and start the Vite server:

git clone https://github.com/fabd/diablo2-runewizard.git
npm install
npm run dev

Build to host online (eg. a Diablo II mod site)

Use npm run build (or just vite build to skip the TypeScript check which is kinda slow). Then deploy all the files in the dist/ folder to wherever you'd like to host it.

Be aware that small images can be encoded inside the JS or CSS as base64 URLs. If you don't like this and would rather have all images output separately, set assetsInlineLimit in vite.config.ts to zero.

Take special note of Public Base Path configuration if your images aren't showing (cf. base in vite.config.ts).

Build for use offline (without development environment)

Sadly we can not simply drag-and-drop the index.html file (from the dist/ folder) into a browser. The browser will issue CORS errors, and refuse to load both Javascript and Css files.

Follow these steps to make it work offline:

  1. set base in vite.config.ts to ./ (a relative path) : this causes references to images and other assets to be relative eg. './images/foo.png' instead of '/images/foo.png'
  2. disable code splitting to simplify next step (this is already configured so we have a single output css and js file)
  3. manually edit the html to "inline" the contents of the CSS and JS

Remove these

<script type="module" crossorigin src="/assets/index.18705ba6.js"></script>
<link rel="stylesheet" href="/assets/style.06ce5f32.css" />

And instead add script & style tags and copy the file contents inside:

<head>
  ...
  <style type="text/css">
    /* copy/paste contents of the css file here */
  </style>
</head>
<body>
  <div id="app"></div>
  ...
  <script type="module">
    /* copy/paste contents of the javascript file here */
  </script>
</body>

Development notes

VSCode setup

The package prettier is locked at 2.2.1 because of prettier issue 10918

Likewise Vetur extension in VSCode should be locked at 0.33.1, last version to use prettier 2.2.1 (I use Vue Language Features (Volar) which seems to work better with Vue3).

Typechecking with JSDoc + TypeScript types

The project now uses JSDoc + TypeScript types via ambient .d.ts files. This is mainly an experiment, and also a way to make TypeScript optional. You should get correct code completions as well as TypeScript errors in the IDE with VSCode + Volar extension.

Customizing the header

The game version as well as links in the header can be configured in the .env file. It can also be turned off, for eg. including in an existing layout.

Using localStorage vs cookie

Runewizard uses localStorage (instead of a cookie in the old version) to maintain selected runes: this is so that the app can be built to work completely offline. In the case of loading index.html via file:/// URL, cookies don't work.

Either way it is a known limitation that if the user clears "Cookie & other site related data" manually in their browser, the user state will be reset. For such a small app I felt it's an acceptable tradeoff, as creating a server for that seems overkill.

Stylesheets (css, scss)

Stylesheets are kept in one folder under src/assets/. This is convenient for me and avoids issues with .scss linting of .vue files in VSCode not working properly (could be a bug with Vetur/Vite or maybe I misconfigured something).

In order to be able to use Sass and Tailwind together, the ordering of CSS declarations matters (cf. Tailwind imports in the main stylesheet). Ideally custom CSS should follow a strict BEM-like syntax, to avoid specificity issues.

SVG icons

The icons come from icones.js. Click "Components > Vue" in the bottom bar of that site to get the code for an icon. Could use vite-plugin-icons instead.

Thanks

  • @migouelBL for providing required levels data (in the old repository)

Copyright notices

The rune icon in the header is Copyright © BLIZZARD ENTERTAINMENT. It is from a screenshot of Diablo II Resurrected.

SVG icons come from icones.js.org and are all licensed under some kind of open-source or free licence (cf. Iconify License)

License

MIT.

diablo2-runewizard's People

Contributors

aglarcz avatar alysson-azevedo avatar colisan avatar fabd avatar thomas-seidel avatar trangoul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

diablo2-runewizard's Issues

Avoid clipping of the Runeword popup at bottom of the browser viewport

Avoid clipping the popup, particularly if user has zoom level > 100% in the browser.

Possible implementation:

  • make the popup fixed position, always center and top of the viewport -- regardless of page scroll
  • (optional) make the header also fixed so it stays on the page (would look nicer I think once the popup is "stuck" to the top edge, makes the top area less empty looking)

Improve search UX with common search tags

Since users can play the game in many languages ad we won't realistically suport languages in this simple app, it could make sense to add UX in the form of tags for common searches under the search bar.

  • makes search by weapon type/etc obvious to users
  • match common search terms : weapons, armors, swords;, axes etc.

...

Search [ __________________________________ ] 
( axes ) ( bows ) ( swords ) ( missile weapons ) ...
  • design some tags under search bar ( FIGMA )
  • chose a small but common set of tags, display under search bar
  • apply highlighted style to active tag(s)
  • tags should probably be exclusive (if one is clicked, un-select the other ones)

Runeword popup clipping at bottom

Simple fix by designing a footer to fill some verttical space at bottom of page

And/or do something more fancy to compute the popup height and move it

Spirit Runeword

It should have the "L" icon as it is a Ladder runeword, I mistakenly tried creating one in Single Player because the Runewizard didn't indicate that it was a Ladder runeword

Project Diablo 2 Fork Support (setup project with Win10 + WSL)

Hi @fabd !

First of all, thank you for your work, it has been incredibly useful and i'm very grateful for your endeavor!

Here with Season 6 of PD2 coming up this Friday (Nov 25th), i'm trying to have this thing up and running (yet again :D). Due to my limited knowledge (i can read html / css, but have no clue about JS), i cannot understand why my github pages are failing to load.

In my fork i've updated Main branch with all the new and changed runeword-descriptions, runewords, item types. Changed a few things elsewhere to reflect PD2. In the gh-pages branch i synched it with yours, tried to do few updates to see if pages will work, but they don't. https://kvothed2.github.io/pd2-runewizard/
It is failing to load resource /src/main.ts
I tried to launch it from the gh-pages /root and /docs (no idea about this tho) and from main /root

If this is something you can help me with easily, i would be forever grateful.
Thank you very much.
KvotheD

Fix popup activation on tablet / touch device

Change the mouseover events for the runeword popup as mousenter/mouseleave doesn't seem to work with touch on tablet.

Responsive layout is not important for this app, but being able to see the popup with a touch input would be better.

Improve search for weapons / armor

Currently searching sword does not match runewords with generic Melee Weapons as a weapon type.

It would be nice for a weapon class search term to match runewords with "Melee Weapons", "Missile Weapons".

Implementation?

While matching the search term with weapon type, somehow "Melee Weapons" or "Weapons" needs to be an alias for the possible weapon types to match against.

Indicate the standard mods from runes in runewords

For example Spirit's 7% Life Stolen Per Hit comes from Amn (when socketed into a weapon (Swords).

We could display [Amn] next to the mod, or the icon (though it's not easy to remember rune names from the icons alone).

The best way to do this of course would be to derive all that data from datafiles; but that's a lot of work that's perhaps not warranted at this point.

A simpler way could be to just add [Amn] in the runeword description; and style these accordingly. Perhaps support basic markdown to format the runeword text.

Inconsistency with "tinfos" display for Leaf and Memory runeword ?

Hello, Leaf is defined as :
{ title: "Leaf", runes: ["Tir", "Ral"], level: 19, ttypes: ["Staves"], tinfos: "(Not Orbs/Wands)", },

with text "(Not Orbs/Wands)"

and Memory is defined as :
{ title: "Memory", runes: ["Lum", "Io", "Sol", "Eth"], level: 37, ttypes: ["Staves"], tinfos: "(Not Orbs)", },

with text "(Not Orbs)".

But it looks like Memory can't be inserted into a wand either as this runeword requires a 4 slotted staff.

favicon

Try some tools that generate favicon.

ladder only rundewords

In D2R you can make all the old ladder only runewords in non-ladder or singleplayer. I just made an insight for example and I don't play ladder. Only the new 2.4 runewords are ladder only.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.