Vorlage:CharakterInfoboxZweiteForm: Unterschied zwischen den Versionen

Aus Dunkelherzen Wiki
Die Seite wurde neu angelegt: „<div style="float:right; width: 300px;"> {| class="wikitable" style="width:100%; max-width:300px;" |- ! colspan="2" style="text-align:center; background:#ccc;" | <div style="font-size: 120%; font-weight: bold;">{{PAGENAME}}</div> <div style="margin-top: 4px;"> <span class="plainlinks"> [<span onclick="document.getElementById('form1a').style.display='block'; document.getElementById('form2a').style.display='none';" style="cursor:pointer;">Form 1</span> | <…“
 
Keine Bearbeitungszusammenfassung
 
Zeile 7: Zeile 7:
<div style="margin-top: 4px;">
<div style="margin-top: 4px;">
<span class="plainlinks">
<span class="plainlinks">
[<span onclick="document.getElementById('form1a').style.display='block'; document.getElementById('form2a').style.display='none';" style="cursor:pointer;">Form 1</span> |
[<a href="javascript:void(0);" onclick="switchForm(1)">Form 1</a> |
<span onclick="document.getElementById('form1a').style.display='none'; document.getElementById('form2a').style.display='block';" style="cursor:pointer;">Form 2</span>]
<a href="javascript:void(0);" onclick="switchForm(2)">Form 2</a>]
</span>
</span>
</div>
</div>
|-
|-
| colspan="2" style="text-align:center;" |
| colspan="2" style="text-align:center;" |
 
<div id="form-image-1">[[Datei:{{{bild1|Placeholder.png}}}|250px]]</div>
<!-- Bildblock -->
<div id="form-image-2" style="display:none;">[[Datei:{{{bild2|Placeholder.png}}}|250px]]</div>
<div id="form1a" style="display:block;">[[Datei:{{{bild1|Placeholder.png}}}|250px]]</div>
<div id="form2a" style="display:none;">[[Datei:{{{bild2|Placeholder.png}}}|250px]]</div>


|-
|-
| '''Größe''' ||  
| '''Größe''' ||  
<div id="form1a" style="display:block;">{{{größe1|Unbekannt}}}</div>
<span id="form-groesse-1">{{{größe1|Unbekannt}}}</span>
<div id="form2a" style="display:none;">{{{größe2|Unbekannt}}}</div>
<span id="form-groesse-2" style="display:none;">{{{größe2|Unbekannt}}}</span>
|-
|-
| '''Gewicht''' ||  
| '''Gewicht''' ||  
<div id="form1a" style="display:block;">{{{gewicht1|Unbekannt}}}</div>
<span id="form-gewicht-1">{{{gewicht1|Unbekannt}}}</span>
<div id="form2a" style="display:none;">{{{gewicht2|Unbekannt}}}</div>
<span id="form-gewicht-2" style="display:none;">{{{gewicht2|Unbekannt}}}</span>


|-
|-
Zeile 49: Zeile 47:
|}
|}
</div>
</div>
<script>
function switchForm(n) {
  const isForm1 = (n === 1);
  document.getElementById("form-image-1").style.display = isForm1 ? "block" : "none";
  document.getElementById("form-image-2").style.display = isForm1 ? "none" : "block";
  document.getElementById("form-groesse-1").style.display = isForm1 ? "inline" : "none";
  document.getElementById("form-groesse-2").style.display = isForm1 ? "none" : "inline";
  document.getElementById("form-gewicht-1").style.display = isForm1 ? "inline" : "none";
  document.getElementById("form-gewicht-2").style.display = isForm1 ? "none" : "inline";
}
</script>

Aktuelle Version vom 12. Juli 2025, 21:06 Uhr

CharakterInfoboxZweiteForm

[<a href="javascript:void(0);" onclick="switchForm(1)">Form 1</a> | <a href="javascript:void(0);" onclick="switchForm(2)">Form 2</a>]

Größe

Unbekannt

Gewicht

Unbekannt

Spezies Unbekannt
Subspezies Unbekannt
Klasse Unbekannt
Subklasse Unbekannt
Alter Unbekannt
Geschlecht Unbekannt
Sexualität Unbekannt
Kultur/Nationalität Unbekannt
Ideologie Unbekannt
Fraktion Unbekannt

<script> function switchForm(n) {

 const isForm1 = (n === 1);
 document.getElementById("form-image-1").style.display = isForm1 ? "block" : "none";
 document.getElementById("form-image-2").style.display = isForm1 ? "none" : "block";
 document.getElementById("form-groesse-1").style.display = isForm1 ? "inline" : "none";
 document.getElementById("form-groesse-2").style.display = isForm1 ? "none" : "inline";
 document.getElementById("form-gewicht-1").style.display = isForm1 ? "inline" : "none";
 document.getElementById("form-gewicht-2").style.display = isForm1 ? "none" : "inline";

} </script>