Skip to content

Instantly share code, notes, and snippets.

@DreadKnight
Created May 7, 2012 08:12
Show Gist options
  • Save DreadKnight/2626604 to your computer and use it in GitHub Desktop.
Save DreadKnight/2626604 to your computer and use it in GitHub Desktop.
cards
<style>
.card {
width: 430px;
height: 550px;
background-image: url(card.png);
background-repeat: no-repeat;
padding: 15px;
margin: 0px;
vertical-align: top;
cursor: default;
}
.beast {
font-family: Lucida Grande;
font-size: 24px;
text-align: center;
}
.section {
color: #fff;
border-style: solid;
border-color: transparent;
width: 400px;
text-shadow: black 0.1em 0.1em 0.2em;
font-weight: bold;
font-size: 16px;
font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
}
.abilities {
vertical-align: top;
text-align: left;
}
.numbers {
font-size: 12px;
font-weight: bold;
text-align: center;
}
</style>
<?php
function ability($x, &$y, $ab_id, $row) {
global $WorkingDir;
echo "<td style=\"background-image: url('contour.png'), url('{$WorkingDir}creatures/$ab_id/$y.svg'), url('missing.png'); background-size: 100% 100%; width:99px; height:99px;\"></td>";
$y++;
echo "<td><u>{$row[$x]}</u><br>{$row["$x info"]}</td></tr>";
}
function cards($id) {
global $WorkingDir;
$ICON_LIST = array( HEALTH_ICON, REGROWTH_ICON, FATIGUE_ICON, ENERGY_ICON, MEDITATION_ICON, DELAY_ICON, OFFENSE_ICON, DEFENSE_ICON, MOVEMENT_ICON, PIERCE_ICON, SLASH_ICON, CRUSH_ICON, SHOCK_ICON, BURN_ICON, FROST_ICON, POISON_ICON, SONIC_ICON, MENTAL_ICON);
$ab_id = mysql_real_escape_string($id);
$ab_creatures = "SELECT * FROM ab_creatures WHERE id = '$ab_id'";
$ab_stats = "SELECT * FROM ab_stats WHERE id = '$ab_id'";
$ab_abilities = "SELECT * FROM ab_abilities WHERE id = '$ab_id'";
$result = mysql_query($ab_creatures);
echo "<table width=860px border=0><th class='card'>";
while ($row = mysql_fetch_assoc($result)) {
echo "<table class='section'><tr class='beast'><td width='20%'>{$row['sin']}{$row['lvl']}</td><td><a href='#{$row['id']}'>".strtoupper($row['name'])."</a><td width='20%'>{$row['hex']}H</td></tr></table>";
echo "<a href=\"#grid\"><div class=\"section\" style=\"border: 0px; background:url('{$WorkingDir}creatures/$ab_id/artwork.jpg'); width:400px; height:400px;\"><img src=\"AB.png\" style=\"position:relative; top:365px; left:180px;\"></div></a>";
echo "<div class='section' style='text-align: center; width: 390px; padding: 5px 0px;'>{$row['description']}</div>";
} mysql_free_result($result);
echo "</th><th class='card'><table class='section'><tr class='numbers'>";
for($i = 0; $i<9; $i++) echo "<th>{$ICON_LIST[$i]}</th>";
echo "</tr><tr class='numbers'>";
$result = mysql_query($ab_stats);
while ($row = mysql_fetch_assoc($result)) {
foreach ($row as $key => $x) {
if($key == 'id') continue;
echo "<td>$x</td>";
} echo "</tr></table>";
} mysql_free_result($result);
$result = mysql_query($ab_abilities);
$y = 0;
echo "<table style='margin-top:-10px; margin-bottom:-10px;' class='section abilities'><tr>";
$abilities = array("passive", "weak", "medium", "strong");
while ($row = mysql_fetch_assoc($result)) foreach ($abilities as $x) ability($x, $y, $ab_id, $row);
echo "</tr></table>";
mysql_free_result($result);
echo "<table class='section'><tr class='numbers'>";
for($i = 9; $i<18; $i++) echo "<th>{$ICON_LIST[$i]}</th>";
echo "</tr><tr class='numbers'>";
$result = mysql_query($ab_stats);
while ($row = mysql_fetch_assoc($result)) {
foreach ($row as $key => $x) {
if($key == 'id') continue;
echo "<td>$x</td>";
} echo "</tr></table>";
} mysql_free_result($result);
echo "</th></table>";
}?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment