- Welcome to the Kancolle Wiki!
- If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord
Changes
Jump to navigation
Jump to search
Line 2:
Line 2:
+
+
− +
− +
Line 56:
Line 58:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
− +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
− +
no edit summary
local ShipInfoKai = require('Module:ShipInfoKai')
local ShipInfoKai = require('Module:ShipInfoKai')
local Formatting = require('Module:Formatting')
local Formatting = require('Module:Formatting')
local format = require('Module:StringInterpolation').format
local EnemyShipInfoKai = ShipInfoKai{
local EnemyShipInfoKai = ShipInfoKai{
_template = [[{|class="${table_class}" id="${table_id}" style="border: 1px solid darkgray; width: 320px;"
_template = [[{|class="${table_class}" id="${table_id}" style="border: 1px solid darkgray; width: 320px;"
|-
|-
| colspan="6" style="position: relative; text-align: center; padding: 1px 40px; background-color: ${top_bg_color};${top_extra_style}" | <div style="position: absolute; right: 5px;">${edit_link}</div>
| colspan="6" style="position: relative; text-align: center; padding: 1px 40px; background-color: ${top_bg_color};" | <div style="position: absolute; right: 5px;">${edit_link}</div>
<p style="font-size:20px">'''${name}'''</p>${localized_name}
<p style="font-size:20px; text-shadow: ${text_shadow}">'''${name}'''</p>${localized_name}
<p style="font-size:15px">'''No.${id} ${japanese_name}${nick}'''</p>
<p style="font-size:15px">'''No.${id} ${japanese_name}${nick}'''</p>
<p>'''${class} ${type}'''</p>
<p>'''${class} ${type}'''</p>
|}]],
|}]],
_abyssal_class = "Abyssal",
_abyssal_class = "Abyssal",
_background_color = "darkgrey",
_link_color = "black",
_text_shadow_template = "0 0 ${radius} ${color}",
_text_shadows = {
"0.1em",
"0.3em",
"0.6em",
"0.9em",
},
_kai_glow_colors = {
"darkturquoise",
"dodgerblue",
},
_link_color_template = [[<span style="color: ${color};">${text}</color>]]
}
}
function EnemyShipInfoKai:bg_color()
function EnemyShipInfoKai:bg_color()
local back = self._ship:back()
local back = self._ship:back()
self._vars.top_bg_color, self._vars.top_extra_style = Formatting:format_ship_back(back), ""
local back_color = Formatting:format_ship_back(back)
local text_shadows = {}
for index, radius in ipairs(self._text_shadows) do
local color = back_color
if index <= #self._kai_glow_colors then
if back and back > -7 and back < -3 then
color = self._kai_glow_colors[index]
end
end
table.insert(text_shadows, format{self._text_shadow_template, radius = radius, color = color})
end
self._vars.top_bg_color, self._vars.text_shadow = self._background_color, table.concat(text_shadows, ", ")
end
function EnemyShipInfoKai:name()
local link, text, section = self._ship:link()
text = format{self._link_color_template, color = self._link_color, text = text or link}
self._vars.name = Formatting:format_link(link, text, section)
end
end
function ShipInfoKai:id()
function EnemyShipInfoKai:id()
self._vars.id = Formatting:format_stat(self._ship:id())
self._vars.id = Formatting:format_stat(self._ship:id())
end
end