Skip to content

Commit

Permalink
Merge pull request #285 from ahmed0saber/improve-website-style-on-arabic
Browse files Browse the repository at this point in the history
Improve website style on Arabic
  • Loading branch information
maltejur committed May 1, 2024
2 parents 787c71a + 836c4c2 commit e7be8a9
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 29 deletions.
2 changes: 1 addition & 1 deletion components/algorithmsList/algorithmCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function AlgorithmCard({ algorithm }: { algorithm: Algorithm }) {
return (
<Card className={`elevateOnHover ${classes.stretchedCard}`}>
<CardContent>
<Breadcrumbs>
<Breadcrumbs className={classes.breadcrumbs}>
{algorithm.categories.map((category) => (
<Typography
variant="h6"
Expand Down
5 changes: 5 additions & 0 deletions components/algorithmsList/algorithmCard/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@
flex-direction: column;
justify-content: space-between;
}

:global(html[lang=ar]) .breadcrumbs,
:global(html[lang=ar]) .title {
direction: ltr;
}
2 changes: 1 addition & 1 deletion components/categoriesList/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
}

.text {
margin-left: 10px !important;
margin-inline-start: 10px !important;
}
4 changes: 2 additions & 2 deletions components/footer/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

.logo {
grid-area: logo;
margin-right: 40px;
margin-inline-end: 40px;
width: 80px;
height: 80px;
}

.list {
display: flex;
flex-direction: column;
margin-right: 30px;
margin-inline-end: 30px;
}

.list a {
Expand Down
6 changes: 5 additions & 1 deletion components/jumbo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ export default function Jumbo() {
</div>
<Typography className={classes.h2}>{t("welcomeTitle")}</Typography>
<div className={classes.input}>
<SearchBar query={query} setQuery={setQuery} />
<SearchBar
query={query}
setQuery={setQuery}
className={classes.Jumbo_SearchBar}
/>
</div>
</div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions components/jumbo/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,14 @@
width: 400px;
max-width: 100%;
}

:global(html[lang=ar]) .Jumbo_SearchBar label[data-shrink]{
left: unset;
right: 0;
transform: translate(-12px, 20px) scale(1);
transform-origin: right;
}

:global(html[lang=ar]) .Jumbo_SearchBar label[data-shrink=true]{
transform: translate(-12px, 10px) scale(0.75);
}
5 changes: 5 additions & 0 deletions components/langSelect/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
z-index: 99999 !important;
}

.menu [role=menu] {
padding-inline-end: 17px;
padding-right: 0px !important;
}

.icon {
width: 35px;
height: 25px;
Expand Down
2 changes: 2 additions & 0 deletions components/languagesList/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
flex-direction: column;
margin-top: 20px !important;
margin-bottom: 10px !important;
/* direction should stay ltr whatever the user-selected language is */
direction: ltr;
}

.sort,
Expand Down
4 changes: 2 additions & 2 deletions components/navbar/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

.title img {
height: 1.2em;
margin-right: 10px;
margin-inline-end: 10px;
}

.smallTitle {
Expand All @@ -56,7 +56,7 @@
}

.translateIcon {
margin-right: 8px;
margin-inline-end: 8px;
}

.toolbar svg {
Expand Down
2 changes: 1 addition & 1 deletion components/searchBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function SearchBar({
// When input value is not null, reset error & empty state to `false`.
// And also debounce the router push.
setIsError(false);
setIsEmpty(false);
setIsEmpty(false);
}

function handleSubmit(event?: FormEvent) {
Expand Down
3 changes: 2 additions & 1 deletion pages/algorithm/[algorithm].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default function AlgorithmPage({
const t = useTranslation();

return (
<div className="section container">
// direction should stay ltr whatever the user-selected language is
<div className="section container" style={{ direction: "ltr" }}>
<Head
title={algorithm.name}
description={t(
Expand Down
8 changes: 4 additions & 4 deletions pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
margin-top: 20px !important;
background-color: black !important;
color: white !important;
margin-right: 10px !important;
margin-inline-end: 10px !important;
}

.github svg {
margin-right: 7px;
margin-inline-end: 7px;
transform: scale(1.1);
}

Expand All @@ -60,7 +60,7 @@
}

.weblate svg {
margin-right: 7px;
margin-inline-end: 7px;
transform: scale(1.1);
}

Expand All @@ -71,7 +71,7 @@
}

.donate svg {
margin-right: 5px;
margin-inline-end: 5px;
}

.social > div {
Expand Down
7 changes: 7 additions & 0 deletions pages/search/search.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
transform: translateX(-50%);
margin-top: 40px !important;
}

.more span span {
margin-left: 0px;
margin-right: 0px;
margin-inline-start: -4px;
margin-inline-end: 8px;
}
42 changes: 27 additions & 15 deletions public/locales/en/categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"a5": "A 5",
"activationfunctions": "Activation Functions",
"ahocorasick": "Aho-Corasick",
"ai": "AI",
"arima": "ARIMA",
"array": "Array",
"associationalgorithms": "Association Algorithms",
"associativemining": "Associative Mining",
"audio": "Audio",
"audiofilters": "Audio Filters",
Expand All @@ -20,28 +20,33 @@
"bit": "Bit",
"bitmanipulation": "Bit Manipulation",
"blockchain": "Blockchain",
"board": "Board",
"booleanalgebra": "Boolean Algebra",
"buffers": "Buffers",
"cache": "Cache",
"catalan": "Catalan",
"cellularautomata": "Cellular Automata",
"checksum": "Checksum",
"ciphers": "Ciphers",
"classificationalgorithms": "Classification Algorithms",
"clientserver": "Client Server",
"cll": "CLL",
"clusteringalgorithms": "Clustering Algorithms",
"cn": "Cn",
"codewars": "Codewars",
"coloring": "Coloring",
"comparison": "Comparison",
"complementaryfilter": "Complementary Filter",
"compression": "Compression",
"computervision": "Computer Vision",
"concurrency": "Concurrency",
"conversions": "Conversions",
"cosinesimilarity": "Cosine Similarity",
"cpuschedulingalgorithms": "CPU Scheduling Algorithms",
"crdt": "Crdt",
"crypto": "Crypto",
"datacompression": "Data Compression",
"datamanipulation": "Data Manipulation",
"datapreprocessing": "Data Preprocessing",
"datastructures": "Data Structures",
"date": "Date",
"decisiontreeregressionwithkfoldcrossvalidation": "Decision Tree Regression with K-Fold Cross Validation",
Expand All @@ -50,17 +55,18 @@
"devutils": "Devutils",
"dictionary": "Dictionary",
"diffiehellman": "Diffiehellman",
"digests": "Digests",
"digitalimageprocessing": "Digital Image Processing",
"discretemathematics": "Discrete Mathematics",
"disjointset": "Disjoint Set",
"disjointsetunion": "Disjointsetunion",
"distance": "Distance",
"distances": "Distances",
"dithering": "Dithering",
"divideandconquer": "Divide and Conquer",
"divisibilityofintegers": "Divisibility of Integers",
"dynamic": "Dynamic",
"dynamicarray": "Dynamic Array",
"dynamiccoinchange": "Dynamic Coin Change",
"dynamicprogramming": "Dynamic Programming",
"edgedetection": "Edge Detection",
"electronics": "Electronics",
Expand All @@ -76,7 +82,6 @@
"fractals": "Fractals",
"fundamentalsofpython": "Fundamentals of Python",
"fuzzylogic": "Fuzzy Logic",
"gamemodel": "Game Model",
"games": "Games",
"ganspytorchvanillalsdc": "GANs-PyTorch-Vanilla-LS-DC",
"gcd": "Gcd",
Expand All @@ -97,31 +102,31 @@
"heap": "Heap",
"heaps": "Heaps",
"histogramequalization": "Histogram Equalization",
"http": "Http",
"imageprocessing": "Image Processing",
"ipynbcheckpoints": ".Ipynb Checkpoints",
"io": "Io",
"knapsack": "Knapsack",
"leetcode": "Leetcode",
"levenshtein": "Levenshtein",
"linearalgebra": "Linear Algebra",
"linearprogramming": "Linear Programming",
"linearregression": "Linear Regression",
"linkedlist": "Linked List",
"list": "List",
"logisticregression": "Logistic-Regression",
"longestincreasingsubsequence": "Longest Increasing Subsequence",
"lossfunction": "Loss Function",
"lsbbasedimagesteganography": "LSB Based Image Steganography",
"lstm": "Lstm",
"machinelearning": "Machine Learning",
"manacher": "Manacher",
"map": "Map",
"math": "Math",
"matrix": "Matrix",
"matrixexponentiation": "Matrix Exponentiation",
"max": "Max",
"min": "Min",
"minimax": "Minimax",
"minimaxplayground": "Minimax.playground",
"minimizationofpolynomialfunction": "Minimization of Polynomial Function",
"minimumspanningtree": "Minimum Spanning Tree",
"model": "Model",
"modular": "Modular",
"modulararithmetic": "Modular Arithmetic",
"morphologicaloperations": "Morphological Operations",
Expand All @@ -140,19 +145,22 @@
"numericalmethods": "Numerical Methods",
"numpy": "Numpy",
"operationsondatastructures": "Operations on Datastructures",
"optimization": "Optimization",
"others": "Others",
"paddings": "Paddings",
"palindrome": "Palindrome",
"pangram": "Pangram",
"parsing": "Parsing",
"particleswarmoptimization": "Particle Swarm Optimization",
"pascal": "Pascal",
"password": "Password",
"patternmatching": "Pattern Matching",
"patternsearch": "Pattern Search",
"permutation": "Permutation",
"permutations": "Permutations",
"physics": "Physics",
"pi": "PI",
"piecewise": "Piecewise",
"player": "Player",
"polynomialminimization": "Polynomial Minimization",
"polynomials": "Polynomials",
"power": "Power",
Expand All @@ -162,14 +170,15 @@
"problems": "Problems",
"processschedulingalgorithms": "Process Scheduling Algorithms",
"projectrosalind": "Project-Rosalind",
"prophet": "Prophet",
"quantitativefinance": "Quantitative Finance",
"quantum": "Quantum",
"queues": "Queues",
"random": "Random",
"randomforestclassification": "Random Forest Classification",
"rangequeries": "Range Queries",
"recursion": "Recursion",
"recursive": "Recursive",
"regressionalgorithms": "Regression Algorithms",
"robotics": "Robotics",
"scheduling": "Scheduling",
"scripts": "Scripts",
Expand All @@ -178,14 +187,17 @@
"segmenttrees": "Segment Trees",
"sequences": "Sequences",
"series": "Series",
"set": "Set",
"shufflers": "Shufflers",
"sieveoferatosthenes": "Sieve of Eratosthenes",
"similarity": "Similarity",
"slidingwindow": "Sliding Window",
"sortedset": "Sorted Set",
"sorts": "Sorts",
"sources": "Sources",
"spanningtree": "Spanning Tree",
"specializedstructure": "Specialized Structure",
"specialnumbers": "Special Numbers",
"sqrt": "Sqrt",
"stablemarriage": "Stable Marriage",
"stacks": "Stacks",
"stackwithsinglylinkedlist": "Stack with Singly Linked List",
Expand All @@ -194,16 +206,16 @@
"structure": "Structure",
"structures": "Structures",
"sum": "Sum",
"test": "Test",
"tests": "Tests",
"textclassification": "Text Classification",
"threads": "Threads",
"timingfunctions": "Timing-Functions",
"tls": "Tls",
"tree": "Tree",
"trie": "Trie",
"tries": "Tries",
"uint53": "Uint 53",
"utils": "Utils",
"vectors": "Vectors",
"view": "View",
"web": "Web",
"webprogramming": "Web Programming"
}
6 changes: 5 additions & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ html {
scroll-padding-top: 100px;
}

html[lang=ar] {
direction: rtl;
}

html,
body,
#__next {
Expand Down Expand Up @@ -128,4 +132,4 @@ html::-webkit-scrollbar {

html::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb);
}
}

0 comments on commit e7be8a9

Please sign in to comment.