refactor: Reduce code duplication by using the section element for general styling

- Fix indentation in index.html
This commit is contained in:
Marco Kaiser 2024-11-17 08:26:36 +01:00
parent 002e945bbe
commit be8c44ab7d
Signed by: kaiserkiwi
GPG key ID: 664DEC0325FA5EAC
2 changed files with 146 additions and 163 deletions

View file

@ -87,14 +87,19 @@ main {
padding-inline: var(--spacing-sm); padding-inline: var(--spacing-sm);
max-width: 1000px; max-width: 1000px;
margin: 0 auto; margin: 0 auto;
}
.form-section { section:not(.output-section) {
background-color: #102f2a; text-align: left;
padding: var(--spacing-md); background-color: #102f2a;
border-radius: 10px; padding: var(--spacing-md);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); border-radius: 10px;
margin-bottom: 40px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
color: var(--cyber-font-color);
&:not(:last-child) {
margin-bottom: 40px;
}
}
} }
.input-group, .radio-group, button { .input-group, .radio-group, button {
@ -207,27 +212,12 @@ button:active {
display: block; display: block;
} }
.output-section {
margin-top: 40px;
}
#outDiv { #outDiv {
display: none; display: none;
margin-top: 30px; margin-top: 30px;
text-align: center; text-align: center;
} }
/* FAQ Section */
.faq-section {
background-color: var(--cyber-faq-bg-color);
padding: var(--spacing-md);
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
color: var(--cyber-font-color);
margin-top: 40px;
text-align: left;
}
.faq-section h3 { .faq-section h3 {
font-size: 2rem; font-size: 2rem;
margin-bottom: 20px; margin-bottom: 20px;
@ -317,16 +307,6 @@ button:active {
.faq-answer li::marker { .faq-answer li::marker {
color: var(--cyber-highlight-color); color: var(--cyber-highlight-color);
} }
/* Credits Section */
.credits-section {
background-color: var(--cyber-faq-bg-color);
padding: var(--spacing-md);
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
color: var(--cyber-font-color);
margin-top: 40px;
text-align: left;
}
.credits-section h3 { .credits-section h3 {
font-size: 2rem; font-size: 2rem;

View file

@ -24,7 +24,7 @@
<meta name="author" content="Ramses Revengeday"> <meta name="author" content="Ramses Revengeday">
<meta name="theme-color" content="#1bec99"> <meta name="theme-color" content="#1bec99">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta property="fediverse:creator" content="@revengeday@corteximplant.com" /> <meta property="fediverse:creator" content="@revengeday@corteximplant.com"/>
</head> </head>
<body> <body>
@ -34,142 +34,145 @@
<img src="img/logo.png" alt="Logo"> <img src="img/logo.png" alt="Logo">
</div> </div>
</section> </section>
<main> <main>
<section class="form-section"> <section class="form-section">
<div class="form-container"> <div class="form-container">
<form id="generateForm" onsubmit="(async () => await circleMain())(); return false;"> <form id="generateForm" onsubmit="(async () => await circleMain())(); return false;">
<input id="txt_mastodon_handle" type="text" placeholder="e.g. @datakrash@corteximplant.net" required> <input id="txt_mastodon_handle" type="text" placeholder="e.g. @datakrash@corteximplant.net" required>
<div class="radio-group"> <div class="radio-group">
<input type="radio" id="detect" name="backend" value="detect" autocomplete="off" checked> <input type="radio" id="detect" name="backend" value="detect" autocomplete="off" checked>
<label for="detect">↳ Autodetect</label> <label for="detect">↳ Autodetect</label>
<input type="radio" id="mastodon" name="backend" value="mastodon" autocomplete="off"> <input type="radio" id="mastodon" name="backend" value="mastodon" autocomplete="off">
<label for="mastodon">Mastodon API</label> <label for="mastodon">Mastodon API</label>
<input type="radio" id="misskey" name="backend" value="misskey" autocomplete="off"> <input type="radio" id="misskey" name="backend" value="misskey" autocomplete="off">
<label for="misskey">Misskey API</label> <label for="misskey">Misskey API</label>
<input type="radio" id="pleroma" name="backend" value="pleroma" autocomplete="off"> <input type="radio" id="pleroma" name="backend" value="pleroma" autocomplete="off">
<label for="pleroma">Pleroma API</label> <label for="pleroma">Pleroma API</label>
</div> </div>
<div class="slider-container"> <div class="slider-container">
<label for="countSlider">Cyber Score:</label> <label for="countSlider">Cyber Score:</label>
<input type="range" id="countSlider" name="count" min="1" max="1000" value="250" step="1"> <input type="range" id="countSlider" name="count" min="1" max="1000" value="250" step="1">
<span id="sliderValueDisplay">250</span> <span id="sliderValueDisplay">250</span>
</div> </div>
<button type="submit" id="generateButton">⟨ Generate ⟩</button> <button type="submit" id="generateButton">⟨ Generate ⟩</button>
</form> </form>
</div> </div>
</section> </section>
<section class="output-section"> <span id="outInfo"></span> <section class="output-section"><span id="outInfo"></span>
<div class="canvas-container"> <div class="canvas-container">
<canvas alt="A central profile picture surrounded by numerous smaller circular images, mostly profile pictures of various styles and subjects, linked by lines. The background is black with green text saying Cyber Circle Creator in the top left corner." id="canvas" width="1000" height="1000" style=" <canvas alt="A central profile picture surrounded by numerous smaller circular images, mostly profile pictures of various styles and subjects, linked by lines. The background is black with green text saying Cyber Circle Creator in the top left corner." id="canvas" width="1000" height="1000" style="
background-image: url('img/circle.jpg'); background-image: url('img/circle.jpg');
background-size: cover; background-size: cover;
background-position: center; background-position: center;
"></canvas> "></canvas>
</div>
<div id="outDiv">
<h2><bdi id="outSelfUser"></bdi>'s Fedi Circle</h2>
<div id="usersDiv">
<div id="ud1" class="userSubDiv"></div>
<div id="ud2" class="userSubDiv"></div>
<div id="ud3" class="userSubDiv"></div>
</div> </div>
<div id="outDiv"> </div>
<h2><bdi id="outSelfUser"></bdi>'s Fedi Circle</h2> </section>
<div id="usersDiv"> <section class="faq-section">
<div id="ud1" class="userSubDiv"></div> <h3>Frequently Asked Questions</h3>
<div id="ud2" class="userSubDiv"></div>
<div id="ud3" class="userSubDiv"></div> <div class="faq-item">
<input type="checkbox" id="faq1" class="faq-checkbox">
<label for="faq1" class="faq-question">What does Cyber Score mean?</label>
<div class="faq-answer">
<p>The higher you set the value, the more your Fediverse conversations are examined to determine with which users you interact the most. Imagine it as if you would like to view the last 7 days, the last 14 days, the last 30 days. Note that the higher the value you enter, the longer it takes for your Cyber Circle to be generated.</p>
</div>
</div>
<div class="faq-item">
<input type="checkbox" id="faq2" class="faq-checkbox">
<label for="faq2" class="faq-question">Why is a Cyberpunk figure displayed instead of a profile picture?</label>
<div class="faq-answer">
<p>If a user's profile picture cannot be loaded, a placeholder image (in this case, a Cyberpunk figure) is displayed. This is done to provide a visual substitute in case the original image is unavailable due to loading errors or missing image URLs.</p>
</div>
</div>
<div class="faq-item">
<input type="checkbox" id="faq3" class="faq-checkbox">
<label for="faq3" class="faq-question">What do the different lines on the canvas represent?</label>
<div class="faq-answer">
<p><strong>Green Lines:</strong> These are default dashed lines that run from the center of the canvas to the user positions. They serve as visual connections between the main user and the other participants. <strong>Yellow Lines:</strong> These lines may be randomly drawn between different user positions to create additional visual connections and make the layout more dynamic. <strong>Red Line:</strong> The red line randomly connects the center of the canvas to one of the user positions, adding a highlight to the layout and emphasizing a particular connection.</p>
</div>
</div>
<div class="faq-item">
<input type="checkbox" id="faq4" class="faq-checkbox">
<label for="faq4" class="faq-question">Why is there a maze background on the canvas?</label>
<div class="faq-answer">
<p>It adds visual complexity to the canvas and is created using random diagonal lines in a grid pattern.</p>
</div>
</div>
<div class="faq-item">
<input type="checkbox" id="faq5" class="faq-checkbox">
<label for="faq5" class="faq-question">What happens if there is a delay in loading avatars?</label>
<div class="faq-answer">
<p>During the loading of avatars, a progress status is shown on the webpage indicating <strong>how many avatars have been successfully loaded</strong> (e.g., "Loading avatars: 1/10"). Once all avatars are loaded, this display disappears.</p>
</div>
</div>
<div class="faq-item">
<input type="checkbox" id="faq6" class="faq-checkbox">
<label for="faq6" class="faq-question">What does the message "Something went horribly wrong, couldn't fetch your user: Error fetching .../api/v1/accounts/lookup?acct=" mean?</label>
<div class="faq-answer">
<p>This message indicates that the instance is currently not responding. Please try again later.</p>
</div>
</div>
<div class="faq-item">
<input type="checkbox" id="faq7" class="faq-checkbox">
<label for="faq7" class="faq-question">Is it possible to directly link to my account?</label>
<div class="faq-answer">
<p>Yes, it is possible. Simply change the URL to<i>https://ccc.cyber.to/?@revengeday@corteximplant.com</i>, replacing <i>@revengeday@corteximplant.com</i>with your own account details.</p>
</div>
<div class="faq-item">
<input type="checkbox" id="faq8" class="faq-checkbox">
<label for="faq8" class="faq-question">Hey, how do I tell Cyber Circle Creator to buzz off and stop using my data? Where's the opt-out?!</label>
<div class="faq-answer">
<p>We understand some users have concerns about data usage by Cyber Circle Creator. This tool is based on a fork of AMNatty/Mastodon-Circles, and user feedback suggests a demand for opt-out capabilities. Here's what we're doing to address these concerns:</p>
<ol>
<li><strong>User Control:</strong> Cyber Circle Creator operates entirely within your browser, ensuring that no data is stored on external servers. This design choice was made to enhance user privacy and control, and there's no data analysis performed.
</li>
<li><strong>Initial Measures:</strong> We've added a user-agent to our create-circle.js file. This allows Fediverse administrators to block Cyber Circle Creator if desired. Guidelines on implementing this measure can be found in our wiki under <a href="https://git.cyberwa.re/revengeday/cyber-circle-creator/wiki/Opt-Out%3A+Guide+for+Fediverse+Administrators">Opt-Out: Guide for Fediverse Administrators</a>.
</li>
<li><strong>Future Plans:</strong> We are evaluating ways to implement an opt-out feature to offer more control over data interaction. For more details or to contribute to this effort, please see our <a href="https://git.cyberwa.re/revengeday/cyber-circle-creator/issues/6">Feature Request: Opt-Out from Cyber Circle Creator #6</a>. We are actively seeking collaborators to help develop this feature, despite the technical complexities due to our codebase.
</li>
</ol>
<p>If you have further questions or would like to contribute to this effort, please reach out. We appreciate your patience and feedback as we work to enhance user privacy and satisfaction.</p>
</div> </div>
</div> </div>
</section>
<section class="faq-section">
<h3>Frequently Asked Questions</h3>
<div class="faq-item">
<input type="checkbox" id="faq1" class="faq-checkbox">
<label for="faq1" class="faq-question">What does Cyber Score mean?</label>
<div class="faq-answer">
<p>The higher you set the value, the more your Fediverse conversations are examined to determine with which users you interact the most. Imagine it as if you would like to view the last 7 days, the last 14 days, the last 30 days. Note that the higher the value you enter, the longer it takes for your Cyber Circle to be generated.</p>
</div> </div>
</div> </section>
<section class="credits-section">
<div class="faq-item"> <h3>Credits</h3>
<input type="checkbox" id="faq2" class="faq-checkbox"> <div class="credits-content">
<label for="faq2" class="faq-question">Why is a Cyberpunk figure displayed instead of a profile picture?</label> <p>
<div class="faq-answer"> <span class="credits-title">Cyber Circle Creator</span> builds upon <a href="https://github.com/AMNatty/Mastodon-Circles" target="_blank" rel="nofollow">AMNatty/Mastodon-Circles</a>,
<p>If a user's profile picture cannot be loaded, a placeholder image (in this case, a Cyberpunk figure) is displayed. This is done to provide a visual substitute in case the original image is unavailable due to loading errors or missing image URLs.</p> which is a further development of <a href="https://github.com/andigandhi/Mastodon-Circles" target="_blank" rel="nofollow">andigandhi/Mastodon-Circles</a>.
</p>
<p>This project is licensed under the <a href="https://www.gnu.org/licenses/agpl-3.0.html" target="_blank" rel="nofollow">GNU Affero General Public License</a> and benefits from Fedibird support by <a href="https://github.com/noellabo/Mastodon-Circles" target="_blank" rel="nofollow">noellabo</a>, enhancing its functionality even further.</p>
<p>
We invite you to <a href="https://git.cyberwa.re/revengeday/cyber-circle-creator" target="_blank" rel="nofollow">create your own fork of Cyber Circle Creator</a> ♥.
</p>
<p>Moreover, the design employs the <a href="https://github.com/rektdeckard/departure-mono" target="_blank" rel="nofollow">departure-mono</a> typeface, crafted by rektdeckard and available under the <a href="https://opensource.org/licenses/MIT" target="_blank" rel="nofollow">MIT License</a>.</p>
</div> </div>
</div> </section>
</main>
<div class="faq-item"> <footer id="footer">
<input type="checkbox" id="faq3" class="faq-checkbox"> <p class="footer-note">Created by revengeday → <a href="https://corteximplant.com/@revengeday">@revengeday@corteximplant.com</a></p>
<label for="faq3" class="faq-question">What do the different lines on the canvas represent?</label> </footer>
<div class="faq-answer"> <script src="js/create-circle.js"></script>
<p><strong>Green Lines:</strong> These are default dashed lines that run from the center of the canvas to the user positions. They serve as visual connections between the main user and the other participants. <strong>Yellow Lines:</strong> These lines may be randomly drawn between different user positions to create additional visual connections and make the layout more dynamic. <strong>Red Line:</strong> The red line randomly connects the center of the canvas to one of the user positions, adding a highlight to the layout and emphasizing a particular connection.</p> <script src="js/image.js"></script>
</div> <script src="js/url.js"></script>
</div> <script src="js/slider.js"></script>
<script>initializeSlider();</script>
<div class="faq-item">
<input type="checkbox" id="faq4" class="faq-checkbox">
<label for="faq4" class="faq-question">Why is there a maze background on the canvas?</label>
<div class="faq-answer">
<p>It adds visual complexity to the canvas and is created using random diagonal lines in a grid pattern.</p>
</div>
</div>
<div class="faq-item">
<input type="checkbox" id="faq5" class="faq-checkbox">
<label for="faq5" class="faq-question">What happens if there is a delay in loading avatars?</label>
<div class="faq-answer">
<p>During the loading of avatars, a progress status is shown on the webpage indicating <strong>how many avatars have been successfully loaded</strong> (e.g., "Loading avatars: 1/10"). Once all avatars are loaded, this display disappears.</p>
</div>
</div>
<div class="faq-item">
<input type="checkbox" id="faq6" class="faq-checkbox">
<label for="faq6" class="faq-question">What does the message "Something went horribly wrong, couldn't fetch your user: Error fetching .../api/v1/accounts/lookup?acct=" mean?</label>
<div class="faq-answer">
<p>This message indicates that the instance is currently not responding. Please try again later.</p>
</div>
</div>
<div class="faq-item">
<input type="checkbox" id="faq7" class="faq-checkbox">
<label for="faq7" class="faq-question">Is it possible to directly link to my account?</label>
<div class="faq-answer">
<p>Yes, it is possible. Simply change the URL to <i>https://ccc.cyber.to/?@revengeday@corteximplant.com</i>, replacing <i>@revengeday@corteximplant.com</i> with your own account details.</p>
</div>
<div class="faq-item">
<input type="checkbox" id="faq8" class="faq-checkbox">
<label for="faq8" class="faq-question">Hey, how do I tell Cyber Circle Creator to buzz off and stop using my data? Where's the opt-out?!</label>
<div class="faq-answer">
<p>We understand some users have concerns about data usage by Cyber Circle Creator. This tool is based on a fork of AMNatty/Mastodon-Circles, and user feedback suggests a demand for opt-out capabilities. Here's what we're doing to address these concerns:</p>
<ol>
<li><strong>User Control:</strong> Cyber Circle Creator operates entirely within your browser, ensuring that no data is stored on external servers. This design choice was made to enhance user privacy and control, and there's no data analysis performed.</li>
<li><strong>Initial Measures:</strong> We've added a user-agent to our create-circle.js file. This allows Fediverse administrators to block Cyber Circle Creator if desired. Guidelines on implementing this measure can be found in our wiki under <a href="https://git.cyberwa.re/revengeday/cyber-circle-creator/wiki/Opt-Out%3A+Guide+for+Fediverse+Administrators">Opt-Out: Guide for Fediverse Administrators</a>.</li>
<li><strong>Future Plans:</strong> We are evaluating ways to implement an opt-out feature to offer more control over data interaction. For more details or to contribute to this effort, please see our <a href="https://git.cyberwa.re/revengeday/cyber-circle-creator/issues/6">Feature Request: Opt-Out from Cyber Circle Creator #6</a>. We are actively seeking collaborators to help develop this feature, despite the technical complexities due to our codebase.</li>
</ol>
<p>If you have further questions or would like to contribute to this effort, please reach out. We appreciate your patience and feedback as we work to enhance user privacy and satisfaction.</p>
</div>
</div>
</div>
</section>
<section class="credits-section">
<h3>Credits</h3>
<div class="credits-content">
<p>
<span class="credits-title">Cyber Circle Creator</span> builds upon <a href="https://github.com/AMNatty/Mastodon-Circles" target="_blank" rel="nofollow">AMNatty/Mastodon-Circles</a>,
which is a further development of <a href="https://github.com/andigandhi/Mastodon-Circles" target="_blank" rel="nofollow">andigandhi/Mastodon-Circles</a>.
</p>
<p>This project is licensed under the <a href="https://www.gnu.org/licenses/agpl-3.0.html" target="_blank" rel="nofollow">GNU Affero General Public License</a> and benefits from Fedibird support by <a href="https://github.com/noellabo/Mastodon-Circles" target="_blank" rel="nofollow">noellabo</a>, enhancing its functionality even further.</p>
<p>
We invite you to <a href="https://git.cyberwa.re/revengeday/cyber-circle-creator" target="_blank" rel="nofollow">create your own fork of Cyber Circle Creator</a> ♥.
</p>
<p>Moreover, the design employs the <a href="https://github.com/rektdeckard/departure-mono" target="_blank" rel="nofollow">departure-mono</a> typeface, crafted by rektdeckard and available under the <a href="https://opensource.org/licenses/MIT" target="_blank" rel="nofollow">MIT License</a>.</p>
</div>
</section>
</main>
<footer id="footer">
<p class="footer-note">Created by revengeday → <a href="https://corteximplant.com/@revengeday">@revengeday@corteximplant.com</a></p>
</footer>
<script src="js/create-circle.js"></script>
<script src="js/image.js"></script>
<script src="js/url.js"></script>
<script src="js/slider.js"></script>
<script>initializeSlider();</script>
</body> </body>
</html> </html>