コード例 #1
0
        public string RenderHamburger()
        {
            var key = TagHelpers.GetRandomHexNumber(8);

            return($@"
                {TagHelpers.MsoConditionalTag(
                   $@"<input type=""checkbox"" id=""{key}"" class=""mj-menu-checkbox"" style=""display:none !important; max-height:0; visibility:hidden;"" />",
                   true
                )}
                <div {HtmlAttributes(new Dictionary<string, string> {
                    { "class", "mj-menu-trigger" },
                    { "style", "trigger" }
                })}>
                    <label {HtmlAttributes(new Dictionary<string, string> {
                        { "for", key },
                        { "class", "mj-menu-label" },
                        { "style", "label" },
                        { "align", GetAttribute("ico-align") }
                    })}>
                        <span {HtmlAttributes(new Dictionary<string, string> {
                            { "class", "mj-menu-icon-open" },
                            { "style", "icoOpen" }
                        })}>
                            {GetAttribute("ico-open")}
                        </span>

                        <span {HtmlAttributes(new Dictionary<string, string> {
                            { "class", "mj-menu-icon-close" },
                            { "style", "icoClose" }
                        })}>
                            {GetAttribute("ico-close")}
                        </span>
                    </label>
                </div>
            ");
        }