diff --git a/EssentialCSharp.Web/Views/Home/Guidelines.cshtml b/EssentialCSharp.Web/Views/Home/Guidelines.cshtml index 87a5387a..cb2a4842 100644 --- a/EssentialCSharp.Web/Views/Home/Guidelines.cshtml +++ b/EssentialCSharp.Web/Views/Home/Guidelines.cshtml @@ -8,10 +8,48 @@

@ViewData["Title"]


+
+

+ C# Naming Conventions - Quick Reference Table + + + +

+
+ + + + + + + + + + + + + + + + + + + + + +
KindNaming ConventionExample
ClassesPascalCaseclass Car
Types and NamespacesPascalCasenamespace VehicleManufacturer;
ParameterscamelCasepublic Car(int odometerMileage, string manufacturer)
MethodsPascalCasepublic void StartEngine()
PropertiesPascalCasepublic double FuelLevel { get; set; }
Local VariablescamelCaseint yearManufactured;
Local FunctionsPascalCasestring CalculateMilesUntilEmpty(double fuelLevel)
Fields_PascalCaseprivate string _Day;
Enum MembersPascalCaseenum Status { Unknown, Operational, Broken, InShop }
Type ParametersTPascalCasepublic TOutput Convert<TInput, TOutput>(TInput from)
InterfacesIPascalCaseinterface ISampleInterface
+
+
+
@foreach (var group in guidelines.GroupBy(g => g.SanitizedSubsection).OrderBy(g => g.Key)) { -

@group.Key

+

+ @group.Key + + + +

foreach (var guideline in group) {
diff --git a/EssentialCSharp.Web/wwwroot/css/styles.css b/EssentialCSharp.Web/wwwroot/css/styles.css index f0b46c6c..fe346fb6 100644 --- a/EssentialCSharp.Web/wwwroot/css/styles.css +++ b/EssentialCSharp.Web/wwwroot/css/styles.css @@ -788,6 +788,28 @@ details > summary::-webkit-details-marker { border-color: var(--grey-lighten-2) transparent transparent transparent; } +/* Anchor Styling */ +.heading-wrapper:not(:hover) .anchor-link:not(:focus-visible) { + opacity: 0; +} + +.anchor-link { + border: none; + color: var(--link-color); + text-decoration: none; + position: absolute; + font-size: 14px; + margin: 4px 2px; + transition-duration: 0.4s; + cursor: pointer; + background-color: transparent; +} + + .anchor-link:hover { + color: var(--link-color-hover); + } + + /* The snackbar - position it at the bottom and in the middle of the screen */ #snackbar { visibility: hidden; /* Hidden by default. Visible on click */ diff --git a/EssentialCSharp.Web/wwwroot/js/site.js b/EssentialCSharp.Web/wwwroot/js/site.js index 5d57eb98..ca70cbfb 100644 --- a/EssentialCSharp.Web/wwwroot/js/site.js +++ b/EssentialCSharp.Web/wwwroot/js/site.js @@ -125,7 +125,19 @@ const app = createApp({ const snackbarColor = ref(); function copyToClipboard(copyText) { - let url = window.location.origin + "/" + copyText; + let url; + + // If copyText contains a #, it's a full path with anchor (e.g., 'page#anchor') + // If copyText doesn't contain a #, it's just an anchor for the current page + if (copyText.includes('#')) { + // Full path case: construct URL with origin + path + url = window.location.origin + "/" + copyText; + } else { + // Anchor only case: use current page URL + anchor + const currentUrl = window.location.href.split('#')[0]; // Remove any existing anchor + url = currentUrl + "#" + copyText; + } + let referralId = REFERRAL_ID; if (referralId && referralId.trim()) { url = addQueryParam(url, 'rid', referralId);