1. Hello!

    First of all, welcome to MapleLegends! You are currently viewing the forums as a guest, so you can only view the first post of every topic. We highly recommend registering so you can be part of our community.

    By registering to our forums you can introduce yourself and make your first friends, talk in the shoutbox, contribute, and much more!

    This process only takes a few minutes and you can always decide to lurk even after!

    - MapleLegends Administration-
  2. Experiencing disconnecting after inserting your login info? Make sure you are on the latest MapleLegends version. The current latest version is found by clicking here.
    Dismiss Notice

A web app for generating QR voting links

Discussion in 'Programming' started by geospiza, Feb 15, 2021.

  1. geospiza
    Offline

    geospiza Web Developer Staff Member Web Developer

    212
    449
    215
    Apr 16, 2020
    2:12 AM
    geospiza
    Dark Knight
    146
    Funk
    I built a stand-alone site for generating links and QR codes to the voting pages. The use case is to quickly navigate to the voting page from a phone and bookmark it for use.

    https://ml-vote.geospiza.me/


    upload_2021-2-15_13-55-7.png


    Source: https://bitbucket.org/geospiza/geospiza.me/src/main/apps/ml-vote/
    You can also look in the developer console for the source code:

    upload_2021-2-15_14-3-22.png

    And since this is a programming section, I'm pretty happy with svelte for hacking together sites like this quickly (this took me 20 minutes of coding total). The main piece of logic looks like this:

    Code:
    let username;
    let gtopQR;
    let topgQR;
    $: gtop = `https://gtop100.com/topsites/MapleStory/sitedetails/MapleLegends-The-Old-School-MapleStory-Server-MAC-Compatible-16-9-Client-No-Hackers-87398?vote=1&pingUsername=${username}`;
    $: topg = `"https://topg.org/maplestory-private-servers/in-605064-${username}`;
    $: QRCode.toDataURL(gtop).catch(console.log).then(data => (gtopQR = data));
    $: QRCode.toDataURL(topg).catch(console.log).then(data => (topgQR = data));
    
    There's not too much to it :) I'm thinking of adding this to the webextension that I've been building, which also uses svelte for creating content that gets injected into the main site.
     
    • Great Work Great Work x 4
    • Creative Creative x 1
  2. PandaOnPanda
    Offline

    PandaOnPanda Timer

    101
    26
    120
    Jun 29, 2019
    5:12 AM
    PandaOn___
    Paladin, I/L Arch Mage, Corsair
    Homies
    As always, awesome stuff.

    I've never delved much into web dev stuff, but just glancing at the svelte examples, some of the js tricks in svelte remind me of some of the functionality in the python framework Flask if you've ever used that. Looks like a cool super light weight framework thanks for linking it
     
  3. OP
    OP
    geospiza
    Offline

    geospiza Web Developer Staff Member Web Developer

    212
    449
    215
    Apr 16, 2020
    2:12 AM
    geospiza
    Dark Knight
    146
    Funk
    The syntax definitely has some of those Jinja vibes from Flask.

    I give it a strong recommendation if you ever fancy building a small website/tool. Svelte is niche, but it feels lighter-weight than similar tools like React.
     

Share This Page