templates/user_profile/opened-crates.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block title %}Profile{% endblock %}
  3. {% block body %}
  4.     <div class="grid-container fluid full-width" style="padding: 50px 0 50px 0;">
  5.         <div class="grid-x grid-padding-y grid-padding-x">
  6.             <div class="small-12 cell">
  7.                 <div class="grid-container" style="max-width: 1200px;">
  8.                     <div class="grid-x">
  9.                         <div class="small-12 large-2 cell" style="text-align: center;">
  10.                             <img class="user-profile-avatar" style="display: block;" src="{{ asset('build/images/web/icon-profile-otter.png') }}" />
  11.                             <h2 style="text-align: center; padding: 0; margin: 0;">{{ user.username ? user.username : '' }}</h2>
  12.                             {% if user.activeWallet is defined and user.activeWallet.address is defined %}
  13.                                 <a href="https://explorer.thetatoken.org/account/{{ user.activeWallet.address }}" target="_blank"><span style="font-weight: normal; font-size: 1em; color: #999; font-family: sans-serif;">{{ user.activeWallet.address ? user.activeWallet.address|slice(0,6) ~ '...' ~ user.activeWallet.address|slice(37,42) : '' }}</span></a>
  14.                             {% endif %}
  15.                         </div>
  16.                         <div class="small-12 large-8 cell">
  17.                             <div class="grid-x">
  18.                                 <div class="small-12 large-offset-1 cell">
  19.                                     <span class='family-orgovan' style="font-size: 3em;">{{ user.experience|number_format(0,'.',',') }}</span>
  20.                                     <span style="font-size: 2em; font-weight: bold; color: goldenrod;"> <em>{{ currentRank }}</em></span>
  21.                                 </div>
  22.                                 <div class="small-12 large-offset-1 cell">
  23.                                     <div class="grid-x">
  24.                                         {% set luck, distance, tension = 0, 3, 0 %}
  25.                                         {% for gear in userGear %}
  26.                                             <div class="small-12 large-1 cell" style="padding:5px;">
  27.                                                 {% if gear.inventoryEquipment is not null %}
  28.                                                     {% set luck = luck + gear.inventoryEquipment.statStar %}
  29.                                                     {% set distance = distance + gear.inventoryEquipment.statRectangle %}
  30.                                                     {% set tension = tension + gear.inventoryEquipment.statCircle %}
  31.                                                     <img style="border-radius: 10px;" src="{{ asset('https://tinyknightgames.s3.us-east-2.amazonaws.com' ~ gear.inventoryEquipment.template.imageUrl) }}" alt="{{ gear.inventoryEquipment.template.name }}"/></a>
  32.                                                 {% endif %}
  33.                                                 {% if gear.nftMetadata is not null %}
  34.                                                     {% set luck = luck + gear.nftMetadata.statStar %}
  35.                                                     {% set distance = distance + gear.nftMetadata.statRectangle %}
  36.                                                     {% set tension = tension + gear.nftMetadata.statCircle %}
  37.                                                     {% if gear.nftMetadata.nftMetadataQuest.progress > gear.nftMetadata.nftMetadataQuest.goal %}
  38.                                                         {% set luck = luck + gear.nftMetadata.nftMetadataQuest.statStarMod %}
  39.                                                         {% set distance = distance + gear.nftMetadata.nftMetadataQuest.statRectangleMod %}
  40.                                                         {% set tension = tension + gear.nftMetadata.nftMetadataQuest.statCircleMod %}
  41.                                                     {% endif %}
  42.                                                     <a href="{{ path('explorer_asset_detail', { id: gear.nftMetadata.nftHub.id }) }}"><img style="border:3px solid #fff; border-radius: 7px;" src="{{ asset(gear.nftMetadata.imageUrl) }}" alt="{{ gear.nftMetadata.name }}"/></a>
  43.                                                 {% endif %}
  44.                                             </div>
  45.                                         {% endfor %}
  46.                                         <div class="small-12 large-5 end cell"></div>
  47.                                         <div class="small-12 large-2 cell">
  48.                                             <div style="background: purple; margin: 5px; padding: 5px; border-radius: 5px; font-size: .9em; font-weight: bold; text-align: center;">
  49.                                                 L: {{ luck }}
  50.                                             </div>
  51.                                         </div>
  52.                                         <div class="small-12 large-2 cell">
  53.                                             <div style="background: purple; margin: 5px; padding: 5px; border-radius: 5px; font-size: .9em; font-weight: bold; text-align: center;">
  54.                                                 D: {{ distance }}
  55.                                             </div>
  56.                                         </div>
  57.                                         <div class="small-12 large-2 cell">
  58.                                             <div style="background: purple; margin: 5px; padding: 5px; border-radius: 5px; font-size: .9em; font-weight: bold; text-align: center;">
  59.                                                 T: {{ tension }}
  60.                                             </div>
  61.                                         </div>
  62.                                     </div>
  63.                                 </div>
  64.                                 <div class="small-12 large-offset-1 cell"  style="background: #222; border-radius: 10px; padding: 15px; margin-top: 15px;">
  65.                                     <div class="grid-container">
  66.                                         <div class="grid-x">
  67.                                             {% if userRecords is not null %}
  68.                                                 <div class="small-12 large-3">
  69.                                                     <p class="user-profile-record-num">{{ userRecords.totalCaught ? userRecords.totalCaught|number_format(0,'.',',') : 0 }}</p>
  70.                                                     <p class="user-profile-record-label">Caught</p>
  71.                                                 </div>
  72.                                                 <div class="small-12 large-3">
  73.                                                     <p class="user-profile-record-num">{{ userRecords.totalSalvaged ? userRecords.totalSalvaged|number_format(0,'.',',') : 0 }}</p>
  74.                                                     <p class="user-profile-record-label">Salvaged</p>
  75.                                                 </div>
  76.                                                 <div class="small-12 large-3">
  77.                                                     <p class="user-profile-record-num">{{ userRecords.totalCrafted ? userRecords.totalCrafted|number_format(0,'.',',') : 0 }}</p>
  78.                                                     <p class="user-profile-record-label">Crafted Items</p>
  79.                                                 </div>
  80.                                                 <div class="small-12 large-3">
  81.                                                     <p class="user-profile-record-num">{{ userRecords.totalConverted ? userRecords.totalConverted|number_format(0,'.',',') : 0 }}</p>
  82.                                                     <p class="user-profile-record-label">Converted to NFT</p>
  83.                                                 </div>
  84.                                             {% endif %}
  85.                                         </div>
  86.                                     </div>
  87.                                 </div>
  88.                             </div>
  89.                         </div>
  90.                     </div>
  91.                 </div>
  92.             </div>
  93.         </div>
  94.     </div>
  95.     <div class="grid-container" style="margin-top: 50px; margin-bottom: 50px;">
  96.         <div class="grid-x" >
  97.             <div class="small-12 medium-2 cell">
  98.                 <ul class="vertical menu">
  99.                     <li><a href="{{ path('user_profile', { userId: user.id, domain: app_domain }) }}">NFT Inventory</a></li>
  100.                     <li><a href="{{ path('user_profile_crates', { userId: user.id, domain: app_domain }) }}">Ancient Crates</a></li>
  101.                     <li><a href="{{ path('user_profile_opened_crates', { userId: user.id, domain: app_domain }) }}">Opened Crates</a></li>
  102.                     <li>Market</li>
  103.                     <li><a href="{{ path('user_sent_offers', { userId: user.id }) }}">Sent Offers</a></li>
  104.                     <li><a href="{{ path('user_received_offers', { userId: user.id }) }}">Received Offers</a></li>
  105.                     <li><a href="{{ path('user_active_listings', { userId: user.id }) }}">Active Listings</a></li>
  106.                     <li><a href="{{ path('user_sold_listings', { userId: user.id }) }}">Sold Listings</a></li>
  107.                     <li><a href="{{ path('user_purchased_listings', { userId: user.id }) }}">Purchased Listings</a></li>
  108.                     <li><a href="{{ path('user_withdrawal_history', { userId: user.id }) }}">Withdrawal History</a></li>
  109.                 </ul>
  110.             </div>
  111.             <div class="small-12 medium-10 cell">
  112.                 <turbo-frame>
  113.                     <div class="grid-x">
  114.                         <div class="small-12 cell">
  115.                             <h2>Opened Ancient Crates ({{ openedNftCrates|length }})</h2>
  116.                         </div>
  117.                         {% if openedNftCrates is empty %}
  118.                             <div class="small-12 cell">
  119.                                 <p>You do not have any opened Ancient Crates. Earn crates by playing <em>Occult of the Oculi</em>.</p>
  120.                             </div>
  121.                         {% else %}
  122.                             {% for crate in openedNftCrates %}
  123.                             <div class="small-12 medium-4 cell">
  124.                                 <div style="padding: 5px; background: #302737; border-radius:3px; margin-bottom: 5px;">
  125.                                     <a href="{{ path('explorer_asset_detail', { id: crate.nftHub.id }) }}"><img style="height: 50px; width: 50px; margin-right: 10px;" src="https://tinyknightgames.s3.us-east-2.amazonaws.com/public/template/nft/Crate.png" /></a>
  126.                                     <span style="font-weight: bold;">{{ crate.openedBy.user.username is defined ? crate.openedBy.user.username|slice(0,10) : crate.openedBy.address|slice(0,6) }}</span>
  127.                                 </div>
  128.                             </div>
  129.                             <div class="small-12 medium-1 cell" style="text-align: center; padding-top: 20px;">
  130.                                 <svg xmlns="http://www.w3.org/2000/svg" width="23.828" height="14.769" style=" margin: 0 5px; filter: invert(96%) sepia(78%) saturate(2%) hue-rotate(181deg) brightness(111%) contrast(100%);"><path d="m13.616 2.828 2.585 2.586H0v4h16.143l-2.527 2.526 2.828 2.829 7.384-7.384L16.444 0l-2.828 2.828z"/></svg>
  131.                             </div>
  132.                             <div class="small-12 medium-6 cell">
  133.                                 <div style="padding: 5px; background: #302737; border-radius:3px; margin-bottom: 5px;">
  134.                                     {% for nft in crate.nftHub.children %}
  135.                                         <a href="{{ path('explorer_asset_detail', { id: nft.id}) }}"><img style="height: 50px; width: 50px; margin-right: 10px;" src="{{ nft.nftMetadata.imageUrl }}" /></a>
  136.                                         <span style="font-weight: bold; font-color: #f2f2f2;">#{{ nft.nftMetadata.mint }}</span> {{ nft.nftMetadata.name|slice(0,24) ~ '...' }}
  137.                                     {% endfor %}
  138.                                 </div>
  139.                             </div>
  140.                             {% endfor %}
  141.                         {% endif %}
  142.                     </div>
  143.                 </turbo-frame>
  144.             </div>
  145.         </div>
  146.     </div>
  147. {% endblock %}