-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
134 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,120 +1,129 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<meta name="referrer" content="origin"> | ||
<meta http-equiv="Content-Security-Policy" content="{{ .CSP }}"> | ||
|
||
<link rel="dns-prefetch" href="https://svgs.scryfall.io"> | ||
<link rel="preconnect" href="https://svgs.scryfall.io"> | ||
|
||
<link rel="preload" href="style.css?nonce={{ .Nonce }}" as="style"> | ||
<link rel="stylesheet" href="style.css?nonce={{ .Nonce }}"> | ||
|
||
<title>{{ .Title }}</title> | ||
<meta name="description" content="{{ .Description }}"> | ||
|
||
<meta property="og:type" content="website"> | ||
<meta property="og:url" content="https://rulesraker.com"> | ||
<meta property="og:title" content="{{ .Title }}"> | ||
<meta property="og:description" content="{{ .Description }}"> | ||
<meta property="og:image" content="https://rulesraker.com/card.jpg?nonce={{ .Nonce }}"> | ||
|
||
<meta name="twitter:card" content="summary"> | ||
<meta name="twitter:title" content="{{ .Title }}"> | ||
<meta name="twitter:description" content="{{ .Description }}"> | ||
<meta name="twitter:image" content="https://rulesraker.com/card.jpg?nonce={{ .Nonce }}"> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<nav id="toc" class="toc"> | ||
{{ range .Rules }} | ||
{{ if eq .Type "SubRule" }} | ||
{{ continue }} | ||
{{ end }} | ||
|
||
{{ if eq .Type "Rule" }} | ||
{{ if and | ||
(or | ||
(startsWith "701." .ID) | ||
(startsWith "702." .ID)) | ||
(not (startsWith "701.1" .ID)) | ||
(not (startsWith "702.1" .ID)) | ||
| not | ||
}} | ||
{{ continue }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ $class := printf "toc-%s" (lower .Type) }} | ||
<div class="toc-element {{ $class }}"> | ||
<div class="toc-number">{{ .Number }}</div> | ||
<div class="toc-name"><a href="#{{ .ID }}">{{ index .Body 0 }}</a></div> | ||
</div> | ||
{{ end }} | ||
</nav> | ||
|
||
<div id="content" class="content"> | ||
<header class="header"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" id="toggle-toc" class="toggle-toc-button" viewBox="0 0 16 16"> | ||
<path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5"/> | ||
</svg> | ||
<input class="search" disabled placeholder="coming soon..."> | ||
<div class="buffer"></div> | ||
</header> | ||
|
||
<div class="main-container"> | ||
<main class="main"> | ||
<h2 class="main-heading"><i>Magic: the Gathering</i> Comprehensive Rules</h2> | ||
|
||
<header class="rules-header text"> | ||
<p> | ||
Changes may have been made to this document since its publication. You can | ||
download the most recent version from the <a href="{{ .RulesURL }}">Magic rules website</a>. | ||
</p> | ||
<p> | ||
These rules are effective as of <time datetime="{{ .EffectiveDate | formatTime "2006-01-02" }}">{{ .EffectiveDate | formatTime "January 2, 2006" }}<time>. | ||
</p> | ||
<p> | ||
Rulesraker is unofficial Fan Content permitted under the Fan Content | ||
Policy. Not approved/endorsed by Wizards. Portions of the materials used | ||
are property of Wizards of the Coast. ©Wizards of the Coast LLC. | ||
</p> | ||
</header> | ||
|
||
<article class="rules text"> | ||
{{ range .Rules }} | ||
{{ template "rule.html" . }} | ||
{{ end }} | ||
</article> | ||
|
||
<hr> | ||
|
||
<footer class="credits text"> | ||
{{ range .Credits }} | ||
<p>{{ . | newlineToBR }}</p> | ||
{{ end }} | ||
</footer> | ||
</main> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<script nonce="{{ .Nonce }}" async> | ||
window.onload = function() { | ||
var toc = document.querySelector("#toc"); | ||
var toggleToc = document.querySelector("#toggle-toc"); | ||
|
||
toggleToc.addEventListener("click", function() { | ||
console.log("toggle toc"); | ||
toc.classList.toggle("hide-toc"); | ||
}); | ||
}; | ||
</script> | ||
</body> | ||
</html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<meta name="referrer" content="origin"> | ||
<meta http-equiv="Content-Security-Policy" content="{{ .CSP }}"> | ||
|
||
<link rel="dns-prefetch" href="https://svgs.scryfall.io"> | ||
<link rel="preconnect" href="https://svgs.scryfall.io"> | ||
|
||
<link rel="preload" href="style.css?nonce={{ .Nonce }}" as="style"> | ||
<link rel="stylesheet" href="style.css?nonce={{ .Nonce }}"> | ||
|
||
<title>{{ .Title }}</title> | ||
<meta name="description" content="{{ .Description }}"> | ||
|
||
<meta property="og:type" content="website"> | ||
<meta property="og:url" content="https://rulesraker.com"> | ||
<meta property="og:title" content="{{ .Title }}"> | ||
<meta property="og:description" content="{{ .Description }}"> | ||
<meta property="og:image" content="https://rulesraker.com/card.jpg?nonce={{ .Nonce }}"> | ||
|
||
<meta name="twitter:card" content="summary"> | ||
<meta name="twitter:title" content="{{ .Title }}"> | ||
<meta name="twitter:description" content="{{ .Description }}"> | ||
<meta name="twitter:image" content="https://rulesraker.com/card.jpg?nonce={{ .Nonce }}"> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<nav id="toc" class="toc"> | ||
{{ range .Rules }} | ||
{{ if eq .Type "SubRule" }} | ||
{{ continue }} | ||
{{ end }} | ||
|
||
{{ if eq .Type "Rule" }} | ||
{{ if and | ||
(or | ||
(startsWith "701." .ID) | ||
(startsWith "702." .ID)) | ||
(not (startsWith "701.1" .ID)) | ||
(not (startsWith "702.1" .ID)) | ||
| not | ||
}} | ||
{{ continue }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ $class := printf "toc-%s" (lower .Type) }} | ||
<div class="toc-element {{ $class }}"> | ||
<div class="toc-number">{{ .Number }}</div> | ||
<div class="toc-name"><a href="#{{ .ID }}">{{ index .Body 0 }}</a></div> | ||
</div> | ||
{{ end }} | ||
</nav> | ||
|
||
<div id="content" class="content"> | ||
<header class="header"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" id="toggle-toc" class="toggle-toc-button" viewBox="0 0 16 16"> | ||
<path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5"/> | ||
</svg> | ||
<input class="search" disabled placeholder="coming soon..."> | ||
<div class="buffer"></div> | ||
</header> | ||
|
||
<div class="main-container"> | ||
<main class="main"> | ||
<h2 class="main-heading"><i>Magic: the Gathering</i> Comprehensive Rules</h2> | ||
|
||
<header class="rules-header text"> | ||
<p> | ||
Changes may have been made to this document since its publication. You can | ||
download the most recent version from the <a href="{{ .RulesURL }}">Magic rules website</a>. | ||
</p> | ||
<p> | ||
These rules are effective as of <time datetime="{{ .EffectiveDate | formatTime "2006-01-02" }}">{{ .EffectiveDate | formatTime "January 2, 2006" }}<time>. | ||
</p> | ||
<p> | ||
Rulesraker is unofficial Fan Content permitted under the Fan Content | ||
Policy. Not approved/endorsed by Wizards. Portions of the materials used | ||
are property of Wizards of the Coast. ©Wizards of the Coast LLC. | ||
</p> | ||
</header> | ||
|
||
<article class="rules text"> | ||
{{ range .Rules }} | ||
{{ template "rule.html" . }} | ||
{{ end }} | ||
</article> | ||
|
||
<hr> | ||
|
||
<footer class="credits text"> | ||
{{ range .Credits }} | ||
<p>{{ . | newlineToBR }}</p> | ||
{{ end }} | ||
</footer> | ||
</main> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<script nonce="{{ .Nonce }}" async> | ||
window.onload = function() { | ||
var isSmallScreen = window.matchMedia("(max-width: 576px)"); | ||
var tocEl = document.querySelector("#toc"); | ||
var toggleTocEl = document.querySelector("#toggle-toc"); | ||
|
||
function toggleToc() { | ||
console.log("toggling toc"); | ||
tocEl.classList.toggle("hide-toc"); | ||
} | ||
|
||
tocEl.addEventListener("click", function() { | ||
if (isSmallScreen.matches) { | ||
toggleToc(); | ||
} | ||
}); | ||
|
||
toggleTocEl.addEventListener("click", toggleToc); | ||
}; | ||
</script> | ||
</body> | ||
</html> |